Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding MAKE_ITEM_GROUP #247

Open
1 of 2 tasks
UTengine opened this issue Aug 6, 2024 · 6 comments
Open
1 of 2 tasks

Adding MAKE_ITEM_GROUP #247

UTengine opened this issue Aug 6, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request official_feature Feature that exists in the official game that needs implementing

Comments

@UTengine
Copy link
Contributor

UTengine commented Aug 6, 2024

Search before asking

  • I searched the issues and found no similar issues.

Description

We need to make an item_group array that gets data from the database (DoFieldExchange(CFieldExchange), then tie it to
AIServer npc.cpp.
Openko has implemented this, here is a link that serves as an example.

_MAKE_ITEM_GROUP * pGroup = g_pMain->m_MakeItemGroupArray.GetData(pItem->iItem[j]);
https://github.com/srmeier/KnightOnline/blob/80268e2fa971389a3e94c430966a7943c2631dbf/Server/AIServer/Npc.cpp#L3389

Use case

Item_groups consist of around 30 columns of drops that ties it to the monster item drop's.
Currently we are missing out on a lot of drops.
image
image

Are you willing to work on and submit a PR to address the issue?

  • Yes I am willing to submit a PR!
@UTengine UTengine added the enhancement New feature or request label Aug 6, 2024
@UTengine UTengine changed the title Adding MAKE_ITEM_GROUPS Adding MAKE_ITEM_GROUP Aug 6, 2024
@stevewgr stevewgr added the official_feature Feature that exists in the official game that needs implementing label Aug 7, 2024
@xGuTeK
Copy link
Contributor

xGuTeK commented Nov 15, 2024

What do you think about improving the item_group a bit so that in this table we could also set the drop percentage for each of the 30 items? This way, we would have greater control over the drop in the item group. What do you think ?

@UTengine
Copy link
Contributor Author

I wouldn't mind but this is typical korean RNG.
If we add specific drop rates in there it will require additional work not just code but also DB wise.
But if you want to go for it it's not a bad idea tbh.

@stevewgr
Copy link
Member

@xGuTeK I like the idea, the more control, the better. However we need to think on some scenarios. What would the table layout looks like? that means now instead of 30 columns, we got 60? and what precedent? The ITEM_GROUP percent or the K_MONSTER_ITEM?

@xGuTeK
Copy link
Contributor

xGuTeK commented Nov 17, 2024

@stevewgr

The item_group table will have 61 columns:

groupindex
iItem_01 to iItem_30
sPercent_01 to sPercent_30

In the k_monster_item table, item groups are simply assigned lower IDs. For example, if the items consist of a 9-digit number, the item groups will have IDs with a maximum of 8 digits.

The sPercent will represent the length of the range for each item. Here's how it works:

If iItem_01 has sPercent_01 set to 200, the range for the first item will be from 1 to 200.
If iItem_02 has sPercent_02 set to 100, the range for the second item will be from 201 to 300.
If iItem_03 has sPercent_03 set to 111, the range for the third item will be from 301 to 411.

The server will then generate a random number within the total range and select the item based on where that number falls:

1–200 → iItem_01
201–300 → iItem_02
301–411 → iItem_03

@stevewgr
Copy link
Member

Sounds great. We can work and shape this idea further through a PR, something that we can test and try out, because I might not fully get the idea behind this due to the lack of my understanding about item drops, but the way you describe it, it sounds like something simple to implement.

I can see where this idea can really shine, is when we want within the 30 items in the item group to set one very special item to 1%, like GM trophy or something 😆

@xGuTeK
Copy link
Contributor

xGuTeK commented Nov 17, 2024

I almost finished it ;)

@xGuTeK xGuTeK self-assigned this Nov 17, 2024
xGuTeK added a commit that referenced this issue Nov 17, 2024
xGuTeK added a commit to ko4life-net/ko-db that referenced this issue Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request official_feature Feature that exists in the official game that needs implementing
Projects
None yet
Development

No branches or pull requests

3 participants