I found the problem killing a mob who has only 1 item category, like jewelry of raid bosses, being 9 levels higher than the boss and this item in the RateDropItemsById config and 1x rate instead of 7x (my default rate drop config)
(For example Baium ring and being lvl 85 (rate lowered to 27%))
Well with this config the item rate should be lowered, but no, its 100%.
I tried to learn from L2Attackable.java file, and edit the calculateCategorizedRewardItem method.
Perhaps we can change the calculate way of categoryDropChance, for each item in the category sum default rate but if one of the items is in RateDropItemsById then sum this rate and finally divide by number of items.
For example, we have item, A, B and C in the same category, and item C has 2x rate, the default rate is x10 so, categoryDropChance should be: (10 + 10 + 2) / 3 = 7.33 instead of 10.
Another way to do that is, "number of items" by "default rate"(multiplication) minus difference between default rate and RateDropItemsById only for each items in RateDropItemsById and finally divide by number of items.
So, ((3*10) - 7) / 3 = 7.33 instead of 10.
I don't know if this last way is more efficient, but I did the first one:
Code: Select all
// Applies Drop ratesint categoryDropSpecificId = 0;for(L2DropData drop : categoryDrops.getAllDrops()){ if (Config.RATE_DROP_ITEMS_ID.get(drop.getItemId()) != 0) { categoryDropSpecificId += Config.RATE_DROP_ITEMS_ID.get(drop.getItemId()); } else { categoryDropSpecificId += isRaid() && !isRaidMinion() ? Config.RATE_DROP_ITEMS_BY_RAID : Config.RATE_DROP_ITEMS; }} categoryDropSpecificId /= categoryDrops.getAllDrops().size(); // Avoid dividing by 0if (categoryDropSpecificId == 0){ categoryDropSpecificId = 1;} categoryDropChance *= categoryDropSpecificId;
Code: Select all
// Applies Drop ratescategoryDropChance *= isRaid() && !isRaidMinion() ? Config.RATE_DROP_ITEMS_BY_RAID : Config.RATE_DROP_ITEMS;
What do you think? Can this problem be solved in another way?
I'm not English native speaker, so, sorry if something is wrong.
Regards.