final SpeakerNPC npc = npcs.get("Mr. Yeti");
// says hi without having started quest before
npc.add(ConversationStates.IDLE,
ConversationPhrases.GREETING_MESSAGES,
new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
new QuestNotStartedCondition(QUEST_SLOT)),
ConversationStates.ATTENDING,
"Greetings stranger! Have you seen my snow sculptures? I need a #favor from someone friendly like you.",
null);
// says hi - got the snow yeti asked for
npc.add(ConversationStates.IDLE,
ConversationPhrases.GREETING_MESSAGES,
new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
new QuestInStateCondition(QUEST_SLOT, "start"),
new PlayerHasItemWithHimCondition("snowball", REQUIRED_SNOWBALLS)),
ConversationStates.QUEST_ITEM_BROUGHT,
"Greetings stranger! I see you have the snow I asked for. Are these snowballs for me?",
null);
// says hi - didn't get the snow yeti asked for
npc.add(ConversationStates.IDLE,
ConversationPhrases.GREETING_MESSAGES,
new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
new QuestInStateCondition(QUEST_SLOT, "start"),
new NotCondition(new PlayerHasItemWithHimCondition("snowball", REQUIRED_SNOWBALLS))),
ConversationStates.ATTENDING,
"You're back already? Don't forget that you promised to collect a bunch of snowballs for me!",
null);
// says hi - quest was done before and is now repeatable
npc.add(ConversationStates.IDLE,
ConversationPhrases.GREETING_MESSAGES,
new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
new QuestStartedCondition(QUEST_SLOT),
new QuestNotInStateCondition(QUEST_SLOT, "start"),
new TimePassedCondition(QUEST_SLOT, REQUIRED_MINUTES)),
ConversationStates.ATTENDING,
"Greetings again! Have you seen my latest snow sculptures? I need a #favor again ...",
null);
// says hi - quest was done before and is not yet repeatable
npc.add(ConversationStates.IDLE,
ConversationPhrases.GREETING_MESSAGES,
new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
new QuestStartedCondition(QUEST_SLOT),
new QuestNotInStateCondition(QUEST_SLOT, "start"),
new NotCondition(new TimePassedCondition(QUEST_SLOT, REQUIRED_MINUTES))),
ConversationStates.ATTENDING,
null,