Simplifications and corrections for Race Track and Fantasy teleports.

This commit is contained in:
MobiusDevelopment 2019-10-17 12:51:12 +00:00
parent 383412edcc
commit 6b9722a096
25 changed files with 556 additions and 1085 deletions

View File

@ -29,29 +29,13 @@ import ai.AbstractNpcAI;
/**
* Fantasy Island teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToFantasy extends AbstractNpcAI
{
// NPC
private static final int PADDIES = 32378;
// Locations
private static final Location RUNE_TOWNSHIP = new Location(43835, -47749, -792);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
private static final Location[] ISLE_LOCATIONS =
{
new Location(-58752, -56898, -2032),
@ -59,33 +43,30 @@ public class TeleportToFantasy extends AbstractNpcAI
new Location(-60691, -56893, -2032),
new Location(-59720, -55921, -2032)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
}
// Player Variables
// Other
private static final String FANTASY_RETURN = "FANTASY_RETURN";
private TeleportToFantasy()
{
addStartNpc(PADDIES);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(PADDIES);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -94,22 +75,21 @@ public class TeleportToFantasy extends AbstractNpcAI
if (npc.getId() == PADDIES)
{
final int returnId = player.getVariables().getInt(FANTASY_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(FANTASY_RETURN);
}
else
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(RUNE_TOWNSHIP);
npc.broadcastSay(ChatType.GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(TELEPORTER_LOCATIONS.get(31320)); // Rune
}
}
else
{
player.teleToLocation(ISLE_LOCATIONS[getRandom(ISLE_LOCATIONS.length)]);
player.getVariables().set(FANTASY_RETURN, String.valueOf(TELEPORTERS.get(npc.getId())));
player.getVariables().set(FANTASY_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}

View File

@ -19,67 +19,47 @@ package ai.others.TeleportToRaceTrack;
import java.util.HashMap;
import java.util.Map;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
/**
* Monster Derby Track teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToRaceTrack extends AbstractNpcAI
{
// NPC
private static final int RACE_MANAGER = 30995;
// Locations
private static final Location TELEPORT = new Location(12661, 181687, -3540);
private static final Location DION_CASTLE_TOWN = new Location(15670, 142983, -2700);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Location RACE_TRACK_TELEPORT = new Location(12661, 181687, -3540);
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTERS.put(31210, 11); // Race Track Gatekeeper
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
TELEPORTER_LOCATIONS.put(31210, new Location(12882, 181053, -3560)); // Race Track Gatekeeper
}
// Player Variables
// Other
private static final String MONSTER_RETURN = "MONSTER_RETURN";
private TeleportToRaceTrack()
{
addStartNpc(RACE_MANAGER);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(RACE_MANAGER);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -88,22 +68,20 @@ public class TeleportToRaceTrack extends AbstractNpcAI
if (npc.getId() == RACE_MANAGER)
{
final int returnId = player.getVariables().getInt(MONSTER_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(MONSTER_RETURN);
}
else
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(DION_CASTLE_TOWN);
player.teleToLocation(TELEPORTER_LOCATIONS.get(30059)); // Dion
}
}
else
{
player.teleToLocation(TELEPORT);
player.getVariables().set(MONSTER_RETURN, String.valueOf(TELEPORTERS.get(npc.getId())));
player.teleToLocation(RACE_TRACK_TELEPORT);
player.getVariables().set(MONSTER_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}

View File

@ -29,29 +29,13 @@ import ai.AbstractNpcAI;
/**
* Fantasy Island teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToFantasy extends AbstractNpcAI
{
// NPC
private static final int PADDIES = 32378;
// Locations
private static final Location RUNE_TOWNSHIP = new Location(43835, -47749, -792);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
private static final Location[] ISLE_LOCATIONS =
{
new Location(-58752, -56898, -2032),
@ -59,33 +43,30 @@ public class TeleportToFantasy extends AbstractNpcAI
new Location(-60691, -56893, -2032),
new Location(-59720, -55921, -2032)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
}
// Player Variables
// Other
private static final String FANTASY_RETURN = "FANTASY_RETURN";
private TeleportToFantasy()
{
addStartNpc(PADDIES);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(PADDIES);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -94,22 +75,21 @@ public class TeleportToFantasy extends AbstractNpcAI
if (npc.getId() == PADDIES)
{
final int returnId = player.getVariables().getInt(FANTASY_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(FANTASY_RETURN);
}
else
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(RUNE_TOWNSHIP);
npc.broadcastSay(ChatType.GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(TELEPORTER_LOCATIONS.get(31320)); // Rune
}
}
else
{
player.teleToLocation(ISLE_LOCATIONS[getRandom(ISLE_LOCATIONS.length)]);
player.getVariables().set(FANTASY_RETURN, String.valueOf(TELEPORTERS.get(npc.getId())));
player.getVariables().set(FANTASY_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}

View File

@ -19,67 +19,47 @@ package ai.others.TeleportToRaceTrack;
import java.util.HashMap;
import java.util.Map;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
/**
* Monster Derby Track teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToRaceTrack extends AbstractNpcAI
{
// NPC
private static final int RACE_MANAGER = 30995;
// Locations
private static final Location TELEPORT = new Location(12661, 181687, -3540);
private static final Location DION_CASTLE_TOWN = new Location(15670, 142983, -2700);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Location RACE_TRACK_TELEPORT = new Location(12661, 181687, -3540);
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTERS.put(31210, 11); // Race Track Gatekeeper
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
TELEPORTER_LOCATIONS.put(31210, new Location(12882, 181053, -3560)); // Race Track Gatekeeper
}
// Player Variables
// Other
private static final String MONSTER_RETURN = "MONSTER_RETURN";
private TeleportToRaceTrack()
{
addStartNpc(RACE_MANAGER);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(RACE_MANAGER);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -88,22 +68,20 @@ public class TeleportToRaceTrack extends AbstractNpcAI
if (npc.getId() == RACE_MANAGER)
{
final int returnId = player.getVariables().getInt(MONSTER_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(MONSTER_RETURN);
}
else
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(DION_CASTLE_TOWN);
player.teleToLocation(TELEPORTER_LOCATIONS.get(30059)); // Dion
}
}
else
{
player.teleToLocation(TELEPORT);
player.getVariables().set(MONSTER_RETURN, String.valueOf(TELEPORTERS.get(npc.getId())));
player.teleToLocation(RACE_TRACK_TELEPORT);
player.getVariables().set(MONSTER_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}

View File

@ -29,29 +29,13 @@ import ai.AbstractNpcAI;
/**
* Fantasy Island teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToFantasy extends AbstractNpcAI
{
// NPC
private static final int PADDIES = 32378;
// Locations
private static final Location RUNE_TOWNSHIP = new Location(43835, -47749, -792);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
private static final Location[] ISLE_LOCATIONS =
{
new Location(-58752, -56898, -2032),
@ -59,33 +43,30 @@ public class TeleportToFantasy extends AbstractNpcAI
new Location(-60691, -56893, -2032),
new Location(-59720, -55921, -2032)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
}
// Player Variables
// Other
private static final String FANTASY_RETURN = "FANTASY_RETURN";
private TeleportToFantasy()
{
addStartNpc(PADDIES);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(PADDIES);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -94,22 +75,21 @@ public class TeleportToFantasy extends AbstractNpcAI
if (npc.getId() == PADDIES)
{
final int returnId = player.getVariables().getInt(FANTASY_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(FANTASY_RETURN);
}
else
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(RUNE_TOWNSHIP);
npc.broadcastSay(ChatType.GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(TELEPORTER_LOCATIONS.get(31320)); // Rune
}
}
else
{
player.teleToLocation(ISLE_LOCATIONS[getRandom(ISLE_LOCATIONS.length)]);
player.getVariables().set(FANTASY_RETURN, String.valueOf(TELEPORTERS.get(npc.getId())));
player.getVariables().set(FANTASY_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}

View File

@ -19,67 +19,47 @@ package ai.others.TeleportToRaceTrack;
import java.util.HashMap;
import java.util.Map;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
/**
* Monster Derby Track teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToRaceTrack extends AbstractNpcAI
{
// NPC
private static final int RACE_MANAGER = 30995;
// Locations
private static final Location TELEPORT = new Location(12661, 181687, -3540);
private static final Location DION_CASTLE_TOWN = new Location(15670, 142983, -2700);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Location RACE_TRACK_TELEPORT = new Location(12661, 181687, -3540);
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTERS.put(31210, 11); // Race Track Gatekeeper
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
TELEPORTER_LOCATIONS.put(31210, new Location(12882, 181053, -3560)); // Race Track Gatekeeper
}
// Player Variables
// Other
private static final String MONSTER_RETURN = "MONSTER_RETURN";
private TeleportToRaceTrack()
{
addStartNpc(RACE_MANAGER);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(RACE_MANAGER);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -88,22 +68,20 @@ public class TeleportToRaceTrack extends AbstractNpcAI
if (npc.getId() == RACE_MANAGER)
{
final int returnId = player.getVariables().getInt(MONSTER_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(MONSTER_RETURN);
}
else
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(DION_CASTLE_TOWN);
player.teleToLocation(TELEPORTER_LOCATIONS.get(30059)); // Dion
}
}
else
{
player.teleToLocation(TELEPORT);
player.getVariables().set(MONSTER_RETURN, String.valueOf(TELEPORTERS.get(npc.getId())));
player.teleToLocation(RACE_TRACK_TELEPORT);
player.getVariables().set(MONSTER_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}

View File

@ -29,29 +29,13 @@ import ai.AbstractNpcAI;
/**
* Fantasy Island teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToFantasy extends AbstractNpcAI
{
// NPC
private static final int PADDIES = 32378;
// Locations
private static final Location RUNE_TOWNSHIP = new Location(43835, -47749, -792);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
private static final Location[] ISLE_LOCATIONS =
{
new Location(-58752, -56898, -2032),
@ -59,33 +43,30 @@ public class TeleportToFantasy extends AbstractNpcAI
new Location(-60691, -56893, -2032),
new Location(-59720, -55921, -2032)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
}
// Player Variables
// Other
private static final String FANTASY_RETURN = "FANTASY_RETURN";
private TeleportToFantasy()
{
addStartNpc(PADDIES);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(PADDIES);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -94,22 +75,21 @@ public class TeleportToFantasy extends AbstractNpcAI
if (npc.getId() == PADDIES)
{
final int returnId = player.getVariables().getInt(FANTASY_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(FANTASY_RETURN);
}
else
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(RUNE_TOWNSHIP);
npc.broadcastSay(ChatType.GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(TELEPORTER_LOCATIONS.get(31320)); // Rune
}
}
else
{
player.teleToLocation(ISLE_LOCATIONS[getRandom(ISLE_LOCATIONS.length)]);
player.getVariables().set(FANTASY_RETURN, String.valueOf(TELEPORTERS.get(npc.getId())));
player.getVariables().set(FANTASY_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}

View File

@ -19,67 +19,47 @@ package ai.others.TeleportToRaceTrack;
import java.util.HashMap;
import java.util.Map;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
/**
* Monster Derby Track teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToRaceTrack extends AbstractNpcAI
{
// NPC
private static final int RACE_MANAGER = 30995;
// Locations
private static final Location TELEPORT = new Location(12661, 181687, -3540);
private static final Location DION_CASTLE_TOWN = new Location(15670, 142983, -2700);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Location RACE_TRACK_TELEPORT = new Location(12661, 181687, -3540);
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTERS.put(31210, 11); // Race Track Gatekeeper
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
TELEPORTER_LOCATIONS.put(31210, new Location(12882, 181053, -3560)); // Race Track Gatekeeper
}
// Player Variables
// Other
private static final String MONSTER_RETURN = "MONSTER_RETURN";
private TeleportToRaceTrack()
{
addStartNpc(RACE_MANAGER);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(RACE_MANAGER);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -88,22 +68,20 @@ public class TeleportToRaceTrack extends AbstractNpcAI
if (npc.getId() == RACE_MANAGER)
{
final int returnId = player.getVariables().getInt(MONSTER_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(MONSTER_RETURN);
}
else
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(DION_CASTLE_TOWN);
player.teleToLocation(TELEPORTER_LOCATIONS.get(30059)); // Dion
}
}
else
{
player.teleToLocation(TELEPORT);
player.getVariables().set(MONSTER_RETURN, String.valueOf(TELEPORTERS.get(npc.getId())));
player.teleToLocation(RACE_TRACK_TELEPORT);
player.getVariables().set(MONSTER_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}

View File

@ -29,29 +29,13 @@ import ai.AbstractNpcAI;
/**
* Fantasy Island teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToFantasy extends AbstractNpcAI
{
// NPC
private static final int PADDIES = 32378;
// Locations
private static final Location RUNE_TOWNSHIP = new Location(43835, -47749, -792);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
private static final Location[] ISLE_LOCATIONS =
{
new Location(-58752, -56898, -2032),
@ -59,33 +43,30 @@ public class TeleportToFantasy extends AbstractNpcAI
new Location(-60691, -56893, -2032),
new Location(-59720, -55921, -2032)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
}
// Player Variables
// Other
private static final String FANTASY_RETURN = "FANTASY_RETURN";
private TeleportToFantasy()
{
addStartNpc(PADDIES);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(PADDIES);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -94,22 +75,21 @@ public class TeleportToFantasy extends AbstractNpcAI
if (npc.getId() == PADDIES)
{
final int returnId = player.getVariables().getInt(FANTASY_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(FANTASY_RETURN);
}
else
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(RUNE_TOWNSHIP);
npc.broadcastSay(ChatType.GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(TELEPORTER_LOCATIONS.get(31320)); // Rune
}
}
else
{
player.teleToLocation(ISLE_LOCATIONS[getRandom(ISLE_LOCATIONS.length)]);
player.getVariables().set(FANTASY_RETURN, String.valueOf(TELEPORTERS.get(npc.getId())));
player.getVariables().set(FANTASY_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}

View File

@ -19,67 +19,47 @@ package ai.others.TeleportToRaceTrack;
import java.util.HashMap;
import java.util.Map;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
/**
* Monster Derby Track teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToRaceTrack extends AbstractNpcAI
{
// NPC
private static final int RACE_MANAGER = 30995;
// Locations
private static final Location TELEPORT = new Location(12661, 181687, -3540);
private static final Location DION_CASTLE_TOWN = new Location(15670, 142983, -2700);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Location RACE_TRACK_TELEPORT = new Location(12661, 181687, -3540);
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTERS.put(31210, 11); // Race Track Gatekeeper
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
TELEPORTER_LOCATIONS.put(31210, new Location(12882, 181053, -3560)); // Race Track Gatekeeper
}
// Player Variables
// Other
private static final String MONSTER_RETURN = "MONSTER_RETURN";
private TeleportToRaceTrack()
{
addStartNpc(RACE_MANAGER);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(RACE_MANAGER);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -88,22 +68,20 @@ public class TeleportToRaceTrack extends AbstractNpcAI
if (npc.getId() == RACE_MANAGER)
{
final int returnId = player.getVariables().getInt(MONSTER_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(MONSTER_RETURN);
}
else
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(DION_CASTLE_TOWN);
player.teleToLocation(TELEPORTER_LOCATIONS.get(30059)); // Dion
}
}
else
{
player.teleToLocation(TELEPORT);
player.getVariables().set(MONSTER_RETURN, String.valueOf(TELEPORTERS.get(npc.getId())));
player.teleToLocation(RACE_TRACK_TELEPORT);
player.getVariables().set(MONSTER_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}

View File

@ -29,29 +29,13 @@ import ai.AbstractNpcAI;
/**
* Fantasy Island teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToFantasy extends AbstractNpcAI
{
// NPC
private static final int PADDIES = 32378;
// Locations
private static final Location RUNE_TOWNSHIP = new Location(43835, -47749, -792);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
private static final Location[] ISLE_LOCATIONS =
{
new Location(-58752, -56898, -2032),
@ -59,33 +43,30 @@ public class TeleportToFantasy extends AbstractNpcAI
new Location(-60691, -56893, -2032),
new Location(-59720, -55921, -2032)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
}
// Player Variables
// Other
private static final String FANTASY_RETURN = "FANTASY_RETURN";
private TeleportToFantasy()
{
addStartNpc(PADDIES);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(PADDIES);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -94,22 +75,21 @@ public class TeleportToFantasy extends AbstractNpcAI
if (npc.getId() == PADDIES)
{
final int returnId = player.getVariables().getInt(FANTASY_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(FANTASY_RETURN);
}
else
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(RUNE_TOWNSHIP);
npc.broadcastSay(ChatType.GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(TELEPORTER_LOCATIONS.get(31320)); // Rune
}
}
else
{
player.teleToLocation(ISLE_LOCATIONS[getRandom(ISLE_LOCATIONS.length)]);
player.getVariables().set(FANTASY_RETURN, String.valueOf(TELEPORTERS.get(npc.getId())));
player.getVariables().set(FANTASY_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}

View File

@ -19,67 +19,47 @@ package ai.others.TeleportToRaceTrack;
import java.util.HashMap;
import java.util.Map;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
/**
* Monster Derby Track teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToRaceTrack extends AbstractNpcAI
{
// NPC
private static final int RACE_MANAGER = 30995;
// Locations
private static final Location TELEPORT = new Location(12661, 181687, -3540);
private static final Location DION_CASTLE_TOWN = new Location(15670, 142983, -2700);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Location RACE_TRACK_TELEPORT = new Location(12661, 181687, -3540);
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTERS.put(31210, 11); // Race Track Gatekeeper
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
TELEPORTER_LOCATIONS.put(31210, new Location(12882, 181053, -3560)); // Race Track Gatekeeper
}
// Player Variables
// Other
private static final String MONSTER_RETURN = "MONSTER_RETURN";
private TeleportToRaceTrack()
{
addStartNpc(RACE_MANAGER);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(RACE_MANAGER);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -88,22 +68,20 @@ public class TeleportToRaceTrack extends AbstractNpcAI
if (npc.getId() == RACE_MANAGER)
{
final int returnId = player.getVariables().getInt(MONSTER_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(MONSTER_RETURN);
}
else
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(DION_CASTLE_TOWN);
player.teleToLocation(TELEPORTER_LOCATIONS.get(30059)); // Dion
}
}
else
{
player.teleToLocation(TELEPORT);
player.getVariables().set(MONSTER_RETURN, String.valueOf(TELEPORTERS.get(npc.getId())));
player.teleToLocation(RACE_TRACK_TELEPORT);
player.getVariables().set(MONSTER_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}

View File

@ -29,29 +29,13 @@ import ai.AbstractNpcAI;
/**
* Fantasy Island teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToFantasy extends AbstractNpcAI
{
// NPC
private static final int PADDIES = 32378;
// Locations
private static final Location RUNE_TOWNSHIP = new Location(43835, -47749, -792);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
private static final Location[] ISLE_LOCATIONS =
{
new Location(-58752, -56898, -2032),
@ -59,33 +43,30 @@ public class TeleportToFantasy extends AbstractNpcAI
new Location(-60691, -56893, -2032),
new Location(-59720, -55921, -2032)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
}
// Player Variables
// Other
private static final String FANTASY_RETURN = "FANTASY_RETURN";
private TeleportToFantasy()
{
addStartNpc(PADDIES);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(PADDIES);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -94,22 +75,21 @@ public class TeleportToFantasy extends AbstractNpcAI
if (npc.getId() == PADDIES)
{
final int returnId = player.getVariables().getInt(FANTASY_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(FANTASY_RETURN);
}
else
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(RUNE_TOWNSHIP);
npc.broadcastSay(ChatType.GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(TELEPORTER_LOCATIONS.get(31320)); // Rune
}
}
else
{
player.teleToLocation(ISLE_LOCATIONS[getRandom(ISLE_LOCATIONS.length)]);
player.getVariables().set(FANTASY_RETURN, String.valueOf(TELEPORTERS.get(npc.getId())));
player.getVariables().set(FANTASY_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}

View File

@ -19,67 +19,47 @@ package ai.others.TeleportToRaceTrack;
import java.util.HashMap;
import java.util.Map;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
/**
* Monster Derby Track teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToRaceTrack extends AbstractNpcAI
{
// NPC
private static final int RACE_MANAGER = 30995;
// Locations
private static final Location TELEPORT = new Location(12661, 181687, -3540);
private static final Location DION_CASTLE_TOWN = new Location(15670, 142983, -2700);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Location RACE_TRACK_TELEPORT = new Location(12661, 181687, -3540);
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTERS.put(31210, 11); // Race Track Gatekeeper
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
TELEPORTER_LOCATIONS.put(31210, new Location(12882, 181053, -3560)); // Race Track Gatekeeper
}
// Player Variables
// Other
private static final String MONSTER_RETURN = "MONSTER_RETURN";
private TeleportToRaceTrack()
{
addStartNpc(RACE_MANAGER);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(RACE_MANAGER);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -88,22 +68,20 @@ public class TeleportToRaceTrack extends AbstractNpcAI
if (npc.getId() == RACE_MANAGER)
{
final int returnId = player.getVariables().getInt(MONSTER_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(MONSTER_RETURN);
}
else
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(DION_CASTLE_TOWN);
player.teleToLocation(TELEPORTER_LOCATIONS.get(30059)); // Dion
}
}
else
{
player.teleToLocation(TELEPORT);
player.getVariables().set(MONSTER_RETURN, String.valueOf(TELEPORTERS.get(npc.getId())));
player.teleToLocation(RACE_TRACK_TELEPORT);
player.getVariables().set(MONSTER_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}

View File

@ -29,29 +29,13 @@ import ai.AbstractNpcAI;
/**
* Fantasy Island teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToFantasy extends AbstractNpcAI
{
// NPC
private static final int PADDIES = 32378;
// Locations
private static final Location RUNE_TOWNSHIP = new Location(43835, -47749, -792);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
private static final Location[] ISLE_LOCATIONS =
{
new Location(-58752, -56898, -2032),
@ -59,33 +43,30 @@ public class TeleportToFantasy extends AbstractNpcAI
new Location(-60691, -56893, -2032),
new Location(-59720, -55921, -2032)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
}
// Player Variables
// Other
private static final String FANTASY_RETURN = "FANTASY_RETURN";
private TeleportToFantasy()
{
addStartNpc(PADDIES);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(PADDIES);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -94,22 +75,21 @@ public class TeleportToFantasy extends AbstractNpcAI
if (npc.getId() == PADDIES)
{
final int returnId = player.getVariables().getInt(FANTASY_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(FANTASY_RETURN);
}
else
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(RUNE_TOWNSHIP);
npc.broadcastSay(ChatType.GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(TELEPORTER_LOCATIONS.get(31320)); // Rune
}
}
else
{
player.teleToLocation(ISLE_LOCATIONS[getRandom(ISLE_LOCATIONS.length)]);
player.getVariables().set(FANTASY_RETURN, String.valueOf(TELEPORTERS.get(npc.getId())));
player.getVariables().set(FANTASY_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}

View File

@ -19,67 +19,47 @@ package ai.others.TeleportToRaceTrack;
import java.util.HashMap;
import java.util.Map;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
/**
* Monster Derby Track teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToRaceTrack extends AbstractNpcAI
{
// NPC
private static final int RACE_MANAGER = 30995;
// Locations
private static final Location TELEPORT = new Location(12661, 181687, -3540);
private static final Location DION_CASTLE_TOWN = new Location(15670, 142983, -2700);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Location RACE_TRACK_TELEPORT = new Location(12661, 181687, -3540);
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTERS.put(31210, 11); // Race Track Gatekeeper
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
TELEPORTER_LOCATIONS.put(31210, new Location(12882, 181053, -3560)); // Race Track Gatekeeper
}
// Player Variables
// Other
private static final String MONSTER_RETURN = "MONSTER_RETURN";
private TeleportToRaceTrack()
{
addStartNpc(RACE_MANAGER);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(RACE_MANAGER);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -88,22 +68,20 @@ public class TeleportToRaceTrack extends AbstractNpcAI
if (npc.getId() == RACE_MANAGER)
{
final int returnId = player.getVariables().getInt(MONSTER_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(MONSTER_RETURN);
}
else
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(DION_CASTLE_TOWN);
player.teleToLocation(TELEPORTER_LOCATIONS.get(30059)); // Dion
}
}
else
{
player.teleToLocation(TELEPORT);
player.getVariables().set(MONSTER_RETURN, String.valueOf(TELEPORTERS.get(npc.getId())));
player.teleToLocation(RACE_TRACK_TELEPORT);
player.getVariables().set(MONSTER_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}

View File

@ -29,29 +29,13 @@ import ai.AbstractNpcAI;
/**
* Fantasy Island teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToFantasy extends AbstractNpcAI
{
// NPC
private static final int PADDIES = 32378;
// Locations
private static final Location RUNE_TOWNSHIP = new Location(43835, -47749, -792);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
private static final Location[] ISLE_LOCATIONS =
{
new Location(-58752, -56898, -2032),
@ -59,31 +43,30 @@ public class TeleportToFantasy extends AbstractNpcAI
new Location(-60691, -56893, -2032),
new Location(-59720, -55921, -2032)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
}
// Player Variables
// Other
private static final String FANTASY_RETURN = "FANTASY_RETURN";
private TeleportToFantasy()
{
addStartNpc(PADDIES);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(PADDIES);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -92,22 +75,21 @@ public class TeleportToFantasy extends AbstractNpcAI
if (npc.getId() == PADDIES)
{
final int returnId = player.getVariables().getInt(FANTASY_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(FANTASY_RETURN);
}
else
{
npc.broadcastSay(ChatType.GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_RUNE_TOWNSHIP_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(RUNE_TOWNSHIP);
player.teleToLocation(TELEPORTER_LOCATIONS.get(31320)); // Rune
}
}
else
{
player.teleToLocation(ISLE_LOCATIONS[getRandom(ISLE_LOCATIONS.length)]);
player.getVariables().set(FANTASY_RETURN, String.valueOf(TELEPORTERS.get(npc.getId())));
player.getVariables().set(FANTASY_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}

View File

@ -19,66 +19,47 @@ package ai.others.TeleportToRaceTrack;
import java.util.HashMap;
import java.util.Map;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
/**
* Monster Derby Track teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToRaceTrack extends AbstractNpcAI
{
// NPC
private static final int RACE_MANAGER = 30995;
// Locations
private static final Location TELEPORT = new Location(12661, 181687, -3540);
private static final Location DION_CASTLE_TOWN = new Location(15670, 142983, -2700);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Location RACE_TRACK_TELEPORT = new Location(12661, 181687, -3540);
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTERS.put(31210, 11); // Race Track Gatekeeper
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
TELEPORTER_LOCATIONS.put(31210, new Location(12882, 181053, -3560)); // Race Track Gatekeeper
}
// Player Variables
// Other
private static final String MONSTER_RETURN = "MONSTER_RETURN";
private TeleportToRaceTrack()
{
addStartNpc(RACE_MANAGER);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(RACE_MANAGER);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -87,22 +68,20 @@ public class TeleportToRaceTrack extends AbstractNpcAI
if (npc.getId() == RACE_MANAGER)
{
final int returnId = player.getVariables().getInt(MONSTER_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(MONSTER_RETURN);
}
else
{
npc.broadcastSay(ChatType.GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_RUNE_TOWNSHIP_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(DION_CASTLE_TOWN);
player.teleToLocation(TELEPORTER_LOCATIONS.get(30059)); // Dion
}
}
else
{
player.teleToLocation(TELEPORT);
player.getVariables().set(MONSTER_RETURN, TELEPORTERS.get(npc.getId()));
player.teleToLocation(RACE_TRACK_TELEPORT);
player.getVariables().set(MONSTER_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}

View File

@ -19,67 +19,47 @@ package ai.others.TeleportToRaceTrack;
import java.util.HashMap;
import java.util.Map;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
/**
* Monster Derby Track teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToRaceTrack extends AbstractNpcAI
{
// NPC
private static final int RACE_MANAGER = 30995;
// Locations
private static final Location TELEPORT = new Location(12661, 181687, -3540);
private static final Location DION_CASTLE_TOWN = new Location(15670, 142983, -2700);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Location RACE_TRACK_TELEPORT = new Location(12661, 181687, -3540);
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTERS.put(31210, 11); // Race Track Gatekeeper
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
TELEPORTER_LOCATIONS.put(31210, new Location(12882, 181053, -3560)); // Race Track Gatekeeper
}
// Player Variables
// Other
private static final String MONSTER_RETURN = "MONSTER_RETURN";
private TeleportToRaceTrack()
{
addStartNpc(RACE_MANAGER);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(RACE_MANAGER);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -88,22 +68,20 @@ public class TeleportToRaceTrack extends AbstractNpcAI
if (npc.getId() == RACE_MANAGER)
{
final int returnId = player.getVariables().getInt(MONSTER_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(MONSTER_RETURN);
}
else
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(DION_CASTLE_TOWN);
player.teleToLocation(TELEPORTER_LOCATIONS.get(30059)); // Dion
}
}
else
{
player.teleToLocation(TELEPORT);
player.getVariables().set(MONSTER_RETURN, String.valueOf(TELEPORTERS.get(npc.getId())));
player.teleToLocation(RACE_TRACK_TELEPORT);
player.getVariables().set(MONSTER_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}

View File

@ -19,67 +19,47 @@ package ai.others.TeleportToRaceTrack;
import java.util.HashMap;
import java.util.Map;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
/**
* Monster Derby Track teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToRaceTrack extends AbstractNpcAI
{
// NPC
private static final int RACE_MANAGER = 30995;
// Locations
private static final Location TELEPORT = new Location(12661, 181687, -3540);
private static final Location DION_CASTLE_TOWN = new Location(15670, 142983, -2700);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Location RACE_TRACK_TELEPORT = new Location(12661, 181687, -3540);
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTERS.put(31210, 11); // Race Track Gatekeeper
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
TELEPORTER_LOCATIONS.put(31210, new Location(12882, 181053, -3560)); // Race Track Gatekeeper
}
// Player Variables
// Other
private static final String MONSTER_RETURN = "MONSTER_RETURN";
private TeleportToRaceTrack()
{
addStartNpc(RACE_MANAGER);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(RACE_MANAGER);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -88,22 +68,20 @@ public class TeleportToRaceTrack extends AbstractNpcAI
if (npc.getId() == RACE_MANAGER)
{
final int returnId = player.getVariables().getInt(MONSTER_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(MONSTER_RETURN);
}
else
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(DION_CASTLE_TOWN);
player.teleToLocation(TELEPORTER_LOCATIONS.get(30059)); // Dion
}
}
else
{
player.teleToLocation(TELEPORT);
player.getVariables().set(MONSTER_RETURN, String.valueOf(TELEPORTERS.get(npc.getId())));
player.teleToLocation(RACE_TRACK_TELEPORT);
player.getVariables().set(MONSTER_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}

View File

@ -19,67 +19,47 @@ package ai.others.TeleportToRaceTrack;
import java.util.HashMap;
import java.util.Map;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
/**
* Monster Derby Track teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToRaceTrack extends AbstractNpcAI
{
// NPC
private static final int RACE_MANAGER = 30995;
// Locations
private static final Location TELEPORT = new Location(12661, 181687, -3540);
private static final Location DION_CASTLE_TOWN = new Location(15670, 142983, -2700);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Location RACE_TRACK_TELEPORT = new Location(12661, 181687, -3540);
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTERS.put(31210, 11); // Race Track Gatekeeper
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
TELEPORTER_LOCATIONS.put(31210, new Location(12882, 181053, -3560)); // Race Track Gatekeeper
}
// Player Variables
// Other
private static final String MONSTER_RETURN = "MONSTER_RETURN";
private TeleportToRaceTrack()
{
addStartNpc(RACE_MANAGER);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(RACE_MANAGER);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -88,22 +68,20 @@ public class TeleportToRaceTrack extends AbstractNpcAI
if (npc.getId() == RACE_MANAGER)
{
final int returnId = player.getVariables().getInt(MONSTER_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(MONSTER_RETURN);
}
else
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(DION_CASTLE_TOWN);
player.teleToLocation(TELEPORTER_LOCATIONS.get(30059)); // Dion
}
}
else
{
player.teleToLocation(TELEPORT);
player.getVariables().set(MONSTER_RETURN, String.valueOf(TELEPORTERS.get(npc.getId())));
player.teleToLocation(RACE_TRACK_TELEPORT);
player.getVariables().set(MONSTER_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}

View File

@ -19,67 +19,47 @@ package ai.others.TeleportToRaceTrack;
import java.util.HashMap;
import java.util.Map;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
/**
* Monster Derby Track teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToRaceTrack extends AbstractNpcAI
{
// NPC
private static final int RACE_MANAGER = 30995;
// Locations
private static final Location TELEPORT = new Location(12661, 181687, -3540);
private static final Location DION_CASTLE_TOWN = new Location(15670, 142983, -2700);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Location RACE_TRACK_TELEPORT = new Location(12661, 181687, -3540);
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTERS.put(31210, 11); // Race Track Gatekeeper
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
TELEPORTER_LOCATIONS.put(31210, new Location(12882, 181053, -3560)); // Race Track Gatekeeper
}
// Player Variables
// Other
private static final String MONSTER_RETURN = "MONSTER_RETURN";
private TeleportToRaceTrack()
{
addStartNpc(RACE_MANAGER);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(RACE_MANAGER);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -88,22 +68,20 @@ public class TeleportToRaceTrack extends AbstractNpcAI
if (npc.getId() == RACE_MANAGER)
{
final int returnId = player.getVariables().getInt(MONSTER_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(MONSTER_RETURN);
}
else
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(DION_CASTLE_TOWN);
player.teleToLocation(TELEPORTER_LOCATIONS.get(30059)); // Dion
}
}
else
{
player.teleToLocation(TELEPORT);
player.getVariables().set(MONSTER_RETURN, String.valueOf(TELEPORTERS.get(npc.getId())));
player.teleToLocation(RACE_TRACK_TELEPORT);
player.getVariables().set(MONSTER_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}

View File

@ -19,67 +19,47 @@ package ai.others.TeleportToRaceTrack;
import java.util.HashMap;
import java.util.Map;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
/**
* Monster Derby Track teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToRaceTrack extends AbstractNpcAI
{
// NPC
private static final int RACE_MANAGER = 30995;
// Locations
private static final Location TELEPORT = new Location(12661, 181687, -3540);
private static final Location DION_CASTLE_TOWN = new Location(15670, 142983, -2700);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Location RACE_TRACK_TELEPORT = new Location(12661, 181687, -3540);
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTERS.put(31210, 11); // Race Track Gatekeeper
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
TELEPORTER_LOCATIONS.put(31210, new Location(12882, 181053, -3560)); // Race Track Gatekeeper
}
// Player Variables
// Other
private static final String MONSTER_RETURN = "MONSTER_RETURN";
private TeleportToRaceTrack()
{
addStartNpc(RACE_MANAGER);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(RACE_MANAGER);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -88,22 +68,20 @@ public class TeleportToRaceTrack extends AbstractNpcAI
if (npc.getId() == RACE_MANAGER)
{
final int returnId = player.getVariables().getInt(MONSTER_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(MONSTER_RETURN);
}
else
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(DION_CASTLE_TOWN);
player.teleToLocation(TELEPORTER_LOCATIONS.get(30059)); // Dion
}
}
else
{
player.teleToLocation(TELEPORT);
player.getVariables().set(MONSTER_RETURN, String.valueOf(TELEPORTERS.get(npc.getId())));
player.teleToLocation(RACE_TRACK_TELEPORT);
player.getVariables().set(MONSTER_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}

View File

@ -19,67 +19,47 @@ package ai.others.TeleportToRaceTrack;
import java.util.HashMap;
import java.util.Map;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
/**
* Monster Derby Track teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToRaceTrack extends AbstractNpcAI
{
// NPC
private static final int RACE_MANAGER = 30995;
// Locations
private static final Location TELEPORT = new Location(12661, 181687, -3540);
private static final Location DION_CASTLE_TOWN = new Location(15670, 142983, -2700);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Location RACE_TRACK_TELEPORT = new Location(12661, 181687, -3540);
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTERS.put(31210, 11); // Race Track Gatekeeper
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
TELEPORTER_LOCATIONS.put(31210, new Location(12882, 181053, -3560)); // Race Track Gatekeeper
}
// Player Variables
// Other
private static final String MONSTER_RETURN = "MONSTER_RETURN";
private TeleportToRaceTrack()
{
addStartNpc(RACE_MANAGER);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(RACE_MANAGER);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -88,22 +68,20 @@ public class TeleportToRaceTrack extends AbstractNpcAI
if (npc.getId() == RACE_MANAGER)
{
final int returnId = player.getVariables().getInt(MONSTER_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(MONSTER_RETURN);
}
else
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(DION_CASTLE_TOWN);
player.teleToLocation(TELEPORTER_LOCATIONS.get(30059)); // Dion
}
}
else
{
player.teleToLocation(TELEPORT);
player.getVariables().set(MONSTER_RETURN, String.valueOf(TELEPORTERS.get(npc.getId())));
player.teleToLocation(RACE_TRACK_TELEPORT);
player.getVariables().set(MONSTER_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}

View File

@ -19,67 +19,47 @@ package ai.others.TeleportToRaceTrack;
import java.util.HashMap;
import java.util.Map;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
/**
* Monster Derby Track teleport AI.
* @author Plim
* @author Mobius
*/
public class TeleportToRaceTrack extends AbstractNpcAI
{
// NPC
private static final int RACE_MANAGER = 30995;
// Locations
private static final Location TELEPORT = new Location(12661, 181687, -3540);
private static final Location DION_CASTLE_TOWN = new Location(15670, 142983, -2700);
private static final Location[] RETURN_LOCATIONS =
{
new Location(-80826, 149775, -3043),
new Location(-12672, 122776, -3116),
new Location(15670, 142983, -2705),
new Location(83400, 147943, -3404),
new Location(111409, 219364, -3545),
new Location(82956, 53162, -1495),
new Location(146331, 25762, -2018),
new Location(116819, 76994, -2714),
new Location(43835, -47749, -792),
new Location(147930, -55281, -2728),
new Location(87386, -143246, -1293),
new Location(12882, 181053, -3560)
};
// Misc
private static final Map<Integer, Integer> TELEPORTERS = new HashMap<>();
private static final Location RACE_TRACK_TELEPORT = new Location(12661, 181687, -3540);
private static final Map<Integer, Location> TELEPORTER_LOCATIONS = new HashMap<>();
static
{
TELEPORTERS.put(30320, 0); // Richlin
TELEPORTERS.put(30256, 1); // Bella
TELEPORTERS.put(30059, 2); // Trisha
TELEPORTERS.put(30080, 3); // Clarissa
TELEPORTERS.put(30899, 4); // Flauen
TELEPORTERS.put(30177, 5); // Valentina
TELEPORTERS.put(30848, 6); // Elisa
TELEPORTERS.put(30233, 7); // Esmeralda
TELEPORTERS.put(31320, 8); // Ilyana
TELEPORTERS.put(31275, 9); // Tatiana
TELEPORTERS.put(31964, 10); // Bilia
TELEPORTERS.put(31210, 11); // Race Track Gatekeeper
TELEPORTER_LOCATIONS.put(30320, new Location(-80826, 149775, -3043)); // Richlin
TELEPORTER_LOCATIONS.put(30256, new Location(-12672, 122776, -3116)); // Bella
TELEPORTER_LOCATIONS.put(30059, new Location(15670, 142983, -2705)); // Trisha
TELEPORTER_LOCATIONS.put(30080, new Location(83400, 147943, -3404)); // Clarissa
TELEPORTER_LOCATIONS.put(30899, new Location(111409, 219364, -3545)); // Flauen
TELEPORTER_LOCATIONS.put(30177, new Location(82956, 53162, -1495)); // Valentina
TELEPORTER_LOCATIONS.put(30848, new Location(146331, 25762, -2018)); // Elisa
TELEPORTER_LOCATIONS.put(30233, new Location(116819, 76994, -2714)); // Esmeralda
TELEPORTER_LOCATIONS.put(31320, new Location(43835, -47749, -792)); // Ilyana
TELEPORTER_LOCATIONS.put(31275, new Location(147930, -55281, -2728)); // Tatiana
TELEPORTER_LOCATIONS.put(31964, new Location(87386, -143246, -1293)); // Bilia
TELEPORTER_LOCATIONS.put(31210, new Location(12882, 181053, -3560)); // Race Track Gatekeeper
}
// Player Variables
// Other
private static final String MONSTER_RETURN = "MONSTER_RETURN";
private TeleportToRaceTrack()
{
addStartNpc(RACE_MANAGER);
addStartNpc(TELEPORTERS.keySet());
addStartNpc(TELEPORTER_LOCATIONS.keySet());
addTalkId(RACE_MANAGER);
addTalkId(TELEPORTERS.keySet());
addTalkId(TELEPORTER_LOCATIONS.keySet());
}
@Override
@ -88,22 +68,20 @@ public class TeleportToRaceTrack extends AbstractNpcAI
if (npc.getId() == RACE_MANAGER)
{
final int returnId = player.getVariables().getInt(MONSTER_RETURN, -1);
if (returnId != -1)
if (returnId > 30000) // Old script compatibility.
{
player.teleToLocation(RETURN_LOCATIONS[returnId]);
player.teleToLocation(TELEPORTER_LOCATIONS.get(returnId));
player.getVariables().remove(MONSTER_RETURN);
}
else
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_THE_TOWN_OF_RUNE_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(DION_CASTLE_TOWN);
player.teleToLocation(TELEPORTER_LOCATIONS.get(30059)); // Dion
}
}
else
{
player.teleToLocation(TELEPORT);
player.getVariables().set(MONSTER_RETURN, String.valueOf(TELEPORTERS.get(npc.getId())));
player.teleToLocation(RACE_TRACK_TELEPORT);
player.getVariables().set(MONSTER_RETURN, npc.getId());
}
return super.onTalk(npc, player);
}