// 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,
new SayTimeRemainingAction(QUEST_SLOT, REQUIRED_MINUTES, "I have enough snow for my new sculpture. Thank you for helping! "
+ "I might start a new one in" ));
// asks about quest - has never started it
npc.add(ConversationStates.ATTENDING,
ConversationPhrases.QUEST_MESSAGES,
new QuestNotStartedCondition(QUEST_SLOT),
ConversationStates.QUEST_OFFERED,
"I like to make snow sculptures, but the snow in this cavern is not good enough. Would you help me and get some snowballs? I need twenty five of them.",
null);
// asks about quest but already on it