// player asks what exactly is missing
npc.add(ConversationStates.ATTENDING, "species",
new QuestActiveCondition(QUEST_SLOT),
ConversationStates.QUESTION_2, null,
new ChatAction() {
public void fire(final Player player, final Sentence sentence, final EventRaiser raiser) {
final List<String> needed = missingFish(player, true);
raiser.say("There " + Grammar.isare(needed.size())
+ " "
+ Grammar.quantityplnoun(needed.size(), "fish", "one")
+ " still missing: "
+ Grammar.enumerateCollection(needed)
+ ". Do you have such fish with you?");
}
});
// player says he doesn't have required fish with him
npc.add(ConversationStates.QUESTION_2, ConversationPhrases.NO_MESSAGES, null,
ConversationStates.IDLE, null, new ChatAction() {
public void fire(final Player player, final Sentence sentence, final EventRaiser raiser) {
final List<String> missing = missingFish(player, false);
raiser.say("Let me know as soon as you find "
+ Grammar.itthem(missing.size()) + ". Goodbye.");
}
});
// player says he has a required fish with him
npc.add(ConversationStates.QUESTION_2,
ConversationPhrases.YES_MESSAGES, null,
ConversationStates.QUESTION_2, "Which fish did you catch?",
null);
for(final String itemName : neededFish) {
npc.add(ConversationStates.QUESTION_2, itemName, null,
ConversationStates.QUESTION_2, null,
new ChatAction() {
public void fire(final Player player, final Sentence sentence, final EventRaiser raiser) {
List<String> missing = missingFish(player, false);
if (missing.contains(itemName)) {
if (player.drop(itemName)) {