new PlayerHasItemWithHimCondition("obsidian"),
new PlayerHasItemWithHimCondition(FISH)),
ConversationStates.IDLE,
"You found the gem for the blade and the fish bone to make the handle! I'll start work right away. Come back in "
+ REQUIRED_MINUTES + " minutes.",
new MultipleActions(
new DropItemAction("obsidian"),
new DropItemAction(FISH),
new SetQuestAction(QUEST_SLOT, "forging;"),
new SetQuestToTimeStampAction(QUEST_SLOT, 1)));
// player says hi to NPC when equipped with the fish and the gem and
// he's not killed a black dragon
npc.add(ConversationStates.IDLE,
ConversationPhrases.GREETING_MESSAGES,
new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
new QuestInStateCondition(QUEST_SLOT, "knife_offered"),
new NotCondition(new KilledCondition("black dragon")),
new PlayerHasItemWithHimCondition("obsidian"),
new PlayerHasItemWithHimCondition(FISH)),
ConversationStates.ATTENDING,
"Didn't you hear me properly? I told you to go slay a black dragon for the obsidian, not buy it! How do I know this isn't a fake gem? *grumble* I'm not making a special knife for someone who is scared to face a dragon.",
null);
// player says hi to NPC when not equipped with the fish and the gem
npc.add(ConversationStates.IDLE,
ConversationPhrases.GREETING_MESSAGES,
new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
new QuestInStateCondition(QUEST_SLOT, "knife_offered"),
new NotCondition(
new AndCondition(
new PlayerHasItemWithHimCondition("obsidian"),
new PlayerHasItemWithHimCondition(FISH)))),
ConversationStates.ATTENDING,
"Hello again. Don't forget I offered to make that obsidian knife, if you bring me a "
+ FISH
+ " and a piece of obsidian from a black dragon you killed. In the meantime if I can #help you, just say the word.",
null);
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 making the knife. Please check back in"));
final List<ChatAction> reward = new LinkedList<ChatAction>();
reward.add(new IncreaseXPAction(10000));
reward.add(new SetQuestAction(QUEST_SLOT, "done"));
reward.add(new EquipItemAction("obsidian knife", 1, true));
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,
"The knife is ready! You know, that was enjoyable. I think I'll start making things again. Thanks!",
new MultipleActions(reward));
}