ConversationPhrases.YES_MESSAGES,
new PlayerHasRecordedItemWithHimCondition(mithrilcloak.getQuestSlot(),1),
ConversationStates.QUEST_2_OFFERED,
"Thank you so much! Listen, I must repay the favour, and I have a wonderful idea. Do you want to hear more?",
new MultipleActions(new DropRecordedItemAction(mithrilcloak.getQuestSlot(),1),
new SetQuestAction(mithrilcloak.getQuestSlot(), "fixed_machine"),
new IncreaseXPAction(100)));
// we stored the needed part name as part of the quest slot
npc.add(ConversationStates.QUEST_ITEM_QUESTION,
ConversationPhrases.YES_MESSAGES,
new NotCondition(new PlayerHasRecordedItemWithHimCondition(mithrilcloak.getQuestSlot(),1)),
ConversationStates.ATTENDING,
null,
new SayRequiredItemAction(mithrilcloak.getQuestSlot(),1,"No, you don't have [the item] I need. What a shame."));
// player doesn't have the item to fix machine yet
npc.add(ConversationStates.QUEST_ITEM_QUESTION,
ConversationPhrases.NO_MESSAGES,
null,
ConversationStates.ATTENDING,
null,
new SayRequiredItemAction(mithrilcloak.getQuestSlot(),1,"Ok, well if there's anything else I can help you with just say. Don't forget to bring [the item] next time though!"));
//offer cloak
npc.add(ConversationStates.QUEST_2_OFFERED,
ConversationPhrases.YES_MESSAGES,
new QuestCompletedCondition(mithrilcloak.getShieldQuestSlot()),
ConversationStates.ATTENDING,
"I will make you the most amazing cloak of mithril. You just need to get me the fabric and any tools I need! First please bring me a couple yards of " + mithrilcloak.getFabricName() + ". The expert on fabrics is the wizard #Kampusch.",
new SetQuestAndModifyKarmaAction(mithrilcloak.getQuestSlot(), "need_fabric", 10.0));
// player asks for quest but they haven't completed mithril shield quest
npc.add(ConversationStates.QUEST_2_OFFERED,
ConversationPhrases.YES_MESSAGES,
new AndCondition(
new NotCondition(new QuestCompletedCondition(mithrilcloak.getShieldQuestSlot())),
new QuestStartedCondition(mithrilcloak.getShieldQuestSlot())
),
ConversationStates.ATTENDING,
"Oh, I see you are already on a quest to obtain a mithril shield. You see, I was going to offer you a mithril cloak. But you should finish that first. Come back when you've finished the mithril shield quest and we will speak again.",
new SetQuestAction(mithrilcloak.getQuestSlot(), "need_mithril_shield"));
// player asks for quest but they haven't completed mithril shield quest
npc.add(ConversationStates.QUEST_2_OFFERED,
ConversationPhrases.YES_MESSAGES,
new QuestNotStartedCondition(mithrilcloak.getShieldQuestSlot()),
ConversationStates.ATTENDING,
"There are legends of a wizard called Baldemar, in the famous underground magic city, who will forge a mithril shield for those who bring him what it needs. You should meet him and do what he asks. Once you have completed that quest, come back here and speak with me again. I will have another quest for you.",
new SetQuestAction(mithrilcloak.getQuestSlot(), "need_mithril_shield"));
// player refused to hear more about another quest after fixing machine
npc.add(ConversationStates.QUEST_2_OFFERED,
ConversationPhrases.NO_MESSAGES,
null,