diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/instancezone/Instance.java index 65d29d5c01..0b2d0a97b1 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/instancezone/Instance.java @@ -883,12 +883,12 @@ public final class Instance implements IIdentifiable, INamable // Listeners // --------------------------------------------- /** - * This method is called when player dead inside instance. + * This method is called when player dies inside instance. * @param player */ public void onDeath(L2PcInstance player) { - if (!player.isOnCustomEvent()) + if (!player.isOnCustomEvent() && (_template.getEjectTime() > 0)) { // Send message final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IF_YOU_ARE_NOT_RESURRECTED_WITHIN_S1_MINUTE_S_YOU_WILL_BE_EXPELLED_FROM_THE_INSTANT_ZONE); diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/instancezone/Instance.java index 65d29d5c01..0b2d0a97b1 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/instancezone/Instance.java @@ -883,12 +883,12 @@ public final class Instance implements IIdentifiable, INamable // Listeners // --------------------------------------------- /** - * This method is called when player dead inside instance. + * This method is called when player dies inside instance. * @param player */ public void onDeath(L2PcInstance player) { - if (!player.isOnCustomEvent()) + if (!player.isOnCustomEvent() && (_template.getEjectTime() > 0)) { // Send message final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IF_YOU_ARE_NOT_RESURRECTED_WITHIN_S1_MINUTE_S_YOU_WILL_BE_EXPELLED_FROM_THE_INSTANT_ZONE); diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/instancezone/Instance.java index 65d29d5c01..0b2d0a97b1 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/instancezone/Instance.java @@ -883,12 +883,12 @@ public final class Instance implements IIdentifiable, INamable // Listeners // --------------------------------------------- /** - * This method is called when player dead inside instance. + * This method is called when player dies inside instance. * @param player */ public void onDeath(L2PcInstance player) { - if (!player.isOnCustomEvent()) + if (!player.isOnCustomEvent() && (_template.getEjectTime() > 0)) { // Send message final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IF_YOU_ARE_NOT_RESURRECTED_WITHIN_S1_MINUTE_S_YOU_WILL_BE_EXPELLED_FROM_THE_INSTANT_ZONE); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/instancezone/Instance.java index 65d29d5c01..0b2d0a97b1 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/instancezone/Instance.java @@ -883,12 +883,12 @@ public final class Instance implements IIdentifiable, INamable // Listeners // --------------------------------------------- /** - * This method is called when player dead inside instance. + * This method is called when player dies inside instance. * @param player */ public void onDeath(L2PcInstance player) { - if (!player.isOnCustomEvent()) + if (!player.isOnCustomEvent() && (_template.getEjectTime() > 0)) { // Send message final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IF_YOU_ARE_NOT_RESURRECTED_WITHIN_S1_MINUTE_S_YOU_WILL_BE_EXPELLED_FROM_THE_INSTANT_ZONE); diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Playable.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Playable.java index 277a354486..6357866a85 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Playable.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Playable.java @@ -169,12 +169,12 @@ public abstract class L2Playable extends L2Character } } // Notify instance - if (getInstanceId() > 0) + if ((getInstanceId() > 0) && isPlayer()) { final Instance instance = InstanceManager.getInstance().getInstance(getInstanceId()); if (instance != null) { - instance.notifyDeath(killer, this); + instance.notifyDeath(actingPlayer); } } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/instancezone/Instance.java index fc671aec4e..3bea31b408 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/instancezone/Instance.java @@ -49,7 +49,6 @@ import com.l2jmobius.gameserver.model.Location; import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.TeleportWhereType; import com.l2jmobius.gameserver.model.actor.L2Attackable; -import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.instance.L2DoorInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; @@ -872,10 +871,20 @@ public final class Instance } } - public void addEjectDeadTask(L2PcInstance player) + /** + * This method is called when player dies inside instance. + * @param player + */ + public void notifyDeath(L2PcInstance player) { - if (player != null) + if (!player.isOnEvent() && (_ejectTime > 0)) { + // Send message + final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IF_YOU_ARE_NOT_RESURRECTED_WITHIN_S1_MINUTES_YOU_WILL_BE_EXPELLED_FROM_THE_INSTANT_ZONE); + sm.addInt(_ejectTime / 60 / 1000); + player.sendPacket(sm); + + // Start eject task _ejectDeadTasks.put(player.getObjectId(), ThreadPool.schedule(() -> { if (player.isDead() && (player.getInstanceId() == getId())) @@ -894,19 +903,6 @@ public final class Instance } } - /** - * @param killer the character that killed the {@code victim} - * @param victim the character that was killed by the {@code killer} - */ - public final void notifyDeath(L2Character killer, L2Character victim) - { - final InstanceWorld instance = InstanceManager.getInstance().getPlayerWorld(victim.getActingPlayer()); - if (instance != null) - { - instance.onDeath(killer, victim); - } - } - public class CheckTimeUp implements Runnable { private final int _remaining; diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/instancezone/InstanceWorld.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/instancezone/InstanceWorld.java index 6db2abb2fd..36d7256ab0 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/instancezone/InstanceWorld.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/instancezone/InstanceWorld.java @@ -25,8 +25,6 @@ import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.instance.L2DoorInstance; -import com.l2jmobius.gameserver.network.SystemMessageId; -import com.l2jmobius.gameserver.network.serverpackets.SystemMessage; /** * Basic instance zone data transfer object. @@ -150,22 +148,6 @@ public class InstanceWorld return status; } - /** - * @param killer - * @param victim - */ - public void onDeath(L2Character killer, L2Character victim) - { - if ((victim == null) || !victim.isPlayer() || (_instance == null)) - { - return; - } - final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IF_YOU_ARE_NOT_RESURRECTED_WITHIN_S1_MINUTES_YOU_WILL_BE_EXPELLED_FROM_THE_INSTANT_ZONE); - sm.addInt(_instance.getEjectTime() / 60 / 1000); - victim.getActingPlayer().sendPacket(sm); - _instance.addEjectDeadTask(victim.getActingPlayer()); - } - /** * Get spawned NPCs from instance. * @return set of NPCs from instance diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/instancezone/Instance.java index 65d29d5c01..0b2d0a97b1 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/instancezone/Instance.java @@ -883,12 +883,12 @@ public final class Instance implements IIdentifiable, INamable // Listeners // --------------------------------------------- /** - * This method is called when player dead inside instance. + * This method is called when player dies inside instance. * @param player */ public void onDeath(L2PcInstance player) { - if (!player.isOnCustomEvent()) + if (!player.isOnCustomEvent() && (_template.getEjectTime() > 0)) { // Send message final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IF_YOU_ARE_NOT_RESURRECTED_WITHIN_S1_MINUTE_S_YOU_WILL_BE_EXPELLED_FROM_THE_INSTANT_ZONE); diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/instancezone/Instance.java index 65d29d5c01..0b2d0a97b1 100644 --- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/instancezone/Instance.java @@ -883,12 +883,12 @@ public final class Instance implements IIdentifiable, INamable // Listeners // --------------------------------------------- /** - * This method is called when player dead inside instance. + * This method is called when player dies inside instance. * @param player */ public void onDeath(L2PcInstance player) { - if (!player.isOnCustomEvent()) + if (!player.isOnCustomEvent() && (_template.getEjectTime() > 0)) { // Send message final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.IF_YOU_ARE_NOT_RESURRECTED_WITHIN_S1_MINUTE_S_YOU_WILL_BE_EXPELLED_FROM_THE_INSTANT_ZONE);