public GenericBountyCoroutine(int questId)
     : base(questId)
 {
     Bounty = BountyDataFactory.GetBountyData(questId);
     ObjectiveSearchRadius      = 1000;
     AutoSetNearbyNodesExplored = true;
     AutoSetNearbyNodesRadius   = 30;
 }
Exemplo n.º 2
0
        public static bool AreAllActBountiesSupported(Act act)
        {
            var result =
                ZetaDia.ActInfo.Bounties.Count(
                    b => b.Act == act && BountyDataFactory.GetBountyData((int)b.Quest) != null) == 5;

            if (!result)
            {
                Logger.Debug("[Bounties] Unsupported bounties are detected in {0}", act);
            }
            return(result);
        }
Exemplo n.º 3
0
        public override async Task <bool> MainTask()
        {
            var bountiesNoCoroutines = ZetaDia.Storage.Quests.Bounties.Where(
                b =>
            {
                BountyData bd = BountyDataFactory.GetBountyData((int)b.Quest);
                if (bd != null && bd.Coroutines.Count == 0)
                {
                    return(true);
                }

                return(false);
            }).ToList();

            var bounties = ZetaDia.Storage.Quests.Bounties.Where(
                b =>
                BountyDataFactory.GetBountyData((int)b.Quest) == null &&
                b.State != QuestState.Completed)
                           .ToList();

            if (bountiesNoCoroutines.Count != 0)
            {
                Core.Logger.Debug("No coroutines:");
                foreach (var bounty in bountiesNoCoroutines)
                {
                    DumpBountyInfo(bounty);
                }
            }

            if (bounties.Count != 0)
            {
                Core.Logger.Debug("Not supported:");
                foreach (var bounty in bounties)
                {
                    DumpBountyInfo(bounty);
                }
            }

            if (bounties.Count != 0 || bountiesNoCoroutines.Count != 0)
            {
                BotMain.Stop(reason: "Unsupported bounty found!");
            }

            Done();
            await Coroutine.Sleep(1000);

            return(true);
        }
Exemplo n.º 4
0
        public static bool AreAllActBountiesSupported(Act act)
        {
            int  numSupported   = ZetaDia.Storage.Quests.Bounties.Count(b => b.Act == act && BountyDataFactory.GetBountyData(b.Quest) != null);
            bool hasUnsupported = numSupported != 5;

            if (hasUnsupported)
            {
                Core.Logger.Debug("[Bounties] Unsupported bounties are detected in {0}", act);
                return(false);
            }
            return(true);
        }
Exemplo n.º 5
0
        public static BountyCoroutine GetBounty(BountyInfo bountyInfo)
        {
            if (bountyInfo == null)
            {
                return(null);
            }

            var bountyData = BountyDataFactory.GetBountyData((int)bountyInfo.Quest);

            if (bountyData == null)
            {
                Core.Logger.Log("Unsupported bounty: {0} - {1}", (int)bountyInfo.Quest, bountyInfo.Info.DisplayName);
                return(null);
            }
            //if (bountyData.QuestType != BountyQuestType.SpecialEvent)
            //{
            //    Core.Logger.Debug("Skipping bounty: {0} - {1}", (int)bountyInfo.Quest, bountyInfo.Info.DisplayName);
            //    return null;
            //}

            //if (QuestDataFactory.QuestDatas.ContainsKey((int)bountyInfo.Quest)) return null;

            BountyCoroutine bounty = null;

            //var bountyType = BountyHelpers.GetQuestType(bountyInfo);
            //if (bountyType != BountyQuestType.SpecialEvent)
            //{
            //    return null;
            //}

            //if (Bounties.TryGetValue((int)bountyInfo.Quest, out bounty))
            //{
            //    Core.Logger.Debug("[BountyFactory] Returning hardcoded bounty:" + bounty.QuestData.Name);
            //}

            // Try to get the kill bounty

            //// Try to get the kill bounty
            //if (bounty == null && bountyInfo.Info.DisplayName.Replace("Bounty: ", string.Empty).StartsWith("Kill ") && TryGetKillBounty((int)bountyInfo.Quest, out bounty))
            //{
            //    Core.Logger.Debug("[BountyFactory] Returning generated bounty:" + bounty.QuestData.Name);
            //}

            // Try to get the clear bounty
            //if (bounty == null && bountyInfo.Info.DisplayName.Replace("Bounty: ", string.Empty).StartsWith("Clear ") && TryGetClearBounty((int)bountyInfo.Quest, out bounty))
            //{
            //    Core.Logger.Debug("[BountyFactory] Returning generated bounty:" + bounty.QuestData.Name);
            //}

            //// Try to get the curse bounty
            //if (bounty == null && bountyInfo.Info.DisplayName.Replace("Bounty: ", string.Empty).StartsWith("The Cursed") && bountyInfo.Quest != SNOQuest.X1_Bounty_A5_PandExt_Event_CursedCrystals && TryGetCursedBounty((int)bountyInfo.Quest, out bounty))
            //{
            //    Core.Logger.Debug("[BountyFactory] Returning generated bounty:" + bounty.QuestData.Name);
            //}

            if (bounty == null)
            {
                bounty = new GenericBountyCoroutine((int)bountyInfo.Quest);
                //if (bounty.QuestData.Steps.First().Objectives.Any(o => o.ObjectiveType == QuestStepObjectiveType.EnterLevelArea))
                //    return null;
                //if (bounty.QuestData.QuestType != BountyQuestType.KillMonster && bounty.QuestData.QuestType != BountyQuestType.ClearZone)
                //    return null;
                Core.Logger.Debug("[BountyFactory] Returning generic bounty:" + bounty.QuestData.Name);
            }

            if (bounty != null)
            {
                bounty.Reset();
                //if (bounty.QuestData.IsDataComplete)
                //{
                //    return null;
                //}
            }
            return(bounty);
        }