Consider drop rate by id for occurrences configuration.

This commit is contained in:
MobiusDevelopment
2022-05-16 22:48:20 +00:00
parent 75ecbcfc13
commit d8dde6787a
26 changed files with 468 additions and 52 deletions

View File

@ -862,7 +862,14 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
}
// finally
if (dropItem.getChance() < 100)
if (itemChance != null)
{
if ((dropItem.getChance() * itemChance) < 100)
{
dropOccurrenceCounter--;
}
}
else if (dropItem.getChance() < 100)
{
dropOccurrenceCounter--;
}
@ -952,7 +959,16 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
}
// finally
if (dropItem.getChance() < 100)
final Float itemChance = Config.RATE_DROP_CHANCE_BY_ID.get(dropItem.getItemId());
if (itemChance != null)
{
if ((dropItem.getChance() * itemChance) < 100)
{
dropOccurrenceCounter--;
randomDrops.add(drop);
}
}
else if (dropItem.getChance() < 100)
{
dropOccurrenceCounter--;
randomDrops.add(drop);