ko icon indicating copy to clipboard operation
ko copied to clipboard

Implement MAKE_ITEM_GROUP handling.

Open xGuTeK opened this issue 1 year ago • 1 comments

https://github.com/ko4life-net/ko/issues/247

Description

This PR introduces support for MAKE_ITEM_GROUP, enhancing the existing drop system. Previously, only up to 5 items could be directly assigned as drops. With this PR, you can now assign a group of up to 30 items. When the group is selected as a drop, the system will randomly choose one item from within that group. Item groups are managed in the MAKE_ITEM_GROUP table.

Instructions for Use:

Creating an Item Group:

  • Open the MAKE_ITEM_GROUP table.
  • Create a new row with a group index. Ensure the group ID is greater than 100.
  • Add the desired items to the group and set their individual drop rates.

Assigning an Item Group to a Monster:

  • Open the K_MONSTER_ITEM table.
  • Assign the group ID to the iItem01 column of the desired monster.

⚠️ ### Important: Item groups will only be recognized in the iItem01 column. This means you can assign only one item group to a monster in a drop table.

💔 Thank you!

xGuTeK avatar Nov 17 '24 10:11 xGuTeK

This part fixes the item groups, it seems like they have removed random creation of items and replaced it with itemgroups so therefore we have to consider itemdrop 1 as a group and the others too as long as they fall under the minimum digit of a possible item drop thus see it as a group this has fixed the issue.

First we do: to make sure we collect all indexes for a possible itemgroup

if (itemFieldIndex < rowIndex) {

Then we skip randomization and go straight to groups: image

image image image image image image image

ps: GJ Gutek works as intended with few adjustments, this is my review. if you want to improve it further you can check if the itemgroup exists if not then produce random item but that's upto you.

UTengine avatar Apr 12 '25 12:04 UTengine