From ca8ac1fb29755f1bca9e75b65d346b694ba67bf8 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Mon, 2 Apr 2018 18:24:38 +0000 Subject: [PATCH] Disabled spawn protection messages in peace zones. --- .../model/actor/instance/L2PcInstance.java | 10 ++++++-- .../model/actor/instance/L2PcInstance.java | 10 ++++++-- .../model/actor/instance/L2PcInstance.java | 10 ++++++-- .../model/actor/instance/L2PcInstance.java | 10 ++++++-- .../model/actor/instance/L2PcInstance.java | 24 +++++++------------ .../model/actor/instance/L2PcInstance.java | 15 ++++++++---- .../model/actor/instance/L2PcInstance.java | 10 ++++++-- .../model/actor/instance/L2PcInstance.java | 10 ++++++-- 8 files changed, 67 insertions(+), 32 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index f94c70c9ba..e6d9dd4b98 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -10266,7 +10266,10 @@ public final class L2PcInstance extends L2Playable if (isSpawnProtected()) { setProtection(false); - sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS); + if (!isInsideZone(ZoneId.PEACE)) + { + sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS); + } if (Config.RESTORE_SERVITOR_ON_RECONNECT && !hasSummon() && CharSummonTable.getInstance().getServitors().containsKey(getObjectId())) { CharSummonTable.getInstance().restoreServitor(this); @@ -10279,7 +10282,10 @@ public final class L2PcInstance extends L2Playable if (isTeleportProtected()) { setTeleportProtection(false); - sendMessage("Teleport spawn protection ended."); + if (!isInsideZone(ZoneId.PEACE)) + { + sendMessage("Teleport spawn protection ended."); + } } } diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 117f29d970..d49d102f4a 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -10273,7 +10273,10 @@ public final class L2PcInstance extends L2Playable if (isSpawnProtected()) { setProtection(false); - sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS); + if (!isInsideZone(ZoneId.PEACE)) + { + sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS); + } if (Config.RESTORE_SERVITOR_ON_RECONNECT && !hasSummon() && CharSummonTable.getInstance().getServitors().containsKey(getObjectId())) { CharSummonTable.getInstance().restoreServitor(this); @@ -10286,7 +10289,10 @@ public final class L2PcInstance extends L2Playable if (isTeleportProtected()) { setTeleportProtection(false); - sendMessage("Teleport spawn protection ended."); + if (!isInsideZone(ZoneId.PEACE)) + { + sendMessage("Teleport spawn protection ended."); + } } } diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 77f359b315..770619e7a3 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -10283,7 +10283,10 @@ public final class L2PcInstance extends L2Playable if (isSpawnProtected()) { setProtection(false); - sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS); + if (!isInsideZone(ZoneId.PEACE)) + { + sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS); + } if (Config.RESTORE_SERVITOR_ON_RECONNECT && !hasSummon() && CharSummonTable.getInstance().getServitors().containsKey(getObjectId())) { CharSummonTable.getInstance().restoreServitor(this); @@ -10296,7 +10299,10 @@ public final class L2PcInstance extends L2Playable if (isTeleportProtected()) { setTeleportProtection(false); - sendMessage("Teleport spawn protection ended."); + if (!isInsideZone(ZoneId.PEACE)) + { + sendMessage("Teleport spawn protection ended."); + } } } diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index d3f3126ae3..528528de98 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -10276,7 +10276,10 @@ public final class L2PcInstance extends L2Playable if (isSpawnProtected()) { setProtection(false); - sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS); + if (!isInsideZone(ZoneId.PEACE)) + { + sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS); + } if (Config.RESTORE_SERVITOR_ON_RECONNECT && !hasSummon() && CharSummonTable.getInstance().getServitors().containsKey(getObjectId())) { CharSummonTable.getInstance().restoreServitor(this); @@ -10289,7 +10292,10 @@ public final class L2PcInstance extends L2Playable if (isTeleportProtected()) { setTeleportProtection(false); - sendMessage("Teleport spawn protection ended."); + if (!isInsideZone(ZoneId.PEACE)) + { + sendMessage("Teleport spawn protection ended."); + } } } diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 259c8b15be..edcd11a254 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -15293,27 +15293,21 @@ public final class L2PcInstance extends L2Playable */ public void onActionRequest() { - /* - * Important: dont send here a broadcast like removeAbnornalstatus cause they will create mass lag on pvp - */ - if (isSpawnProtected()) - { - sendMessage("The effect of Spawn Protection has been removed."); - } - else if (isTeleportProtected()) - { - sendMessage("The effect of Teleport Spawn Protection has been removed."); - } - - if (Config.PLAYER_SPAWN_PROTECTION > 0) { setProtection(false); + if (!isInsideZone(ZoneId.PEACE)) + { + sendMessage("You are no longer protected from aggressive monsters."); + } } - - if (Config.PLAYER_TELEPORT_PROTECTION > 0) + if (isTeleportProtected()) { setTeleportProtection(false); + if (!isInsideZone(ZoneId.PEACE)) + { + sendMessage("Teleport spawn protection ended."); + } } } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 80114a3bed..028336403f 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -10606,8 +10606,11 @@ public final class L2PcInstance extends L2Playable { if (isSpawnProtected()) { - sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS); - + setProtection(false); + if (!isInsideZone(ZoneId.PEACE)) + { + sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS); + } if (Config.RESTORE_SERVITOR_ON_RECONNECT && !hasSummon() && CharSummonTable.getInstance().getServitors().containsKey(getObjectId())) { CharSummonTable.getInstance().restoreServitor(this); @@ -10619,10 +10622,12 @@ public final class L2PcInstance extends L2Playable } if (isTeleportProtected()) { - sendMessage("Teleport spawn protection ended."); + setTeleportProtection(false); + if (!isInsideZone(ZoneId.PEACE)) + { + sendMessage("Teleport spawn protection ended."); + } } - setProtection(false); - setTeleportProtection(false); } /** diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 311d1aa7ce..6b1bd1bf42 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -10211,7 +10211,10 @@ public final class L2PcInstance extends L2Playable if (isSpawnProtected()) { setProtection(false); - sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS); + if (!isInsideZone(ZoneId.PEACE)) + { + sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS); + } if (Config.RESTORE_SERVITOR_ON_RECONNECT && !hasSummon() && CharSummonTable.getInstance().getServitors().containsKey(getObjectId())) { CharSummonTable.getInstance().restoreServitor(this); @@ -10224,7 +10227,10 @@ public final class L2PcInstance extends L2Playable if (isTeleportProtected()) { setTeleportProtection(false); - sendMessage("Teleport spawn protection ended."); + if (!isInsideZone(ZoneId.PEACE)) + { + sendMessage("Teleport spawn protection ended."); + } } } diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 3e579d1879..3c2d53f8f3 100644 --- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -10211,7 +10211,10 @@ public final class L2PcInstance extends L2Playable if (isSpawnProtected()) { setProtection(false); - sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS); + if (!isInsideZone(ZoneId.PEACE)) + { + sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS); + } if (Config.RESTORE_SERVITOR_ON_RECONNECT && !hasSummon() && CharSummonTable.getInstance().getServitors().containsKey(getObjectId())) { CharSummonTable.getInstance().restoreServitor(this); @@ -10224,7 +10227,10 @@ public final class L2PcInstance extends L2Playable if (isTeleportProtected()) { setTeleportProtection(false); - sendMessage("Teleport spawn protection ended."); + if (!isInsideZone(ZoneId.PEACE)) + { + sendMessage("Teleport spawn protection ended."); + } } }