diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Creature.java index 66f06b61e8..5c43794850 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3828,16 +3828,23 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe if (isPlayer() && !target.isHpBlocked()) { - if (((PlayerInstance) this).isCursedWeaponEquipped()) + final PlayerInstance player = getActingPlayer(); + + if (player.isCursedWeaponEquipped()) { // If hit by a cursed weapon, CP is reduced to 0 target.setCurrentCp(0); } - else if (((PlayerInstance) this).isHero() && target.isPlayer() && target.getActingPlayer().isCursedWeaponEquipped()) + else if (player.isHero() && target.isPlayer() && target.getActingPlayer().isCursedWeaponEquipped()) { // If a cursed weapon is hit by a Hero, CP is reduced to 0 target.setCurrentCp(0); } + + if (player.isDeathKnight()) + { + player.setDeathPoints(player.getDeathPoints() + 1); + } } } diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 9ad4d6b32f..8ad6008e24 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -445,6 +445,7 @@ public class PlayerInstance extends Playable protected int _baseClass; protected int _activeClass; protected int _classIndex = 0; + private boolean _isDeathKnight = false; /** data for mounted pets */ private int _controlItemId; @@ -6568,6 +6569,10 @@ public class PlayerInstance extends Playable { player._activeClass = activeClassId; } + if ((activeClassId > 195) && (activeClassId < 208)) + { + player._isDeathKnight = true; + } player.setApprentice(rset.getInt("apprentice")); player.setSponsor(rset.getInt("sponsor")); @@ -8449,6 +8454,14 @@ public class PlayerInstance extends Playable return getClassId().isMage(); } + /** + * @return True if the PlayerInstance is a Death Knight. + */ + public boolean isDeathKnight() + { + return _isDeathKnight; + } + public boolean isMounted() { return _mountType != MountType.NONE;