Пример #1
0
        private void ModEvents_QuestCompleted(object sender, IQuestCompletedArgs e)
        {
            int id = StoryHelper.ResolveId(e.Quest.id.Value);

            if (id == 4 && !Game1.player.hasOrWillReceiveMail(DONE_LETTER_KEY))
            {
                Game1.addMailForTomorrow(DONE_LETTER_KEY);
            }
        }
Пример #2
0
        private void Events_QuestCompleted(object sender, IQuestCompletedArgs e)
        {
            if (e.Quest.questType.Value != StoryHelper.ADVENTURE_QUEST_TYPE)
            {
                return; // Check only for mod's kind of quests
            }
            int   currentObjectiveId = e.Quest.id.Value - StoryHelper.QUEST_ID_PREFIX;
            Quest nextQuest          = this.StoryHelper.GetNextQuestFor(currentObjectiveId);

            if (nextQuest != null)
            {
                nextQuest.showNew.Value = true;
                nextQuest.accept();
                Game1.player.questLog.Add(nextQuest);
                Game1.addHUDMessage(new HUDMessage(this.contentLoader.LoadString("Strings/Strings:objectiveUpdate"), 2));
                this.monitor.Log($"Next quest added: #{nextQuest.id.Value} '{nextQuest.questTitle}' by #{e.Quest.id.Value} '{e.Quest.questTitle}'");
            }

            this.GameMaster.Data.GetPlayerState().completedQuests.Add(currentObjectiveId);
            this.GameMaster.SyncData();
            this.monitor.Log($"Quest complete: #{e.Quest.id.Value} '{e.Quest.questTitle}'", LogLevel.Info);
        }