Minor improvement for previous commit.

This commit is contained in:
MobiusDev 2018-02-25 11:38:46 +00:00
parent 14e2bbf31e
commit 7dc26ac585

View File

@ -55,42 +55,39 @@ public class DungeonOfAbyssZone extends AbstractNpcAI
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.startsWith("EXIT_PLAYER"))
if (event.startsWith("EXIT_PLAYER") && (player != null))
{
if (player != null)
if (event.contains(ABYSS_WEST_ZONE_1.getName()) && ABYSS_WEST_ZONE_1.getPlayersInside().contains(player))
{
if (event.contains(ABYSS_WEST_ZONE_1.getName()) && ABYSS_WEST_ZONE_1.getPlayersInside().contains(player))
{
player.teleToLocation(EXIT_LOCATION_1);
}
else if (event.contains(ABYSS_WEST_ZONE_2.getName()) && ABYSS_WEST_ZONE_2.getPlayersInside().contains(player))
{
player.teleToLocation(EXIT_LOCATION_2);
}
else if (event.contains(ABYSS_EAST_ZONE_3.getName()) && ABYSS_EAST_ZONE_3.getPlayersInside().contains(player))
{
player.teleToLocation(EXIT_LOCATION_3);
}
else if (event.contains(ABYSS_EAST_ZONE_4.getName()) && ABYSS_EAST_ZONE_4.getPlayersInside().contains(player))
{
player.teleToLocation(EXIT_LOCATION_4);
}
else if (event.contains(ABYSS_WEST_ZONE_BOSS_1.getName()) && ABYSS_WEST_ZONE_BOSS_1.getPlayersInside().contains(player))
{
player.teleToLocation(EXIT_LOCATION_1);
}
else if (event.contains(ABYSS_WEST_ZONE_BOSS_2.getName()) && ABYSS_WEST_ZONE_BOSS_2.getPlayersInside().contains(player))
{
player.teleToLocation(EXIT_LOCATION_2);
}
else if (event.contains(ABYSS_EAST_ZONE_BOSS_3.getName()) && ABYSS_EAST_ZONE_BOSS_3.getPlayersInside().contains(player))
{
player.teleToLocation(EXIT_LOCATION_3);
}
else if (event.contains(ABYSS_EAST_ZONE_BOSS_4.getName()) && ABYSS_EAST_ZONE_BOSS_4.getPlayersInside().contains(player))
{
player.teleToLocation(EXIT_LOCATION_4);
}
player.teleToLocation(EXIT_LOCATION_1);
}
else if (event.contains(ABYSS_WEST_ZONE_2.getName()) && ABYSS_WEST_ZONE_2.getPlayersInside().contains(player))
{
player.teleToLocation(EXIT_LOCATION_2);
}
else if (event.contains(ABYSS_EAST_ZONE_3.getName()) && ABYSS_EAST_ZONE_3.getPlayersInside().contains(player))
{
player.teleToLocation(EXIT_LOCATION_3);
}
else if (event.contains(ABYSS_EAST_ZONE_4.getName()) && ABYSS_EAST_ZONE_4.getPlayersInside().contains(player))
{
player.teleToLocation(EXIT_LOCATION_4);
}
else if (event.contains(ABYSS_WEST_ZONE_BOSS_1.getName()) && ABYSS_WEST_ZONE_BOSS_1.getPlayersInside().contains(player))
{
player.teleToLocation(EXIT_LOCATION_1);
}
else if (event.contains(ABYSS_WEST_ZONE_BOSS_2.getName()) && ABYSS_WEST_ZONE_BOSS_2.getPlayersInside().contains(player))
{
player.teleToLocation(EXIT_LOCATION_2);
}
else if (event.contains(ABYSS_EAST_ZONE_BOSS_3.getName()) && ABYSS_EAST_ZONE_BOSS_3.getPlayersInside().contains(player))
{
player.teleToLocation(EXIT_LOCATION_3);
}
else if (event.contains(ABYSS_EAST_ZONE_BOSS_4.getName()) && ABYSS_EAST_ZONE_BOSS_4.getPlayersInside().contains(player))
{
player.teleToLocation(EXIT_LOCATION_4);
}
}