// Player asking about rats when quest is inactive
getMainNPC().add(
ConversationStates.ATTENDING,
Arrays.asList("rats", "rats!"),
new TPPQuestInPhaseCondition(INACTIVE),
ConversationStates.ATTENDING,
"Ados isn't being invaded by rats right now. You can still "+
"get a #reward for the last time you helped. You can ask for #details "+
"if you want.",
null);
// Player asking about rats at invasion time.
getMainNPC().add(
ConversationStates.ATTENDING,
Arrays.asList("rats", "rats!"),
new TPPQuestInPhaseCondition(INVASION),
ConversationStates.ATTENDING,
null,
new ChatAction() {
public void fire(Player player, Sentence sentence, EventRaiser npc) {
npc.say("There " + Grammar.isare(getRats().size()) +
" still about "+Integer.toString(getRats().size())+
" rats alive.");
}
});
// Player asking about rats when quest is neither inactive nor invasion phase
getMainNPC().add(
ConversationStates.ATTENDING,
Arrays.asList("rats", "rats!"),
new AndCondition(
new NotCondition(new TPPQuestInPhaseCondition(INACTIVE)),
new NotCondition(new TPPQuestInPhaseCondition(INVASION))),
ConversationStates.ATTENDING,
"The rats are gone. "+
"You can get #reward for your help now, ask about #details "+
"if you want to know more.",
null);
// Player asked about reward at invasion time
getMainNPC().add(
ConversationStates.ATTENDING,
"reward",
new TPPQuestInPhaseCondition(INVASION),
ConversationStates.ATTENDING,
"Ados is being invaded by rats! "+
"I dont want to reward you now, "+
" until all rats are dead.",
null);
// Player asked about reward not at invasion time
getMainNPC().add(
ConversationStates.ATTENDING,
"reward",
new NotCondition(new TPPQuestInPhaseCondition(INVASION)),
ConversationStates.ATTENDING,
null,
new RewardPlayerAction());
//Player asked about details at invasion time
getMainNPC().add(
ConversationStates.ATTENDING,
"details",
new TPPQuestInPhaseCondition(INVASION),
ConversationStates.ATTENDING,
"Ados is being invaded by rats! "+
"I dont want to either reward you or "+
"explain details to you now,"+
" until all rats are dead.",
null);
getMainNPC().add(
ConversationStates.ATTENDING,
"details",
new NotCondition(new TPPQuestInPhaseCondition(INVASION)),
ConversationStates.ATTENDING,
null,
new DetailsKillingsAction());
}