public void CheckGuarantees(Quest completedQuest)
    {
        if (EventsOption.Frequency[0] > 0)
        {
            var eventGuarantee = DarkestDungeonManager.Data.EventDatabase.Guarantees.Find(guarantee =>
                                                                                          guarantee.Dungeon == completedQuest.Dungeon && guarantee.QuestType == completedQuest.Type);

            if (eventGuarantee != null)
            {
                GuaranteedEvent = DarkestDungeonManager.Data.EventDatabase.Events.Find(guarantEvent =>
                                                                                       guarantEvent.Id == eventGuarantee.EventId);

                EventModifiers.IncludeEvent(GuaranteedEvent);
            }
        }
    }
    public void ExecuteProgress()
    {
        foreach (var eventEntry in EventModifiers.EventData)
        {
            switch (eventEntry.Type)
            {
            case TownEventDataType.IdleBuff:
                for (int i = 0; i < Heroes.Count; i++)
                {
                    if (Heroes[i].Status == HeroStatus.Available)
                    {
                        Heroes[i].AddBuff(new BuffInfo(DarkestDungeonManager.Data.Buffs[eventEntry.StringData],
                                                       BuffDurationType.IdleTownVisit, BuffSourceType.Estate));
                    }
                }
                break;

            case TownEventDataType.IdleResolve:
                for (int i = 0; i < Heroes.Count; i++)
                {
                    if (Heroes[i].Class == eventEntry.StringData)
                    {
                        for (int j = 0; j < eventEntry.NumberData; j++)
                        {
                            Heroes[i].Resolve.AddExperience(Heroes[i].Resolve.NextLevelXP - Heroes[i].Resolve.CurrentXP);
                        }

                        Heroes[i].UpdateResolve();
                    }
                }
                break;

            case TownEventDataType.InActivityBuff:
                for (int i = 0; i < Heroes.Count; i++)
                {
                    if (Heroes[i].Status == HeroStatus.Abbey || Heroes[i].Status == HeroStatus.Tavern)
                    {
                        for (int j = 0; j < eventEntry.NumberData; j++)
                        {
                            Heroes[i].AddBuff(new BuffInfo(DarkestDungeonManager.Data.Buffs[eventEntry.StringData],
                                                           BuffDurationType.IdleTownVisit, BuffSourceType.Estate));
                        }
                    }
                }
                break;

            default:
                break;
            }
        }

        TriggeredEvent  = null;
        GuaranteedEvent = null;
        EventModifiers.Reset();
        Estate.ExecuteProgress();

        var possibleEvents = DarkestDungeonManager.Data.EventDatabase.Events.FindAll(townEvent => townEvent.IsPossible);

        if (possibleEvents.Count > 0 && EventsOption.Frequency.Count > 3 && RandomSolver.CheckSuccess(EventsOption.Frequency[3]))
        {
            TriggeredEvent = RandomSolver.ChooseBySingleRandom(possibleEvents);
            for (int i = 0; i < DarkestDungeonManager.Data.EventDatabase.Events.Count; i++)
            {
                DarkestDungeonManager.Data.EventDatabase.Events[i].EventTriggered(false);
            }

            TriggeredEvent.EventTriggered(true);
            EventModifiers.IncludeEvent(TriggeredEvent);

            if (TriggeredEvent.Id == "plot_quest_town_invasion_0")
            {
                DarkestSoundManager.PlayOneShot("event:/town/town_event_display_bandit_incursion");
            }
            else if (TriggeredEvent.Tone == TownEventTone.Bad)
            {
                DarkestSoundManager.PlayOneShot("event:/town/town_event_display_bad");
            }
            else if (TriggeredEvent.Tone == TownEventTone.Good)
            {
                DarkestSoundManager.PlayOneShot("event:/town/town_event_display_good");
            }
            else
            {
                DarkestSoundManager.PlayOneShot("event:/town/town_event_display_neutral");
            }
        }

        GenerateQuests();
        SearchMissingHeroes();
    }