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
npc.add(ConversationStates.ATTENDING,
ConversationPhrases.QUEST_MESSAGES,
new QuestInStateCondition(QUEST_SLOT, "start"),
ConversationStates.ATTENDING,
"You already promised me to bring some snowballs! Twenty five pieces, remember ...",
null);
// asks about quest - has done it but it's repeatable now
npc.add(ConversationStates.ATTENDING,
ConversationPhrases.QUEST_MESSAGES,
new AndCondition(new QuestStartedCondition(QUEST_SLOT), new QuestNotInStateCondition(QUEST_SLOT, "start"), new TimePassedCondition(QUEST_SLOT, REQUIRED_MINUTES)),
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 - has done it and it's too soon to do again
npc.add(ConversationStates.ATTENDING,
ConversationPhrases.QUEST_MESSAGES,
new AndCondition(new QuestStartedCondition(QUEST_SLOT), new QuestNotInStateCondition(QUEST_SLOT, "start"), new NotCondition(new TimePassedCondition(QUEST_SLOT, REQUIRED_MINUTES))),
ConversationStates.ATTENDING,
"I have enough snow to finish my sculpture, but thanks for asking.",
null);
// player is willing to help