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(