From abcad46e5e9cf89b4b4fa7de07a0fb73c1cdbdc0 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Fri, 16 Apr 2021 18:10:12 +0000 Subject: [PATCH] Prevent players from flagging in PvP zones. Contributed by Iris. --- .../java/org/l2jmobius/gameserver/model/actor/Creature.java | 2 +- .../java/org/l2jmobius/gameserver/model/actor/Creature.java | 2 +- .../java/org/l2jmobius/gameserver/model/actor/Creature.java | 2 +- .../java/org/l2jmobius/gameserver/model/actor/Creature.java | 2 +- .../java/org/l2jmobius/gameserver/model/actor/Creature.java | 2 +- .../java/org/l2jmobius/gameserver/model/actor/Creature.java | 2 +- .../java/org/l2jmobius/gameserver/model/actor/Creature.java | 2 +- .../java/org/l2jmobius/gameserver/model/actor/Creature.java | 2 +- .../java/org/l2jmobius/gameserver/model/actor/Creature.java | 2 +- .../java/org/l2jmobius/gameserver/model/actor/Creature.java | 2 +- .../java/org/l2jmobius/gameserver/model/actor/Creature.java | 2 +- .../java/org/l2jmobius/gameserver/model/actor/Creature.java | 2 +- .../java/org/l2jmobius/gameserver/model/actor/Creature.java | 2 +- .../java/org/l2jmobius/gameserver/model/actor/Creature.java | 2 +- .../java/org/l2jmobius/gameserver/model/actor/Creature.java | 2 +- .../java/org/l2jmobius/gameserver/model/actor/Creature.java | 2 +- .../java/org/l2jmobius/gameserver/model/actor/Creature.java | 2 +- .../java/org/l2jmobius/gameserver/model/actor/Creature.java | 2 +- .../java/org/l2jmobius/gameserver/model/actor/Creature.java | 2 +- .../java/org/l2jmobius/gameserver/model/actor/Creature.java | 2 +- .../java/org/l2jmobius/gameserver/model/actor/Creature.java | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java index cc53a96f98..54d703eb8a 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1211,7 +1211,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Flag the attacker if it's a PlayerInstance outside a PvP area final PlayerInstance player = getActingPlayer(); - if (player != null) + if ((player != null) && !player.isInsideZone(ZoneId.PVP) && (player != target)) // Prevent players from flagging in PvP Zones. { AttackStanceTaskManager.getInstance().addAttackStanceTask(player); player.updatePvPStatus(target); diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java index cc53a96f98..54d703eb8a 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1211,7 +1211,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Flag the attacker if it's a PlayerInstance outside a PvP area final PlayerInstance player = getActingPlayer(); - if (player != null) + if ((player != null) && !player.isInsideZone(ZoneId.PVP) && (player != target)) // Prevent players from flagging in PvP Zones. { AttackStanceTaskManager.getInstance().addAttackStanceTask(player); player.updatePvPStatus(target); diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java index b98849a0f5..1a78804e2e 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1211,7 +1211,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Flag the attacker if it's a PlayerInstance outside a PvP area final PlayerInstance player = getActingPlayer(); - if (player != null) + if ((player != null) && !player.isInsideZone(ZoneId.PVP) && (player != target)) // Prevent players from flagging in PvP Zones. { AttackStanceTaskManager.getInstance().addAttackStanceTask(player); player.updatePvPStatus(target); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java index b98849a0f5..1a78804e2e 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1211,7 +1211,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Flag the attacker if it's a PlayerInstance outside a PvP area final PlayerInstance player = getActingPlayer(); - if (player != null) + if ((player != null) && !player.isInsideZone(ZoneId.PVP) && (player != target)) // Prevent players from flagging in PvP Zones. { AttackStanceTaskManager.getInstance().addAttackStanceTask(player); player.updatePvPStatus(target); diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java index 83a014aa99..2dbaab6310 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1211,7 +1211,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Flag the attacker if it's a PlayerInstance outside a PvP area final PlayerInstance player = getActingPlayer(); - if (player != null) + if ((player != null) && !player.isInsideZone(ZoneId.PVP) && (player != target)) // Prevent players from flagging in PvP Zones. { AttackStanceTaskManager.getInstance().addAttackStanceTask(player); player.updatePvPStatus(target); diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java index 83a014aa99..2dbaab6310 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1211,7 +1211,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Flag the attacker if it's a PlayerInstance outside a PvP area final PlayerInstance player = getActingPlayer(); - if (player != null) + if ((player != null) && !player.isInsideZone(ZoneId.PVP) && (player != target)) // Prevent players from flagging in PvP Zones. { AttackStanceTaskManager.getInstance().addAttackStanceTask(player); player.updatePvPStatus(target); diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java index 83a014aa99..2dbaab6310 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1211,7 +1211,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Flag the attacker if it's a PlayerInstance outside a PvP area final PlayerInstance player = getActingPlayer(); - if (player != null) + if ((player != null) && !player.isInsideZone(ZoneId.PVP) && (player != target)) // Prevent players from flagging in PvP Zones. { AttackStanceTaskManager.getInstance().addAttackStanceTask(player); player.updatePvPStatus(target); diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java index 4ecb85e742..6190609b48 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1211,7 +1211,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Flag the attacker if it's a PlayerInstance outside a PvP area final PlayerInstance player = getActingPlayer(); - if (player != null) + if ((player != null) && !player.isInsideZone(ZoneId.PVP) && (player != target)) // Prevent players from flagging in PvP Zones. { AttackStanceTaskManager.getInstance().addAttackStanceTask(player); player.updatePvPStatus(target); diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Creature.java index 0128305549..0162abfcad 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1211,7 +1211,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Flag the attacker if it's a PlayerInstance outside a PvP area final PlayerInstance player = getActingPlayer(); - if (player != null) + if ((player != null) && !player.isInsideZone(ZoneId.PVP) && (player != target)) // Prevent players from flagging in PvP Zones. { AttackStanceTaskManager.getInstance().addAttackStanceTask(player); player.updatePvPStatus(target); diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Creature.java index 0128305549..0162abfcad 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1211,7 +1211,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Flag the attacker if it's a PlayerInstance outside a PvP area final PlayerInstance player = getActingPlayer(); - if (player != null) + if ((player != null) && !player.isInsideZone(ZoneId.PVP) && (player != target)) // Prevent players from flagging in PvP Zones. { AttackStanceTaskManager.getInstance().addAttackStanceTask(player); player.updatePvPStatus(target); diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Creature.java index c6f5823ac2..1b91c71221 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1098,7 +1098,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Flag the attacker if it's a PlayerInstance outside a PvP area final PlayerInstance player = getActingPlayer(); - if (player != null) + if ((player != null) && !player.isInsideZone(ZoneId.PVP) && (player != target)) // Prevent players from flagging in PvP Zones. { AttackStanceTaskManager.getInstance().addAttackStanceTask(player); if (player.getSummon() != target) diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Creature.java index 18c61328b9..aa0809e2d4 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1099,7 +1099,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Flag the attacker if it's a PlayerInstance outside a PvP area final PlayerInstance player = getActingPlayer(); - if (player != null) + if ((player != null) && !player.isInsideZone(ZoneId.PVP) && (player != target)) // Prevent players from flagging in PvP Zones. { AttackStanceTaskManager.getInstance().addAttackStanceTask(player); if (player.getSummon() != target) diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java index af78245ab3..27c45ec518 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1211,7 +1211,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Flag the attacker if it's a PlayerInstance outside a PvP area final PlayerInstance player = getActingPlayer(); - if (player != null) + if ((player != null) && !player.isInsideZone(ZoneId.PVP) && (player != target)) // Prevent players from flagging in PvP Zones. { AttackStanceTaskManager.getInstance().addAttackStanceTask(player); player.updatePvPStatus(target); diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java index af78245ab3..27c45ec518 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1211,7 +1211,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Flag the attacker if it's a PlayerInstance outside a PvP area final PlayerInstance player = getActingPlayer(); - if (player != null) + if ((player != null) && !player.isInsideZone(ZoneId.PVP) && (player != target)) // Prevent players from flagging in PvP Zones. { AttackStanceTaskManager.getInstance().addAttackStanceTask(player); player.updatePvPStatus(target); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java index dea38922d3..c42ecba96d 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1211,7 +1211,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Flag the attacker if it's a PlayerInstance outside a PvP area final PlayerInstance player = getActingPlayer(); - if (player != null) + if ((player != null) && !player.isInsideZone(ZoneId.PVP) && (player != target)) // Prevent players from flagging in PvP Zones. { AttackStanceTaskManager.getInstance().addAttackStanceTask(player); player.updatePvPStatus(target); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java index 17c5758bf8..cac9f1c084 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1212,7 +1212,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Flag the attacker if it's a PlayerInstance outside a PvP area final PlayerInstance player = getActingPlayer(); - if (player != null) + if ((player != null) && !player.isInsideZone(ZoneId.PVP) && (player != target)) // Prevent players from flagging in PvP Zones. { AttackStanceTaskManager.getInstance().addAttackStanceTask(player); player.updatePvPStatus(target); diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java index 17c5758bf8..cac9f1c084 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1212,7 +1212,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Flag the attacker if it's a PlayerInstance outside a PvP area final PlayerInstance player = getActingPlayer(); - if (player != null) + if ((player != null) && !player.isInsideZone(ZoneId.PVP) && (player != target)) // Prevent players from flagging in PvP Zones. { AttackStanceTaskManager.getInstance().addAttackStanceTask(player); player.updatePvPStatus(target); diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java index df51b03169..c4fbece592 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1212,7 +1212,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Flag the attacker if it's a PlayerInstance outside a PvP area final PlayerInstance player = getActingPlayer(); - if (player != null) + if ((player != null) && !player.isInsideZone(ZoneId.PVP) && (player != target)) // Prevent players from flagging in PvP Zones. { AttackStanceTaskManager.getInstance().addAttackStanceTask(player); player.updatePvPStatus(target); diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java index af78245ab3..27c45ec518 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1211,7 +1211,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Flag the attacker if it's a PlayerInstance outside a PvP area final PlayerInstance player = getActingPlayer(); - if (player != null) + if ((player != null) && !player.isInsideZone(ZoneId.PVP) && (player != target)) // Prevent players from flagging in PvP Zones. { AttackStanceTaskManager.getInstance().addAttackStanceTask(player); player.updatePvPStatus(target); 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 a8e58ec1e7..56111935d4 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 @@ -1215,7 +1215,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Flag the attacker if it's a PlayerInstance outside a PvP area final PlayerInstance player = getActingPlayer(); - if (player != null) + if ((player != null) && !player.isInsideZone(ZoneId.PVP) && (player != target)) // Prevent players from flagging in PvP Zones. { AttackStanceTaskManager.getInstance().addAttackStanceTask(player); player.updatePvPStatus(target); diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/Creature.java index 52e778e7a9..3424f3e31d 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -1222,7 +1222,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Flag the attacker if it's a PlayerInstance outside a PvP area final PlayerInstance player = getActingPlayer(); - if (player != null) + if ((player != null) && !player.isInsideZone(ZoneId.PVP) && (player != target)) // Prevent players from flagging in PvP Zones. { AttackStanceTaskManager.getInstance().addAttackStanceTask(player); player.updatePvPStatus(target);