public class BrokenBallista extends AbstractNpcAI
{
private final static int BROKEN_BALLISTA_NPC_ID = 18675;
private final static Location[] TELEPORT_LOCATIONS =
{
new Location(0, 0, 0),
new Location(0, 0, 0),
new Location(0, 0, 0),
};
private BrokenBallista()
{
addFirstTalkId(BROKEN_BALLISTA_NPC_ID);
addTalkId(BROKEN_BALLISTA_NPC_ID);
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
if (event.equalsIgnoreCase("teleport"))
{
final Location teleport = TELEPORT_LOCATIONS[Rnd.get(1, TELEPORT_LOCATIONS.length) - 1];
player.teleToLocation(teleport, false);
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onFirstTalk(Npc npc, PlayerInstance player)
{
return BROKEN_BALLISTA_NPC_ID + ".htm";
}
public static void main(String[] args)
{
new BrokenBallista();
}
}