final SpeakerNPC npc2 = npcs.get("Thonatus");
npc2.add(ConversationStates.ATTENDING, Arrays.asList("heroes", "who", "hero", "status"),
new NotCondition(new DeathMatchEmptyCondition()), ConversationStates.ATTENDING,
null,
new ChatAction() {
public void fire(final Player player, final Sentence sentence, final EventRaiser npc) {
final List<Player> dmplayers = arena.getPlayers();
final List<String> dmplayernames = new LinkedList<String>();
for (Player dmplayer : dmplayers) {
dmplayernames.add(dmplayer.getName());
}
// List the players inside deathmatch
npc.say("There are heroes battling right now in the deathmatch. If you want to go and join "
+ Grammar.enumerateCollection(dmplayernames) + ", then make the #challenge.");
}
});
npc2.add(ConversationStates.ATTENDING, Arrays.asList("heroes", "who", "hero", "status") , new DeathMatchEmptyCondition(),
ConversationStates.ATTENDING,
"Are you a hero? Make the #challenge if you are sure you want to join the deathmatch.", null);
npc2.add(ConversationStates.ATTENDING, "challenge",
new AndCondition(new LevelGreaterThanCondition(19),
new DeathMatchEmptyCondition(),
new NotCondition(new PlayerHasPetOrSheepCondition())),
ConversationStates.IDLE, null,
new TeleportAction("0_ados_wall_n", 100, 86, Direction.DOWN));
npc2.add(ConversationStates.ATTENDING, "challenge",
new AndCondition(new LevelGreaterThanCondition(19),
new NotCondition(new DeathMatchEmptyCondition()),
new NotCondition(new PlayerHasPetOrSheepCondition())),
ConversationStates.QUESTION_1, null,
new ChatAction() {
public void fire(final Player player, final Sentence sentence, final EventRaiser npc) {
final List<Player> dmplayers = arena.getPlayers();
final List<String> dmplayernames = new LinkedList<String>();
for (Player dmplayer : dmplayers) {
dmplayernames.add(dmplayer.getName());