new PlayerHasItemWithHimCondition("iron", REQUIRED_IRON)),
ConversationStates.IDLE,
"You've brought everything I need to make the vampire sword. Come back in "
+ REQUIRED_MINUTES
+ " minutes and it will be ready",
new MultipleActions(startforging));
// Player returned with goblet and had killed the vampire lord, so offer to forge the sword if iron is brought
npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
new QuestInStateCondition(QUEST_SLOT,"start"),
new PlayerHasItemWithHimCondition("goblet"),
new KilledCondition("vampire lord"),
new NotCondition(new PlayerHasItemWithHimCondition("iron", REQUIRED_IRON))),
ConversationStates.QUEST_ITEM_BROUGHT,
"You have battled hard to bring that goblet. I will use it to #forge the vampire sword",
null);
// Player has only an empty goblet currently, remind to go to Catacombs
npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
new QuestInStateCondition(QUEST_SLOT,"start"),
new PlayerHasItemWithHimCondition("empty goblet"),
new NotCondition(new PlayerHasItemWithHimCondition("goblet"))),
ConversationStates.IDLE,
"Did you lose your way? The Catacombs are in North Semos. Don't come back without a " +
"full goblet! Bye!",
null);
// Player has a goblet (somehow) but did not kill a vampire lord
npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
new QuestInStateCondition(QUEST_SLOT,"start"),
new PlayerHasItemWithHimCondition("goblet"),
new NotCondition(new KilledCondition("vampire lord"))),
ConversationStates.IDLE,
"Hm, that goblet is not filled with vampire blood; it can't be, you have not killed the vampire lord. You must slay him.",
null);
// Player lost the empty goblet?
npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
new QuestInStateCondition(QUEST_SLOT,"start"),
new NotCondition(new PlayerHasItemWithHimCondition("empty goblet")),
new NotCondition(new PlayerHasItemWithHimCondition("goblet"))),
ConversationStates.QUESTION_1,
"I hope you didn't lose your goblet! Do you need another?",
null);
// Player lost the empty goblet, wants another
npc.add(ConversationStates.QUESTION_1,
ConversationPhrases.YES_MESSAGES, null,
ConversationStates.IDLE, "You stupid ..... Be more careful next time. Bye!",
new EquipItemAction("empty goblet"));
// Player doesn't have the empty goblet but claims they don't need another.
npc.add(
ConversationStates.QUESTION_1,
ConversationPhrases.NO_MESSAGES,
null,
ConversationStates.IDLE,
"Then why are you back here? Go slay some vampires! Bye!",
null);
// Returned too early; still forging
npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
new QuestStateStartsWithCondition(QUEST_SLOT, "forging;"),
new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES))),
ConversationStates.IDLE, null,
new SayTimeRemainingAction(QUEST_SLOT, 1, REQUIRED_MINUTES, "I haven't finished forging the sword. Please check back in" +
""));
final List<ChatAction> reward = new LinkedList<ChatAction>();
reward.add(new IncreaseXPAction(5000));
reward.add(new IncreaseKarmaAction(15.0));
// here true means: yes, bound to player, in which case we also have to speciy the amount: 1
reward.add(new EquipItemAction("vampire sword", 1, true));
reward.add(new SetQuestAction(QUEST_SLOT, "done"));
npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
new QuestStateStartsWithCondition(QUEST_SLOT, "forging;"),
new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES)),
ConversationStates.IDLE,
"I have finished forging the mighty Vampire Sword. You deserve this. Now i'm going back to work, goodbye!",
new MultipleActions(reward));
npc.add(
ConversationStates.QUEST_ITEM_BROUGHT,
"forge",
null,