-Implemented some Jewel Boxes.
-Added SummonDebuff effect for Golden Lion & Lumi summons (apply on summoner when summon). -Added stat hpRestoreOnKill - restoring n% hp when kill a enemy (mob or player) - example: Berserker skill. -Updated id 10000-10279 range skills. -Update TriggerForce effect for Rolling Thunder skill. Contributed by NviX.
This commit is contained in:
@ -350,6 +350,17 @@ public class L2Attackable extends L2Npc
|
||||
{
|
||||
// Delayed notification
|
||||
EventDispatcher.getInstance().notifyEventAsyncDelayed(new OnAttackableKill(killer.getActingPlayer(), this, killer.isSummon()), this, _onKillDelay);
|
||||
// if killer have stat hpRestoreOnKill
|
||||
int hpRestore = (int) killer.getStat().calcStat(Stats.HP_RESTORE_ON_KILL, 0, null, null);
|
||||
if (hpRestore > 0)
|
||||
{
|
||||
double amount = (killer.getMaxHp() * hpRestore) / 100;
|
||||
amount = Math.max(Math.min(amount, killer.getMaxRecoverableHp() - killer.getCurrentHp()), 0);
|
||||
if (amount != 0)
|
||||
{
|
||||
killer.setCurrentHp(amount + killer.getCurrentHp());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Notify to minions if there are.
|
||||
|
@ -312,6 +312,18 @@ public class PcStatus extends PlayableStatus
|
||||
return;
|
||||
}
|
||||
|
||||
if ((attacker != null) && (attacker.isPlayer()))
|
||||
{
|
||||
final int hpRestore = (int) attacker.getStat().calcStat(Stats.HP_RESTORE_ON_KILL, 0, null, null);
|
||||
if (hpRestore > 0)
|
||||
{
|
||||
final double amount = Math.max(Math.min((attacker.getMaxHp() * hpRestore) / 100, attacker.getMaxRecoverableHp() - attacker.getCurrentHp()), 0);
|
||||
if (amount != 0)
|
||||
{
|
||||
attacker.setCurrentHp(amount + attacker.getCurrentHp());
|
||||
}
|
||||
}
|
||||
}
|
||||
getActiveChar().doDie(attacker);
|
||||
}
|
||||
}
|
||||
|
@ -210,7 +210,10 @@ public enum Stats
|
||||
MAX_SUMMON_POINTS("summonPoints"),
|
||||
|
||||
// Max Skill Damage Receive
|
||||
MAX_SKILL_DAMAGE("maxSkillDamage");
|
||||
MAX_SKILL_DAMAGE("maxSkillDamage"),
|
||||
|
||||
// Hp restore on kill enemy
|
||||
HP_RESTORE_ON_KILL("hpRestoreOnKill");
|
||||
|
||||
public static final int NUM_STATS = values().length;
|
||||
|
||||
|
Reference in New Issue
Block a user