L2JMobius

Interlude Problem with drops and mob clans

Keikei · 1 · 1943

Offline Keikei

  • Vassal
  • *
    • Posts: 6
Hello,

With the default configuration in CT0 Interlude the drop and spoil system is broken (because I believe the new group system that was implemented, simulating l2off).
The problem is related to the herbs groups and more precisely with the following code:
NpcTemplate#calculateGroupDrops
Code: [Select]
if ((rateChance == 1) && !randomDrops.isEmpty()) // custom rates break this logic because total chance is more than 100%
{
// remove highest chance item (temporarily if no other item replaces it)
cachedItem = randomDrops.remove(0);
calculatedDrops.remove(cachedItem);
}

Dont know this system was implemented using cached items but it seems the cause of the problem.

Changing the code to the following fixes the problem (removed some features that are not related to the problem):

Code: [Select]
private List<ItemHolder> calculateGroupDrops(Creature victim, Creature killer)
{
final List<ItemHolder> calculatedDrops = new ArrayList<>();

for (DropGroupHolder group : _dropGroups)
{
double totalChance = 0;
for (DropHolder dropItem : group.getDropList())
{
totalChance += dropItem.getChance();
final double groupItemChance = totalChance * (group.getChance() / 100) * 1;
final ItemHolder drop = calculateGroupDrop(group, dropItem, victim, killer, groupItemChance);
if (drop != null)
{
calculatedDrops.add(drop);
}
}
}

return calculatedDrops;
}


I have detected as well that mobs in the elven starting area have the same clan behaviour, when you attack any mob, even the npcs attacks you.