final SpeakerNPC npc = npcs.get("tomi");
// says quest or ice and doesn't have an ice sword and hasn't brought one before
npc.add(ConversationStates.ATTENDING,
questTrigger,
new AndCondition(new QuestNotCompletedCondition(QUEST_SLOT), new NotCondition(new PlayerHasItemWithHimCondition("ice sword"))),
ConversationStates.ATTENDING,
"my ice? ice plz", null);
// says quest or ice and doesn't have an ice sword and has brought one in the past
npc.add(ConversationStates.ATTENDING,
questTrigger,
new AndCondition(new QuestCompletedCondition(QUEST_SLOT), new NotCondition(new PlayerHasItemWithHimCondition("ice sword"))),
ConversationStates.ATTENDING,
"where is my ice?", null);
// says quest or ice and has ice sword with him (first time)
// player gets a karma bonus and some xp
npc.add(ConversationStates.ATTENDING,
questTrigger,
new AndCondition(new QuestNotCompletedCondition(QUEST_SLOT), new PlayerHasItemWithHimCondition("ice sword")),
ConversationStates.ATTENDING,
"my ice :)",
new MultipleActions(new DropItemAction("ice sword"), new IncreaseXPAction(1000), new IncreaseKarmaAction(30.0), new SetQuestAction(QUEST_SLOT, "done;1")));
// says quest or ice and has ice sword with him (second+ time)