new NotCondition(
new OrCondition(
new QuestNotStartedCondition(QUEST_SLOT),
new QuestCompletedCondition(QUEST_SLOT))),
new NotCondition(
new TimePassedCondition(QUEST_SLOT, 1, expireDelay))),
ConversationStates.ATTENDING,
null,
new ChatAction() {
public void fire(Player player, Sentence sentence, EventRaiser npc) {
npc.say("You're already on a quest to slay " +
Grammar.a_noun(player.getQuest(QUEST_SLOT,0).split(",")[0]) +
". Say #complete if you're done with it!");
}
});
// player have expired quest time
npc.add(ConversationStates.ATTENDING,
ConversationPhrases.QUEST_MESSAGES,
new AndCondition(
new NotCondition(
new OrCondition(
new QuestNotStartedCondition(QUEST_SLOT),
new QuestCompletedCondition(QUEST_SLOT))),
new TimePassedCondition(QUEST_SLOT, 1, expireDelay)),
ConversationStates.ATTENDING,
null,
new ChatAction() {
public void fire(Player player, Sentence sentence, EventRaiser npc) {
if(player.getQuest(QUEST_SLOT, 0)!=null) {
npc.say("You're already on a quest to slay " +
Grammar.a_noun(player.getQuest(QUEST_SLOT, 0).split(",")[0]) +
". Say #complete if you're done with it!" +
" If you can't find one, perhaps it won't bother Semos either. You could kill #another creature if you like.");
}
}
});
// player asking for quest before allowed time interval
npc.add(ConversationStates.ATTENDING,
ConversationPhrases.QUEST_MESSAGES,
new AndCondition(
new QuestCompletedCondition(QUEST_SLOT),
new NotCondition(
new TimePassedCondition(QUEST_SLOT, 1, delay))),
ConversationStates.ATTENDING,
null,
new SayTimeRemainingAction(QUEST_SLOT,1, delay, "I can only give you a new quest once a day. Please check back in"));
// player asked for quest first time or repeat it after passed proper time
npc.add(ConversationStates.ATTENDING,
ConversationPhrases.QUEST_MESSAGES,
new OrCondition(
new QuestNotStartedCondition(QUEST_SLOT),
new AndCondition(
new QuestCompletedCondition(QUEST_SLOT),
new TimePassedCondition(QUEST_SLOT, 1, delay))),
ConversationStates.ATTENDING,
null,
new DailyQuestAction());
}