//Clear quest -> boolean says if quest is cleared or canceled) public override void ClearQuest(bool completed) { //Clear the quest from the base class (QuestSystem) base.ClearQuest(completed); //If completed, state becomes Finish if (completed) { LoggedQuestSystem.questFinished(From, (string)Name); } else { LoggedQuestSystem.questCanceled(From, (string)Name); } }
public override void OnClick() { PlayerMobile player = (PlayerMobile)m_Mobile; //Look for the quest state LoggedQuestState bobstate = LoggedQuestSystem.getQuestState(player, "Bunny Attack Quest"); //No need to check Alfred -> If brian's quest is finished, then alfred's is too LoggedQuestState brianstate = LoggedQuestSystem.getQuestState(player, "Brian's Quest"); if ((bobstate == LoggedQuestState.FINISHED) && (brianstate == LoggedQuestState.FINISHED)) { //Get David's State LoggedQuestState davidstate = LoggedQuestSystem.getQuestState(player, "David's Quest"); //David's info DavidLoggedQuestInfo davidinfo = null; if (davidstate == LoggedQuestState.NOTINVOLVED) { //Create a DavidLoggedQuestInfo instance and replace the information for this entry davidinfo = new DavidLoggedQuestInfo(); //Add entry LoggedQuestSystem.questFinished(player, "David's Quest"); //Set Counter davidinfo.Counter = 0; davidinfo.State = LoggedQuestState.FINISHED; LoggedQuestSystem.updateQuestInfo(player, "David's Quest", davidinfo); } else { davidinfo = (DavidLoggedQuestInfo)LoggedQuestSystem.getQuestInfo(player, "David's Quest"); } //Check counter if (davidinfo.Counter < 2) { bool gold = true; GiveRewardTo(player, ref gold); //If given if (!gold) { //Now update the counter davidinfo.Counter++; m_Giver.Say("Here, have some gold " + davidinfo.Counter); } else { m_Giver.Say("You don't even have room for gold!"); } } else { m_Giver.Say("Go away, I gave you gold twice!"); } } else { m_Giver.Say("I have nothing to say to you!"); } }