Disabled spawn protection messages in peace zones.

This commit is contained in:
MobiusDev
2018-04-02 18:24:38 +00:00
parent 8c72575f76
commit ca8ac1fb29
8 changed files with 67 additions and 32 deletions
@@ -10266,7 +10266,10 @@ public final class L2PcInstance extends L2Playable
if (isSpawnProtected()) if (isSpawnProtected())
{ {
setProtection(false); setProtection(false);
if (!isInsideZone(ZoneId.PEACE))
{
sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS); sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS);
}
if (Config.RESTORE_SERVITOR_ON_RECONNECT && !hasSummon() && CharSummonTable.getInstance().getServitors().containsKey(getObjectId())) if (Config.RESTORE_SERVITOR_ON_RECONNECT && !hasSummon() && CharSummonTable.getInstance().getServitors().containsKey(getObjectId()))
{ {
CharSummonTable.getInstance().restoreServitor(this); CharSummonTable.getInstance().restoreServitor(this);
@@ -10279,9 +10282,12 @@ public final class L2PcInstance extends L2Playable
if (isTeleportProtected()) if (isTeleportProtected())
{ {
setTeleportProtection(false); setTeleportProtection(false);
if (!isInsideZone(ZoneId.PEACE))
{
sendMessage("Teleport spawn protection ended."); sendMessage("Teleport spawn protection ended.");
} }
} }
}
/** /**
* Expertise of the L2PcInstance (None=0, D=1, C=2, B=3, A=4, S=5, S80=6, S84=7) * Expertise of the L2PcInstance (None=0, D=1, C=2, B=3, A=4, S=5, S80=6, S84=7)
@@ -10273,7 +10273,10 @@ public final class L2PcInstance extends L2Playable
if (isSpawnProtected()) if (isSpawnProtected())
{ {
setProtection(false); setProtection(false);
if (!isInsideZone(ZoneId.PEACE))
{
sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS); sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS);
}
if (Config.RESTORE_SERVITOR_ON_RECONNECT && !hasSummon() && CharSummonTable.getInstance().getServitors().containsKey(getObjectId())) if (Config.RESTORE_SERVITOR_ON_RECONNECT && !hasSummon() && CharSummonTable.getInstance().getServitors().containsKey(getObjectId()))
{ {
CharSummonTable.getInstance().restoreServitor(this); CharSummonTable.getInstance().restoreServitor(this);
@@ -10286,9 +10289,12 @@ public final class L2PcInstance extends L2Playable
if (isTeleportProtected()) if (isTeleportProtected())
{ {
setTeleportProtection(false); setTeleportProtection(false);
if (!isInsideZone(ZoneId.PEACE))
{
sendMessage("Teleport spawn protection ended."); sendMessage("Teleport spawn protection ended.");
} }
} }
}
/** /**
* Expertise of the L2PcInstance (None=0, D=1, C=2, B=3, A=4, S=5, S80=6, S84=7) * Expertise of the L2PcInstance (None=0, D=1, C=2, B=3, A=4, S=5, S80=6, S84=7)
@@ -10283,7 +10283,10 @@ public final class L2PcInstance extends L2Playable
if (isSpawnProtected()) if (isSpawnProtected())
{ {
setProtection(false); setProtection(false);
if (!isInsideZone(ZoneId.PEACE))
{
sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS); sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS);
}
if (Config.RESTORE_SERVITOR_ON_RECONNECT && !hasSummon() && CharSummonTable.getInstance().getServitors().containsKey(getObjectId())) if (Config.RESTORE_SERVITOR_ON_RECONNECT && !hasSummon() && CharSummonTable.getInstance().getServitors().containsKey(getObjectId()))
{ {
CharSummonTable.getInstance().restoreServitor(this); CharSummonTable.getInstance().restoreServitor(this);
@@ -10296,9 +10299,12 @@ public final class L2PcInstance extends L2Playable
if (isTeleportProtected()) if (isTeleportProtected())
{ {
setTeleportProtection(false); setTeleportProtection(false);
if (!isInsideZone(ZoneId.PEACE))
{
sendMessage("Teleport spawn protection ended."); sendMessage("Teleport spawn protection ended.");
} }
} }
}
/** /**
* Expertise of the L2PcInstance (None=0, D=1, C=2, B=3, A=4, S=5, S80=6, S84=7) * Expertise of the L2PcInstance (None=0, D=1, C=2, B=3, A=4, S=5, S80=6, S84=7)
@@ -10276,7 +10276,10 @@ public final class L2PcInstance extends L2Playable
if (isSpawnProtected()) if (isSpawnProtected())
{ {
setProtection(false); setProtection(false);
if (!isInsideZone(ZoneId.PEACE))
{
sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS); sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS);
}
if (Config.RESTORE_SERVITOR_ON_RECONNECT && !hasSummon() && CharSummonTable.getInstance().getServitors().containsKey(getObjectId())) if (Config.RESTORE_SERVITOR_ON_RECONNECT && !hasSummon() && CharSummonTable.getInstance().getServitors().containsKey(getObjectId()))
{ {
CharSummonTable.getInstance().restoreServitor(this); CharSummonTable.getInstance().restoreServitor(this);
@@ -10289,9 +10292,12 @@ public final class L2PcInstance extends L2Playable
if (isTeleportProtected()) if (isTeleportProtected())
{ {
setTeleportProtection(false); setTeleportProtection(false);
if (!isInsideZone(ZoneId.PEACE))
{
sendMessage("Teleport spawn protection ended."); sendMessage("Teleport spawn protection ended.");
} }
} }
}
/** /**
* Expertise of the L2PcInstance (None=0, D=1, C=2, B=3, A=4, S=5, S80=6, S84=7, R=8, R95=9, R99=10) * Expertise of the L2PcInstance (None=0, D=1, C=2, B=3, A=4, S=5, S80=6, S84=7, R=8, R95=9, R99=10)
@@ -15293,27 +15293,21 @@ public final class L2PcInstance extends L2Playable
*/ */
public void onActionRequest() public void onActionRequest()
{ {
/*
* Important: dont send here a broadcast like removeAbnornalstatus cause they will create mass lag on pvp
*/
if (isSpawnProtected()) 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); 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); setTeleportProtection(false);
if (!isInsideZone(ZoneId.PEACE))
{
sendMessage("Teleport spawn protection ended.");
}
} }
} }
@@ -10605,9 +10605,12 @@ public final class L2PcInstance extends L2Playable
public void onActionRequest() public void onActionRequest()
{ {
if (isSpawnProtected()) if (isSpawnProtected())
{
setProtection(false);
if (!isInsideZone(ZoneId.PEACE))
{ {
sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS); sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS);
}
if (Config.RESTORE_SERVITOR_ON_RECONNECT && !hasSummon() && CharSummonTable.getInstance().getServitors().containsKey(getObjectId())) if (Config.RESTORE_SERVITOR_ON_RECONNECT && !hasSummon() && CharSummonTable.getInstance().getServitors().containsKey(getObjectId()))
{ {
CharSummonTable.getInstance().restoreServitor(this); CharSummonTable.getInstance().restoreServitor(this);
@@ -10618,11 +10621,13 @@ public final class L2PcInstance extends L2Playable
} }
} }
if (isTeleportProtected()) if (isTeleportProtected())
{
setTeleportProtection(false);
if (!isInsideZone(ZoneId.PEACE))
{ {
sendMessage("Teleport spawn protection ended."); sendMessage("Teleport spawn protection ended.");
} }
setProtection(false); }
setTeleportProtection(false);
} }
/** /**
@@ -10211,7 +10211,10 @@ public final class L2PcInstance extends L2Playable
if (isSpawnProtected()) if (isSpawnProtected())
{ {
setProtection(false); setProtection(false);
if (!isInsideZone(ZoneId.PEACE))
{
sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS); sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS);
}
if (Config.RESTORE_SERVITOR_ON_RECONNECT && !hasSummon() && CharSummonTable.getInstance().getServitors().containsKey(getObjectId())) if (Config.RESTORE_SERVITOR_ON_RECONNECT && !hasSummon() && CharSummonTable.getInstance().getServitors().containsKey(getObjectId()))
{ {
CharSummonTable.getInstance().restoreServitor(this); CharSummonTable.getInstance().restoreServitor(this);
@@ -10224,9 +10227,12 @@ public final class L2PcInstance extends L2Playable
if (isTeleportProtected()) if (isTeleportProtected())
{ {
setTeleportProtection(false); setTeleportProtection(false);
if (!isInsideZone(ZoneId.PEACE))
{
sendMessage("Teleport spawn protection ended."); sendMessage("Teleport spawn protection ended.");
} }
} }
}
/** /**
* Expertise of the L2PcInstance (None=0, D=1, C=2, B=3, A=4, S=5, S80=6, S84=7) * Expertise of the L2PcInstance (None=0, D=1, C=2, B=3, A=4, S=5, S80=6, S84=7)
@@ -10211,7 +10211,10 @@ public final class L2PcInstance extends L2Playable
if (isSpawnProtected()) if (isSpawnProtected())
{ {
setProtection(false); setProtection(false);
if (!isInsideZone(ZoneId.PEACE))
{
sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS); sendPacket(SystemMessageId.YOU_ARE_NO_LONGER_PROTECTED_FROM_AGGRESSIVE_MONSTERS);
}
if (Config.RESTORE_SERVITOR_ON_RECONNECT && !hasSummon() && CharSummonTable.getInstance().getServitors().containsKey(getObjectId())) if (Config.RESTORE_SERVITOR_ON_RECONNECT && !hasSummon() && CharSummonTable.getInstance().getServitors().containsKey(getObjectId()))
{ {
CharSummonTable.getInstance().restoreServitor(this); CharSummonTable.getInstance().restoreServitor(this);
@@ -10224,9 +10227,12 @@ public final class L2PcInstance extends L2Playable
if (isTeleportProtected()) if (isTeleportProtected())
{ {
setTeleportProtection(false); setTeleportProtection(false);
if (!isInsideZone(ZoneId.PEACE))
{
sendMessage("Teleport spawn protection ended."); sendMessage("Teleport spawn protection ended.");
} }
} }
}
/** /**
* Expertise of the L2PcInstance (None=0, D=1, C=2, B=3, A=4, S=5, S80=6, S84=7) * Expertise of the L2PcInstance (None=0, D=1, C=2, B=3, A=4, S=5, S80=6, S84=7)