diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java index 0ddf1aed23..9d55b10b4d 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java @@ -19,7 +19,6 @@ package handlers.skillconditionhandlers; import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance; import com.l2jmobius.gameserver.model.skills.ISkillCondition; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -36,10 +35,10 @@ public class ConsumeBodySkillCondition implements ISkillCondition @Override public boolean canUse(L2Character caster, Skill skill, L2Object target) { - if ((target != null) && target.isMonster()) + if ((target != null) && (target.isMonster() || target.isSummon())) { - final L2MonsterInstance monster = (L2MonsterInstance) target; - if (monster.isDead() && monster.isSpawned()) + final L2Character character = (L2Character) target; + if (character.isDead() && character.isSpawned()) { return true; } diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/targethandlers/NpcBody.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/targethandlers/NpcBody.java index 29b0f91e06..3e83507b2d 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/targethandlers/NpcBody.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/targethandlers/NpcBody.java @@ -20,7 +20,6 @@ import com.l2jmobius.gameserver.geoengine.GeoEngine; import com.l2jmobius.gameserver.handler.ITargetTypeHandler; import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.model.skills.targets.TargetType; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -51,46 +50,41 @@ public class NpcBody implements ITargetTypeHandler return null; } - if (!selectedTarget.isNpc()) + if (!selectedTarget.isNpc() && !selectedTarget.isSummon()) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.INVALID_TARGET); } - return null; } - final L2Npc npc = (L2Npc) selectedTarget; - - if (npc.isDead()) + final L2Character cha = (L2Character) selectedTarget; + if (cha.isDead()) { // Check for cast range if character cannot move. TODO: char will start follow until within castrange, but if his moving is blocked by geodata, this msg will be sent. if (dontMove) { - if (activeChar.calculateDistance2D(npc) > skill.getCastRange()) + if (activeChar.calculateDistance2D(cha) > skill.getCastRange()) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.THE_DISTANCE_IS_TOO_FAR_AND_SO_THE_CASTING_HAS_BEEN_STOPPED); } - return null; } } // Geodata check when character is within range. - if (!GeoEngine.getInstance().canSeeTarget(activeChar, npc)) + if (!GeoEngine.getInstance().canSeeTarget(activeChar, cha)) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.CANNOT_SEE_TARGET); } - return null; } - - return npc; + return cha; } // If target is not dead or not player/pet it will not even bother to walk within range, unlike Enemy target type. @@ -98,7 +92,6 @@ public class NpcBody implements ITargetTypeHandler { activeChar.sendPacket(SystemMessageId.INVALID_TARGET); } - return null; } } diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java index 0ddf1aed23..9d55b10b4d 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java @@ -19,7 +19,6 @@ package handlers.skillconditionhandlers; import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance; import com.l2jmobius.gameserver.model.skills.ISkillCondition; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -36,10 +35,10 @@ public class ConsumeBodySkillCondition implements ISkillCondition @Override public boolean canUse(L2Character caster, Skill skill, L2Object target) { - if ((target != null) && target.isMonster()) + if ((target != null) && (target.isMonster() || target.isSummon())) { - final L2MonsterInstance monster = (L2MonsterInstance) target; - if (monster.isDead() && monster.isSpawned()) + final L2Character character = (L2Character) target; + if (character.isDead() && character.isSpawned()) { return true; } diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/targethandlers/NpcBody.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/targethandlers/NpcBody.java index 29b0f91e06..3e83507b2d 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/targethandlers/NpcBody.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/targethandlers/NpcBody.java @@ -20,7 +20,6 @@ import com.l2jmobius.gameserver.geoengine.GeoEngine; import com.l2jmobius.gameserver.handler.ITargetTypeHandler; import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.model.skills.targets.TargetType; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -51,46 +50,41 @@ public class NpcBody implements ITargetTypeHandler return null; } - if (!selectedTarget.isNpc()) + if (!selectedTarget.isNpc() && !selectedTarget.isSummon()) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.INVALID_TARGET); } - return null; } - final L2Npc npc = (L2Npc) selectedTarget; - - if (npc.isDead()) + final L2Character cha = (L2Character) selectedTarget; + if (cha.isDead()) { // Check for cast range if character cannot move. TODO: char will start follow until within castrange, but if his moving is blocked by geodata, this msg will be sent. if (dontMove) { - if (activeChar.calculateDistance2D(npc) > skill.getCastRange()) + if (activeChar.calculateDistance2D(cha) > skill.getCastRange()) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.THE_DISTANCE_IS_TOO_FAR_AND_SO_THE_CASTING_HAS_BEEN_STOPPED); } - return null; } } // Geodata check when character is within range. - if (!GeoEngine.getInstance().canSeeTarget(activeChar, npc)) + if (!GeoEngine.getInstance().canSeeTarget(activeChar, cha)) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.CANNOT_SEE_TARGET); } - return null; } - - return npc; + return cha; } // If target is not dead or not player/pet it will not even bother to walk within range, unlike Enemy target type. @@ -98,7 +92,6 @@ public class NpcBody implements ITargetTypeHandler { activeChar.sendPacket(SystemMessageId.INVALID_TARGET); } - return null; } } diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java index 0ddf1aed23..9d55b10b4d 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java @@ -19,7 +19,6 @@ package handlers.skillconditionhandlers; import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance; import com.l2jmobius.gameserver.model.skills.ISkillCondition; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -36,10 +35,10 @@ public class ConsumeBodySkillCondition implements ISkillCondition @Override public boolean canUse(L2Character caster, Skill skill, L2Object target) { - if ((target != null) && target.isMonster()) + if ((target != null) && (target.isMonster() || target.isSummon())) { - final L2MonsterInstance monster = (L2MonsterInstance) target; - if (monster.isDead() && monster.isSpawned()) + final L2Character character = (L2Character) target; + if (character.isDead() && character.isSpawned()) { return true; } diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/targethandlers/NpcBody.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/targethandlers/NpcBody.java index 29b0f91e06..3e83507b2d 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/targethandlers/NpcBody.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/targethandlers/NpcBody.java @@ -20,7 +20,6 @@ import com.l2jmobius.gameserver.geoengine.GeoEngine; import com.l2jmobius.gameserver.handler.ITargetTypeHandler; import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.model.skills.targets.TargetType; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -51,46 +50,41 @@ public class NpcBody implements ITargetTypeHandler return null; } - if (!selectedTarget.isNpc()) + if (!selectedTarget.isNpc() && !selectedTarget.isSummon()) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.INVALID_TARGET); } - return null; } - final L2Npc npc = (L2Npc) selectedTarget; - - if (npc.isDead()) + final L2Character cha = (L2Character) selectedTarget; + if (cha.isDead()) { // Check for cast range if character cannot move. TODO: char will start follow until within castrange, but if his moving is blocked by geodata, this msg will be sent. if (dontMove) { - if (activeChar.calculateDistance2D(npc) > skill.getCastRange()) + if (activeChar.calculateDistance2D(cha) > skill.getCastRange()) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.THE_DISTANCE_IS_TOO_FAR_AND_SO_THE_CASTING_HAS_BEEN_STOPPED); } - return null; } } // Geodata check when character is within range. - if (!GeoEngine.getInstance().canSeeTarget(activeChar, npc)) + if (!GeoEngine.getInstance().canSeeTarget(activeChar, cha)) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.CANNOT_SEE_TARGET); } - return null; } - - return npc; + return cha; } // If target is not dead or not player/pet it will not even bother to walk within range, unlike Enemy target type. @@ -98,7 +92,6 @@ public class NpcBody implements ITargetTypeHandler { activeChar.sendPacket(SystemMessageId.INVALID_TARGET); } - return null; } } diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java index 0ddf1aed23..9d55b10b4d 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java @@ -19,7 +19,6 @@ package handlers.skillconditionhandlers; import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance; import com.l2jmobius.gameserver.model.skills.ISkillCondition; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -36,10 +35,10 @@ public class ConsumeBodySkillCondition implements ISkillCondition @Override public boolean canUse(L2Character caster, Skill skill, L2Object target) { - if ((target != null) && target.isMonster()) + if ((target != null) && (target.isMonster() || target.isSummon())) { - final L2MonsterInstance monster = (L2MonsterInstance) target; - if (monster.isDead() && monster.isSpawned()) + final L2Character character = (L2Character) target; + if (character.isDead() && character.isSpawned()) { return true; } diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/targethandlers/NpcBody.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/targethandlers/NpcBody.java index 29b0f91e06..3e83507b2d 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/targethandlers/NpcBody.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/targethandlers/NpcBody.java @@ -20,7 +20,6 @@ import com.l2jmobius.gameserver.geoengine.GeoEngine; import com.l2jmobius.gameserver.handler.ITargetTypeHandler; import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.model.skills.targets.TargetType; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -51,46 +50,41 @@ public class NpcBody implements ITargetTypeHandler return null; } - if (!selectedTarget.isNpc()) + if (!selectedTarget.isNpc() && !selectedTarget.isSummon()) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.INVALID_TARGET); } - return null; } - final L2Npc npc = (L2Npc) selectedTarget; - - if (npc.isDead()) + final L2Character cha = (L2Character) selectedTarget; + if (cha.isDead()) { // Check for cast range if character cannot move. TODO: char will start follow until within castrange, but if his moving is blocked by geodata, this msg will be sent. if (dontMove) { - if (activeChar.calculateDistance2D(npc) > skill.getCastRange()) + if (activeChar.calculateDistance2D(cha) > skill.getCastRange()) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.THE_DISTANCE_IS_TOO_FAR_AND_SO_THE_CASTING_HAS_BEEN_STOPPED); } - return null; } } // Geodata check when character is within range. - if (!GeoEngine.getInstance().canSeeTarget(activeChar, npc)) + if (!GeoEngine.getInstance().canSeeTarget(activeChar, cha)) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.CANNOT_SEE_TARGET); } - return null; } - - return npc; + return cha; } // If target is not dead or not player/pet it will not even bother to walk within range, unlike Enemy target type. @@ -98,7 +92,6 @@ public class NpcBody implements ITargetTypeHandler { activeChar.sendPacket(SystemMessageId.INVALID_TARGET); } - return null; } } diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java index 0ddf1aed23..9d55b10b4d 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java @@ -19,7 +19,6 @@ package handlers.skillconditionhandlers; import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance; import com.l2jmobius.gameserver.model.skills.ISkillCondition; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -36,10 +35,10 @@ public class ConsumeBodySkillCondition implements ISkillCondition @Override public boolean canUse(L2Character caster, Skill skill, L2Object target) { - if ((target != null) && target.isMonster()) + if ((target != null) && (target.isMonster() || target.isSummon())) { - final L2MonsterInstance monster = (L2MonsterInstance) target; - if (monster.isDead() && monster.isSpawned()) + final L2Character character = (L2Character) target; + if (character.isDead() && character.isSpawned()) { return true; } diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/targethandlers/NpcBody.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/targethandlers/NpcBody.java index 29b0f91e06..3e83507b2d 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/targethandlers/NpcBody.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/targethandlers/NpcBody.java @@ -20,7 +20,6 @@ import com.l2jmobius.gameserver.geoengine.GeoEngine; import com.l2jmobius.gameserver.handler.ITargetTypeHandler; import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.model.skills.targets.TargetType; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -51,46 +50,41 @@ public class NpcBody implements ITargetTypeHandler return null; } - if (!selectedTarget.isNpc()) + if (!selectedTarget.isNpc() && !selectedTarget.isSummon()) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.INVALID_TARGET); } - return null; } - final L2Npc npc = (L2Npc) selectedTarget; - - if (npc.isDead()) + final L2Character cha = (L2Character) selectedTarget; + if (cha.isDead()) { // Check for cast range if character cannot move. TODO: char will start follow until within castrange, but if his moving is blocked by geodata, this msg will be sent. if (dontMove) { - if (activeChar.calculateDistance2D(npc) > skill.getCastRange()) + if (activeChar.calculateDistance2D(cha) > skill.getCastRange()) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.THE_DISTANCE_IS_TOO_FAR_AND_SO_THE_CASTING_HAS_BEEN_STOPPED); } - return null; } } // Geodata check when character is within range. - if (!GeoEngine.getInstance().canSeeTarget(activeChar, npc)) + if (!GeoEngine.getInstance().canSeeTarget(activeChar, cha)) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.CANNOT_SEE_TARGET); } - return null; } - - return npc; + return cha; } // If target is not dead or not player/pet it will not even bother to walk within range, unlike Enemy target type. @@ -98,7 +92,6 @@ public class NpcBody implements ITargetTypeHandler { activeChar.sendPacket(SystemMessageId.INVALID_TARGET); } - return null; } } diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java index 0ddf1aed23..9d55b10b4d 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java @@ -19,7 +19,6 @@ package handlers.skillconditionhandlers; import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance; import com.l2jmobius.gameserver.model.skills.ISkillCondition; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -36,10 +35,10 @@ public class ConsumeBodySkillCondition implements ISkillCondition @Override public boolean canUse(L2Character caster, Skill skill, L2Object target) { - if ((target != null) && target.isMonster()) + if ((target != null) && (target.isMonster() || target.isSummon())) { - final L2MonsterInstance monster = (L2MonsterInstance) target; - if (monster.isDead() && monster.isSpawned()) + final L2Character character = (L2Character) target; + if (character.isDead() && character.isSpawned()) { return true; } diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/targethandlers/NpcBody.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/targethandlers/NpcBody.java index 29b0f91e06..3e83507b2d 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/targethandlers/NpcBody.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/targethandlers/NpcBody.java @@ -20,7 +20,6 @@ import com.l2jmobius.gameserver.geoengine.GeoEngine; import com.l2jmobius.gameserver.handler.ITargetTypeHandler; import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.model.skills.targets.TargetType; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -51,46 +50,41 @@ public class NpcBody implements ITargetTypeHandler return null; } - if (!selectedTarget.isNpc()) + if (!selectedTarget.isNpc() && !selectedTarget.isSummon()) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.INVALID_TARGET); } - return null; } - final L2Npc npc = (L2Npc) selectedTarget; - - if (npc.isDead()) + final L2Character cha = (L2Character) selectedTarget; + if (cha.isDead()) { // Check for cast range if character cannot move. TODO: char will start follow until within castrange, but if his moving is blocked by geodata, this msg will be sent. if (dontMove) { - if (activeChar.calculateDistance2D(npc) > skill.getCastRange()) + if (activeChar.calculateDistance2D(cha) > skill.getCastRange()) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.THE_DISTANCE_IS_TOO_FAR_AND_SO_THE_CASTING_HAS_BEEN_STOPPED); } - return null; } } // Geodata check when character is within range. - if (!GeoEngine.getInstance().canSeeTarget(activeChar, npc)) + if (!GeoEngine.getInstance().canSeeTarget(activeChar, cha)) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.CANNOT_SEE_TARGET); } - return null; } - - return npc; + return cha; } // If target is not dead or not player/pet it will not even bother to walk within range, unlike Enemy target type. @@ -98,7 +92,6 @@ public class NpcBody implements ITargetTypeHandler { activeChar.sendPacket(SystemMessageId.INVALID_TARGET); } - return null; } } diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java index 0ddf1aed23..9d55b10b4d 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java @@ -19,7 +19,6 @@ package handlers.skillconditionhandlers; import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance; import com.l2jmobius.gameserver.model.skills.ISkillCondition; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -36,10 +35,10 @@ public class ConsumeBodySkillCondition implements ISkillCondition @Override public boolean canUse(L2Character caster, Skill skill, L2Object target) { - if ((target != null) && target.isMonster()) + if ((target != null) && (target.isMonster() || target.isSummon())) { - final L2MonsterInstance monster = (L2MonsterInstance) target; - if (monster.isDead() && monster.isSpawned()) + final L2Character character = (L2Character) target; + if (character.isDead() && character.isSpawned()) { return true; } diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/targethandlers/NpcBody.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/targethandlers/NpcBody.java index 165bd6e05e..df03a3453c 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/targethandlers/NpcBody.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/targethandlers/NpcBody.java @@ -20,7 +20,6 @@ import com.l2jmobius.gameserver.geoengine.GeoEngine; import com.l2jmobius.gameserver.handler.ITargetTypeHandler; import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.model.skills.targets.TargetType; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -51,46 +50,41 @@ public class NpcBody implements ITargetTypeHandler return null; } - if (!selectedTarget.isNpc()) + if (!selectedTarget.isNpc() && !selectedTarget.isSummon()) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.INVALID_TARGET); } - return null; } - final L2Npc npc = (L2Npc) selectedTarget; - - if (npc.isDead()) + final L2Character cha = (L2Character) selectedTarget; + if (cha.isDead()) { // Check for cast range if character cannot move. TODO: char will start follow until within castrange, but if his moving is blocked by geodata, this msg will be sent. if (dontMove) { - if (activeChar.calculateDistance2D(npc) > skill.getCastRange()) + if (activeChar.calculateDistance2D(cha) > skill.getCastRange()) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.THE_DISTANCE_IS_TOO_FAR_AND_SO_THE_CASTING_HAS_BEEN_CANCELLED); } - return null; } } // Geodata check when character is within range. - if (!GeoEngine.getInstance().canSeeTarget(activeChar, npc)) + if (!GeoEngine.getInstance().canSeeTarget(activeChar, cha)) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.CANNOT_SEE_TARGET); } - return null; } - - return npc; + return cha; } // If target is not dead or not player/pet it will not even bother to walk within range, unlike Enemy target type. @@ -98,7 +92,6 @@ public class NpcBody implements ITargetTypeHandler { activeChar.sendPacket(SystemMessageId.INVALID_TARGET); } - return null; } } diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java index 0ddf1aed23..9d55b10b4d 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java @@ -19,7 +19,6 @@ package handlers.skillconditionhandlers; import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance; import com.l2jmobius.gameserver.model.skills.ISkillCondition; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -36,10 +35,10 @@ public class ConsumeBodySkillCondition implements ISkillCondition @Override public boolean canUse(L2Character caster, Skill skill, L2Object target) { - if ((target != null) && target.isMonster()) + if ((target != null) && (target.isMonster() || target.isSummon())) { - final L2MonsterInstance monster = (L2MonsterInstance) target; - if (monster.isDead() && monster.isSpawned()) + final L2Character character = (L2Character) target; + if (character.isDead() && character.isSpawned()) { return true; } diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/targethandlers/NpcBody.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/targethandlers/NpcBody.java index 165bd6e05e..df03a3453c 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/targethandlers/NpcBody.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/targethandlers/NpcBody.java @@ -20,7 +20,6 @@ import com.l2jmobius.gameserver.geoengine.GeoEngine; import com.l2jmobius.gameserver.handler.ITargetTypeHandler; import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.model.skills.targets.TargetType; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -51,46 +50,41 @@ public class NpcBody implements ITargetTypeHandler return null; } - if (!selectedTarget.isNpc()) + if (!selectedTarget.isNpc() && !selectedTarget.isSummon()) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.INVALID_TARGET); } - return null; } - final L2Npc npc = (L2Npc) selectedTarget; - - if (npc.isDead()) + final L2Character cha = (L2Character) selectedTarget; + if (cha.isDead()) { // Check for cast range if character cannot move. TODO: char will start follow until within castrange, but if his moving is blocked by geodata, this msg will be sent. if (dontMove) { - if (activeChar.calculateDistance2D(npc) > skill.getCastRange()) + if (activeChar.calculateDistance2D(cha) > skill.getCastRange()) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.THE_DISTANCE_IS_TOO_FAR_AND_SO_THE_CASTING_HAS_BEEN_CANCELLED); } - return null; } } // Geodata check when character is within range. - if (!GeoEngine.getInstance().canSeeTarget(activeChar, npc)) + if (!GeoEngine.getInstance().canSeeTarget(activeChar, cha)) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.CANNOT_SEE_TARGET); } - return null; } - - return npc; + return cha; } // If target is not dead or not player/pet it will not even bother to walk within range, unlike Enemy target type. @@ -98,7 +92,6 @@ public class NpcBody implements ITargetTypeHandler { activeChar.sendPacket(SystemMessageId.INVALID_TARGET); } - return null; } } diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java index 0ddf1aed23..9d55b10b4d 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java @@ -19,7 +19,6 @@ package handlers.skillconditionhandlers; import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance; import com.l2jmobius.gameserver.model.skills.ISkillCondition; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -36,10 +35,10 @@ public class ConsumeBodySkillCondition implements ISkillCondition @Override public boolean canUse(L2Character caster, Skill skill, L2Object target) { - if ((target != null) && target.isMonster()) + if ((target != null) && (target.isMonster() || target.isSummon())) { - final L2MonsterInstance monster = (L2MonsterInstance) target; - if (monster.isDead() && monster.isSpawned()) + final L2Character character = (L2Character) target; + if (character.isDead() && character.isSpawned()) { return true; } diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/targethandlers/NpcBody.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/targethandlers/NpcBody.java index 165bd6e05e..df03a3453c 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/targethandlers/NpcBody.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/targethandlers/NpcBody.java @@ -20,7 +20,6 @@ import com.l2jmobius.gameserver.geoengine.GeoEngine; import com.l2jmobius.gameserver.handler.ITargetTypeHandler; import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.model.skills.targets.TargetType; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -51,46 +50,41 @@ public class NpcBody implements ITargetTypeHandler return null; } - if (!selectedTarget.isNpc()) + if (!selectedTarget.isNpc() && !selectedTarget.isSummon()) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.INVALID_TARGET); } - return null; } - final L2Npc npc = (L2Npc) selectedTarget; - - if (npc.isDead()) + final L2Character cha = (L2Character) selectedTarget; + if (cha.isDead()) { // Check for cast range if character cannot move. TODO: char will start follow until within castrange, but if his moving is blocked by geodata, this msg will be sent. if (dontMove) { - if (activeChar.calculateDistance2D(npc) > skill.getCastRange()) + if (activeChar.calculateDistance2D(cha) > skill.getCastRange()) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.THE_DISTANCE_IS_TOO_FAR_AND_SO_THE_CASTING_HAS_BEEN_CANCELLED); } - return null; } } // Geodata check when character is within range. - if (!GeoEngine.getInstance().canSeeTarget(activeChar, npc)) + if (!GeoEngine.getInstance().canSeeTarget(activeChar, cha)) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.CANNOT_SEE_TARGET); } - return null; } - - return npc; + return cha; } // If target is not dead or not player/pet it will not even bother to walk within range, unlike Enemy target type. @@ -98,7 +92,6 @@ public class NpcBody implements ITargetTypeHandler { activeChar.sendPacket(SystemMessageId.INVALID_TARGET); } - return null; } } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java index 0ddf1aed23..9d55b10b4d 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/skillconditionhandlers/ConsumeBodySkillCondition.java @@ -19,7 +19,6 @@ package handlers.skillconditionhandlers; import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance; import com.l2jmobius.gameserver.model.skills.ISkillCondition; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -36,10 +35,10 @@ public class ConsumeBodySkillCondition implements ISkillCondition @Override public boolean canUse(L2Character caster, Skill skill, L2Object target) { - if ((target != null) && target.isMonster()) + if ((target != null) && (target.isMonster() || target.isSummon())) { - final L2MonsterInstance monster = (L2MonsterInstance) target; - if (monster.isDead() && monster.isSpawned()) + final L2Character character = (L2Character) target; + if (character.isDead() && character.isSpawned()) { return true; } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/targethandlers/NpcBody.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/targethandlers/NpcBody.java index 165bd6e05e..df03a3453c 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/targethandlers/NpcBody.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/targethandlers/NpcBody.java @@ -20,7 +20,6 @@ import com.l2jmobius.gameserver.geoengine.GeoEngine; import com.l2jmobius.gameserver.handler.ITargetTypeHandler; import com.l2jmobius.gameserver.model.L2Object; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.model.skills.targets.TargetType; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -51,46 +50,41 @@ public class NpcBody implements ITargetTypeHandler return null; } - if (!selectedTarget.isNpc()) + if (!selectedTarget.isNpc() && !selectedTarget.isSummon()) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.INVALID_TARGET); } - return null; } - final L2Npc npc = (L2Npc) selectedTarget; - - if (npc.isDead()) + final L2Character cha = (L2Character) selectedTarget; + if (cha.isDead()) { // Check for cast range if character cannot move. TODO: char will start follow until within castrange, but if his moving is blocked by geodata, this msg will be sent. if (dontMove) { - if (activeChar.calculateDistance2D(npc) > skill.getCastRange()) + if (activeChar.calculateDistance2D(cha) > skill.getCastRange()) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.THE_DISTANCE_IS_TOO_FAR_AND_SO_THE_CASTING_HAS_BEEN_CANCELLED); } - return null; } } // Geodata check when character is within range. - if (!GeoEngine.getInstance().canSeeTarget(activeChar, npc)) + if (!GeoEngine.getInstance().canSeeTarget(activeChar, cha)) { if (sendMessage) { activeChar.sendPacket(SystemMessageId.CANNOT_SEE_TARGET); } - return null; } - - return npc; + return cha; } // If target is not dead or not player/pet it will not even bother to walk within range, unlike Enemy target type. @@ -98,7 +92,6 @@ public class NpcBody implements ITargetTypeHandler { activeChar.sendPacket(SystemMessageId.INVALID_TARGET); } - return null; } }