-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:
MobiusDev
2015-07-12 21:19:09 +00:00
parent 747334ab81
commit 12b76e722e
16 changed files with 1199 additions and 577 deletions

View File

@ -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.

View File

@ -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);
}
}

View File

@ -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;