// Go kill the dark elves and get the amulet from the thing
}
private void step_3() {
final SpeakerNPC npc = npcs.get("Maerion");
// support for old-style quest
// the player returns to Maerion after having started the quest.
// Maerion checks if the player has killed one of enough dark elf types
npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
new QuestInStateCondition(QUEST_SLOT, "start"),
new NotCondition(new KilledCondition("dark elf archer", "dark elf captain", "thing"))),
ConversationStates.QUEST_STARTED,
"Don't you remember promising to sort out my dark elf problem? Kill every dark elf in the #secret room below - especially the snivelling dark elf captain and any evil dark elf archers you find! And bring me the amulet from the mutant thing.",
null);
npc.add(ConversationStates.IDLE,
ConversationPhrases.GREETING_MESSAGES,
new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
new QuestInStateCondition(QUEST_SLOT, "start"),
new KilledCondition("dark elf archer", "dark elf captain", "thing"),
new NotCondition(new PlayerHasItemWithHimCondition("amulet")))
, ConversationStates.QUEST_STARTED
, "What happened to the amulet? Remember I need it back!"
, null);
npc.add(ConversationStates.IDLE,
ConversationPhrases.GREETING_MESSAGES,
new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
new QuestInStateCondition(QUEST_SLOT, "start"),
new KilledCondition("dark elf archer", "dark elf captain", "thing"),
new PlayerHasItemWithHimCondition("amulet"))
, ConversationStates.ATTENDING
, "Many, many thanks. I am relieved to have that back. Here, take this ring. It can revive the powers of the dead.",
new MultipleActions(new DropItemAction("amulet"),
new EquipItemAction("emerald ring", 1, true),
new IncreaseXPAction(10000),
new IncreaseKarmaAction(5.0),
new SetQuestAction(QUEST_SLOT, "done")));
// support for new-style quest
// building string for completed quest state
StringBuilder sb = new StringBuilder("started");
for(int i=0;i<creatures.size();i++) {
sb.append(";");
sb.append(creatures.get(i));
}
final String completedQuestState = sb.toString();
// the player returns to Maerion after having started the quest.
// Maerion checks if the player has killed one of enough dark elf types
npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
new AndCondition(
new QuestInStateCondition(QUEST_SLOT,0,"started"),
new NotCondition(
new QuestInStateCondition(QUEST_SLOT, completedQuestState))),
ConversationStates.QUEST_STARTED,
"Don't you remember promising to sort out my dark elf problem?"+
" Kill every dark elf in the #secret room below - especially"+
" the ones who command, do magic or are archers." +
" Don't forget the evil matronmother too."+
" And bring me the amulet from the mutant thing.",
new ExamineChatAction("dark-elves-wanted.png", "Wanted!", ""));
npc.add(ConversationStates.IDLE,
ConversationPhrases.GREETING_MESSAGES,
new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
new QuestInStateCondition(QUEST_SLOT, completedQuestState),
new NotCondition(
new PlayerHasItemWithHimCondition("amulet")))
, ConversationStates.QUEST_STARTED
, "What happened to the amulet? Remember I need it back!"
, null);
npc.add(ConversationStates.IDLE,
ConversationPhrases.GREETING_MESSAGES,
new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
new QuestInStateCondition(QUEST_SLOT, completedQuestState),
new PlayerHasItemWithHimCondition("amulet"))
, ConversationStates.ATTENDING
, "Many, many thanks. I am relieved to have that back. Here, take this ring. It can revive the powers of the dead.",
new MultipleActions(new DropItemAction("amulet"),
new EquipItemAction("emerald ring", 1, true),
new IncreaseXPAction(10000),
new IncreaseKarmaAction(5.0),
new SetQuestAction(QUEST_SLOT, "done")));
npc.add(
ConversationStates.QUEST_STARTED,
Arrays.asList("secret", "room", "secret room"),
null,
ConversationStates.ATTENDING,
"The room is below us. It has a grey roof and a evil face for a door. I need you to kill all the dark elves and bring me the amulet from the mutant thing.",