final SpeakerNPC npc = npcs.get("Pdiddi");
// player says hi before starting the quest
npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
new QuestNotStartedCondition(QUEST_SLOT)),
ConversationStates.INFORMATION_1,
"SHHH! Don't want all n' sundry knowin' wot I #deal in.", null);
// player returns after finishing the quest (it is repeatable) after the
// time as finished
npc.add(
ConversationStates.IDLE,
ConversationPhrases.GREETING_MESSAGES,
new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
new QuestStartedCondition(QUEST_SLOT),
new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES)),
ConversationStates.QUEST_OFFERED,
"Oi, you. Back for more rainbow beans?", null);
// player returns after finishing the quest (it is repeatable) before
// the time as finished
npc.add(
ConversationStates.IDLE,
ConversationPhrases.GREETING_MESSAGES,
new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
new QuestStartedCondition(QUEST_SLOT),
new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES))),
ConversationStates.ATTENDING,
null,
new SayTimeRemainingAction(QUEST_SLOT, 1, REQUIRED_MINUTES, "Alright? I hope you don't want more beans. You can't take more of that stuff for at least another"));
// player responds to word 'deal' - enough level
npc.add(ConversationStates.INFORMATION_1,
"deal",
new AndCondition(
new QuestNotStartedCondition(QUEST_SLOT),
new LevelGreaterThanCondition(REQUIRED_LEVEL-1)),
ConversationStates.QUEST_OFFERED,
"Nosy, aint yer? I deal in rainbow beans. You take some, and who knows where the trip will take yer. It'll cost you "
+ REQUIRED_MONEY
+ " money. You want to buy some?",
null);
// player responds to word 'deal' - low level
npc.add(ConversationStates.INFORMATION_1,
"deal",
new AndCondition(
new QuestNotStartedCondition(QUEST_SLOT),
new LevelLessThanCondition(REQUIRED_LEVEL)),
ConversationStates.ATTENDING,
"It's not stuff you're ready for, pal. Now get out of 'ere! An don't you come back till you've got more hairs on that chest!",
null);