From 1fd1f800997cdde5ee208c992c91875a56ce1d04 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sun, 31 Mar 2019 20:40:13 +0000 Subject: [PATCH] KnockBack and PullBack effects should ignore town NPCs. --- .../scripts/handlers/effecthandlers/KnockBack.java | 3 ++- .../data/scripts/handlers/effecthandlers/PullBack.java | 10 ++-------- .../scripts/handlers/effecthandlers/KnockBack.java | 3 ++- .../data/scripts/handlers/effecthandlers/PullBack.java | 10 ++-------- .../scripts/handlers/effecthandlers/KnockBack.java | 3 ++- .../data/scripts/handlers/effecthandlers/PullBack.java | 10 ++-------- .../scripts/handlers/effecthandlers/KnockBack.java | 3 ++- .../data/scripts/handlers/effecthandlers/PullBack.java | 10 ++-------- .../scripts/handlers/effecthandlers/KnockBack.java | 3 ++- .../data/scripts/handlers/effecthandlers/PullBack.java | 10 ++-------- .../scripts/handlers/effecthandlers/KnockBack.java | 3 ++- .../data/scripts/handlers/effecthandlers/PullBack.java | 10 ++-------- .../scripts/handlers/effecthandlers/KnockBack.java | 3 ++- .../data/scripts/handlers/effecthandlers/PullBack.java | 10 ++-------- .../scripts/handlers/effecthandlers/KnockBack.java | 3 ++- .../data/scripts/handlers/effecthandlers/PullBack.java | 10 ++-------- .../scripts/handlers/effecthandlers/KnockBack.java | 3 ++- .../data/scripts/handlers/effecthandlers/PullBack.java | 10 ++-------- .../scripts/handlers/effecthandlers/KnockBack.java | 3 ++- .../data/scripts/handlers/effecthandlers/PullBack.java | 10 ++-------- .../scripts/handlers/effecthandlers/KnockBack.java | 3 ++- .../data/scripts/handlers/effecthandlers/PullBack.java | 10 ++-------- 22 files changed, 44 insertions(+), 99 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java index 47a273439d..0db7363b7a 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java @@ -150,7 +150,8 @@ public final class KnockBack extends AbstractEffect private void knockBack(Creature effector, Creature effected) { - if ((effected == null) || effected.isRaid()) + // Prevent knocking back raids and town NPCs. + if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable())) { return; } diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PullBack.java index 8fe8a96f89..b17a7d03aa 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PullBack.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PullBack.java @@ -61,14 +61,8 @@ public final class PullBack extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item) { - // Prevent pulling raids. - if ((effected == null) || effected.isRaid()) - { - return; - } - - // Prevent pulling NPCs. - if (!effected.isPlayable() && !effected.isMonster()) + // Prevent pulling raids and town NPCs. + if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable())) { return; } diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java index 47a273439d..0db7363b7a 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java @@ -150,7 +150,8 @@ public final class KnockBack extends AbstractEffect private void knockBack(Creature effector, Creature effected) { - if ((effected == null) || effected.isRaid()) + // Prevent knocking back raids and town NPCs. + if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable())) { return; } diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PullBack.java index 8fe8a96f89..b17a7d03aa 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PullBack.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PullBack.java @@ -61,14 +61,8 @@ public final class PullBack extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item) { - // Prevent pulling raids. - if ((effected == null) || effected.isRaid()) - { - return; - } - - // Prevent pulling NPCs. - if (!effected.isPlayable() && !effected.isMonster()) + // Prevent pulling raids and town NPCs. + if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable())) { return; } diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java index 47a273439d..0db7363b7a 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java @@ -150,7 +150,8 @@ public final class KnockBack extends AbstractEffect private void knockBack(Creature effector, Creature effected) { - if ((effected == null) || effected.isRaid()) + // Prevent knocking back raids and town NPCs. + if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable())) { return; } diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PullBack.java index 8fe8a96f89..b17a7d03aa 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PullBack.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PullBack.java @@ -61,14 +61,8 @@ public final class PullBack extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item) { - // Prevent pulling raids. - if ((effected == null) || effected.isRaid()) - { - return; - } - - // Prevent pulling NPCs. - if (!effected.isPlayable() && !effected.isMonster()) + // Prevent pulling raids and town NPCs. + if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable())) { return; } diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java index 47a273439d..0db7363b7a 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java @@ -150,7 +150,8 @@ public final class KnockBack extends AbstractEffect private void knockBack(Creature effector, Creature effected) { - if ((effected == null) || effected.isRaid()) + // Prevent knocking back raids and town NPCs. + if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable())) { return; } diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PullBack.java index 8fe8a96f89..b17a7d03aa 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PullBack.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PullBack.java @@ -61,14 +61,8 @@ public final class PullBack extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item) { - // Prevent pulling raids. - if ((effected == null) || effected.isRaid()) - { - return; - } - - // Prevent pulling NPCs. - if (!effected.isPlayable() && !effected.isMonster()) + // Prevent pulling raids and town NPCs. + if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable())) { return; } diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java index 47a273439d..0db7363b7a 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java @@ -150,7 +150,8 @@ public final class KnockBack extends AbstractEffect private void knockBack(Creature effector, Creature effected) { - if ((effected == null) || effected.isRaid()) + // Prevent knocking back raids and town NPCs. + if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable())) { return; } diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/PullBack.java index 8fe8a96f89..b17a7d03aa 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/PullBack.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/PullBack.java @@ -61,14 +61,8 @@ public final class PullBack extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item) { - // Prevent pulling raids. - if ((effected == null) || effected.isRaid()) - { - return; - } - - // Prevent pulling NPCs. - if (!effected.isPlayable() && !effected.isMonster()) + // Prevent pulling raids and town NPCs. + if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable())) { return; } diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java index 47a273439d..0db7363b7a 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java @@ -150,7 +150,8 @@ public final class KnockBack extends AbstractEffect private void knockBack(Creature effector, Creature effected) { - if ((effected == null) || effected.isRaid()) + // Prevent knocking back raids and town NPCs. + if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable())) { return; } diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/PullBack.java index 8fe8a96f89..b17a7d03aa 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/PullBack.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/PullBack.java @@ -61,14 +61,8 @@ public final class PullBack extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item) { - // Prevent pulling raids. - if ((effected == null) || effected.isRaid()) - { - return; - } - - // Prevent pulling NPCs. - if (!effected.isPlayable() && !effected.isMonster()) + // Prevent pulling raids and town NPCs. + if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable())) { return; } diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java index 47a273439d..0db7363b7a 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java @@ -150,7 +150,8 @@ public final class KnockBack extends AbstractEffect private void knockBack(Creature effector, Creature effected) { - if ((effected == null) || effected.isRaid()) + // Prevent knocking back raids and town NPCs. + if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable())) { return; } diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/PullBack.java index 8fe8a96f89..b17a7d03aa 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/PullBack.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/PullBack.java @@ -61,14 +61,8 @@ public final class PullBack extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item) { - // Prevent pulling raids. - if ((effected == null) || effected.isRaid()) - { - return; - } - - // Prevent pulling NPCs. - if (!effected.isPlayable() && !effected.isMonster()) + // Prevent pulling raids and town NPCs. + if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable())) { return; } diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java index eb791a047f..179d0e7c04 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java @@ -102,7 +102,8 @@ public final class KnockBack extends AbstractEffect private void knockBack(Creature effector, Creature effected) { - if ((effected == null) || effected.isRaid()) + // Prevent knocking back raids and town NPCs. + if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable())) { return; } diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PullBack.java index 8fe8a96f89..b17a7d03aa 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PullBack.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PullBack.java @@ -61,14 +61,8 @@ public final class PullBack extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item) { - // Prevent pulling raids. - if ((effected == null) || effected.isRaid()) - { - return; - } - - // Prevent pulling NPCs. - if (!effected.isPlayable() && !effected.isMonster()) + // Prevent pulling raids and town NPCs. + if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable())) { return; } diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java index eb791a047f..179d0e7c04 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java @@ -102,7 +102,8 @@ public final class KnockBack extends AbstractEffect private void knockBack(Creature effector, Creature effected) { - if ((effected == null) || effected.isRaid()) + // Prevent knocking back raids and town NPCs. + if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable())) { return; } diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/PullBack.java index 8fe8a96f89..b17a7d03aa 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/PullBack.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/PullBack.java @@ -61,14 +61,8 @@ public final class PullBack extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item) { - // Prevent pulling raids. - if ((effected == null) || effected.isRaid()) - { - return; - } - - // Prevent pulling NPCs. - if (!effected.isPlayable() && !effected.isMonster()) + // Prevent pulling raids and town NPCs. + if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable())) { return; } diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java index eb791a047f..179d0e7c04 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java @@ -102,7 +102,8 @@ public final class KnockBack extends AbstractEffect private void knockBack(Creature effector, Creature effected) { - if ((effected == null) || effected.isRaid()) + // Prevent knocking back raids and town NPCs. + if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable())) { return; } diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/PullBack.java index 8fe8a96f89..b17a7d03aa 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/PullBack.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/PullBack.java @@ -61,14 +61,8 @@ public final class PullBack extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item) { - // Prevent pulling raids. - if ((effected == null) || effected.isRaid()) - { - return; - } - - // Prevent pulling NPCs. - if (!effected.isPlayable() && !effected.isMonster()) + // Prevent pulling raids and town NPCs. + if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable())) { return; } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java index eb791a047f..179d0e7c04 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java @@ -102,7 +102,8 @@ public final class KnockBack extends AbstractEffect private void knockBack(Creature effector, Creature effected) { - if ((effected == null) || effected.isRaid()) + // Prevent knocking back raids and town NPCs. + if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable())) { return; } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/PullBack.java index 8fe8a96f89..b17a7d03aa 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/PullBack.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/PullBack.java @@ -61,14 +61,8 @@ public final class PullBack extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item) { - // Prevent pulling raids. - if ((effected == null) || effected.isRaid()) - { - return; - } - - // Prevent pulling NPCs. - if (!effected.isPlayable() && !effected.isMonster()) + // Prevent pulling raids and town NPCs. + if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable())) { return; }