Addition of BonusDropRate effect handler.

This commit is contained in:
MobiusDev
2017-10-15 13:00:44 +00:00
parent 3f9a652812
commit 0eeac80585
28 changed files with 232 additions and 0 deletions

View File

@@ -43,6 +43,7 @@ import com.l2jmobius.gameserver.model.interfaces.IIdentifiable;
import com.l2jmobius.gameserver.model.itemcontainer.Inventory;
import com.l2jmobius.gameserver.model.items.L2Item;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.model.stats.Stats;
import com.l2jmobius.gameserver.util.Util;
/**
@@ -714,6 +715,13 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable
}
}
// bonus drop rate effect
final double dropRateEffectBonus = killer.getStat().getValue(Stats.BONUS_DROP_RATE, 0);
if (dropRateEffectBonus > 0)
{
rateChance *= dropRateEffectBonus;
}
// calculate if item will drop
if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance))
{

View File

@@ -130,6 +130,7 @@ public enum Stats
EXPSP_RATE("rExp"),
BONUS_EXP("bonusExp"),
BONUS_SP("bonusSp"),
BONUS_DROP_RATE("bonusDropRate"),
ATTACK_CANCEL("cancel"),
// ACCURACY & RANGE