private static void ClearWorldQuestArea(GameObject questArea)
 {
     AdventureMapWorldQuest[] componentsInChildren = questArea.GetComponentsInChildren <AdventureMapWorldQuest>(true);
     for (int i = 0; i < (int)componentsInChildren.Length; i++)
     {
         AdventureMapWorldQuest adventureMapWorldQuest = componentsInChildren[i];
         StackableMapIcon       component  = adventureMapWorldQuest.GetComponent <StackableMapIcon>();
         GameObject             gameObject = adventureMapWorldQuest.gameObject;
         if (component != null)
         {
             component.RemoveFromContainer();
         }
         if (gameObject != null)
         {
             UnityEngine.Object.Destroy(adventureMapWorldQuest.gameObject);
         }
     }
 }
Exemplo n.º 2
0
 public void UpdateWorldQuests()
 {
     foreach (MapInfo mapInfo in MapInfo.GetAllMapInfos())
     {
         AdventureMapPanel.ClearWorldQuestArea(mapInfo.GetWorldQuestArea());
     }
     foreach (WrapperWorldQuest worldQuest in WorldQuestData.WorldQuestDictionary.Values)
     {
         if (worldQuest.StartLocationMapID != 1220 && worldQuest.StartLocationMapID != 1669)
         {
             if (!this.IsFilterEnabled(MapFilterType.All))
             {
                 bool flag = false;
                 if (!flag && this.IsFilterEnabled(MapFilterType.Azerite))
                 {
                     flag |= worldQuest.Currencies.Any((WrapperWorldQuestReward reward) => reward.RecordID == 1553);
                 }
                 if (!flag && this.IsFilterEnabled(MapFilterType.OrderResources))
                 {
                     flag |= worldQuest.Currencies.Any((WrapperWorldQuestReward reward) => reward.RecordID == 1560);
                 }
                 if (!flag && this.IsFilterEnabled(MapFilterType.Gold) && worldQuest.Money > 0)
                 {
                     flag = true;
                 }
                 if (!flag && this.IsFilterEnabled(MapFilterType.Gear))
                 {
                     flag |= worldQuest.Items.Any(delegate(WrapperWorldQuestReward reward)
                     {
                         ItemRec record = StaticDB.itemDB.GetRecord(reward.RecordID);
                         return(record != null && (record.ClassID == 2 || record.ClassID == 3 || record.ClassID == 4 || record.ClassID == 6));
                     });
                 }
                 if (!flag && this.IsFilterEnabled(MapFilterType.ProfessionMats))
                 {
                     flag |= worldQuest.Items.Any(delegate(WrapperWorldQuestReward reward)
                     {
                         ItemRec record = StaticDB.itemDB.GetRecord(reward.RecordID);
                         return(record != null && record.ClassID == 7);
                     });
                 }
                 if (!flag && this.IsFilterEnabled(MapFilterType.PetBattles))
                 {
                     flag |= (worldQuest.QuestInfoID == 115);
                 }
                 if (!flag && this.IsFilterEnabled(MapFilterType.Reputation))
                 {
                     flag |= worldQuest.Currencies.Any(delegate(WrapperWorldQuestReward reward)
                     {
                         CurrencyTypesRec record = StaticDB.currencyTypesDB.GetRecord(reward.RecordID);
                         return(record != null && record.FactionID != 0u);
                     });
                 }
                 if (!flag && this.IsFilterEnabled(MapFilterType.Bounty_ChampionsOfAzeroth))
                 {
                     bool flag2 = flag;
                     bool flag3;
                     if (PersistentBountyData.bountiesByWorldQuestDictionary.ContainsKey(worldQuest.QuestID))
                     {
                         flag3 = PersistentBountyData.bountiesByWorldQuestDictionary[worldQuest.QuestID].BountyQuestIDs.Any((int questID) => questID == 50562);
                     }
                     else
                     {
                         flag3 = false;
                     }
                     flag = (flag2 || flag3);
                 }
                 if (!flag && this.IsFilterEnabled(MapFilterType.Bounty_ZandalariEmpire))
                 {
                     bool flag4 = flag;
                     bool flag5;
                     if (PersistentBountyData.bountiesByWorldQuestDictionary.ContainsKey(worldQuest.QuestID))
                     {
                         flag5 = PersistentBountyData.bountiesByWorldQuestDictionary[worldQuest.QuestID].BountyQuestIDs.Any((int questID) => questID == 50598);
                     }
                     else
                     {
                         flag5 = false;
                     }
                     flag = (flag4 || flag5);
                 }
                 if (!flag && this.IsFilterEnabled(MapFilterType.Bounty_ProudmooreAdmiralty))
                 {
                     bool flag6 = flag;
                     bool flag7;
                     if (PersistentBountyData.bountiesByWorldQuestDictionary.ContainsKey(worldQuest.QuestID))
                     {
                         flag7 = PersistentBountyData.bountiesByWorldQuestDictionary[worldQuest.QuestID].BountyQuestIDs.Any((int questID) => questID == 50599);
                     }
                     else
                     {
                         flag7 = false;
                     }
                     flag = (flag6 || flag7);
                 }
                 if (!flag && this.IsFilterEnabled(MapFilterType.Bounty_OrderOfEmbers))
                 {
                     bool flag8 = flag;
                     bool flag9;
                     if (PersistentBountyData.bountiesByWorldQuestDictionary.ContainsKey(worldQuest.QuestID))
                     {
                         flag9 = PersistentBountyData.bountiesByWorldQuestDictionary[worldQuest.QuestID].BountyQuestIDs.Any((int questID) => questID == 50600);
                     }
                     else
                     {
                         flag9 = false;
                     }
                     flag = (flag8 || flag9);
                 }
                 if (!flag && this.IsFilterEnabled(MapFilterType.Bounty_StormsWake))
                 {
                     bool flag10 = flag;
                     bool flag11;
                     if (PersistentBountyData.bountiesByWorldQuestDictionary.ContainsKey(worldQuest.QuestID))
                     {
                         flag11 = PersistentBountyData.bountiesByWorldQuestDictionary[worldQuest.QuestID].BountyQuestIDs.Any((int questID) => questID == 50601);
                     }
                     else
                     {
                         flag11 = false;
                     }
                     flag = (flag10 || flag11);
                 }
                 if (!flag && this.IsFilterEnabled(MapFilterType.Bounty_TalanjisExpedition))
                 {
                     bool flag12 = flag;
                     bool flag13;
                     if (PersistentBountyData.bountiesByWorldQuestDictionary.ContainsKey(worldQuest.QuestID))
                     {
                         flag13 = PersistentBountyData.bountiesByWorldQuestDictionary[worldQuest.QuestID].BountyQuestIDs.Any((int questID) => questID == 50602);
                     }
                     else
                     {
                         flag13 = false;
                     }
                     flag = (flag12 || flag13);
                 }
                 if (!flag && this.IsFilterEnabled(MapFilterType.Bounty_Voldunai))
                 {
                     bool flag14 = flag;
                     bool flag15;
                     if (PersistentBountyData.bountiesByWorldQuestDictionary.ContainsKey(worldQuest.QuestID))
                     {
                         flag15 = PersistentBountyData.bountiesByWorldQuestDictionary[worldQuest.QuestID].BountyQuestIDs.Any((int questID) => questID == 50603);
                     }
                     else
                     {
                         flag15 = false;
                     }
                     flag = (flag14 || flag15);
                 }
                 if (!flag && this.IsFilterEnabled(MapFilterType.Bounty_TortollanSeekers))
                 {
                     bool flag16 = flag;
                     bool flag17;
                     if (PersistentBountyData.bountiesByWorldQuestDictionary.ContainsKey(worldQuest.QuestID))
                     {
                         flag17 = PersistentBountyData.bountiesByWorldQuestDictionary[worldQuest.QuestID].BountyQuestIDs.Any((int questID) => questID == 50604);
                     }
                     else
                     {
                         flag17 = false;
                     }
                     flag = (flag16 || flag17);
                 }
                 if (!flag && this.IsFilterEnabled(MapFilterType.Bounty_AllianceWarEffort))
                 {
                     bool flag18 = flag;
                     bool flag19;
                     if (PersistentBountyData.bountiesByWorldQuestDictionary.ContainsKey(worldQuest.QuestID))
                     {
                         flag19 = PersistentBountyData.bountiesByWorldQuestDictionary[worldQuest.QuestID].BountyQuestIDs.Any((int questID) => questID == 50605);
                     }
                     else
                     {
                         flag19 = false;
                     }
                     flag = (flag18 || flag19);
                 }
                 if (!flag && this.IsFilterEnabled(MapFilterType.Bounty_HordeWarEffort))
                 {
                     bool flag20 = flag;
                     bool flag21;
                     if (PersistentBountyData.bountiesByWorldQuestDictionary.ContainsKey(worldQuest.QuestID))
                     {
                         flag21 = PersistentBountyData.bountiesByWorldQuestDictionary[worldQuest.QuestID].BountyQuestIDs.Any((int questID) => questID == 50606);
                     }
                     else
                     {
                         flag21 = false;
                     }
                     flag = (flag20 || flag21);
                 }
                 if (!flag)
                 {
                     continue;
                 }
             }
             Dictionary <int, float>   mapScaleTweaks  = null;
             Dictionary <int, Vector2> mapOffsetTweaks = null;
             if (worldQuest.StartLocationMapID == 1642)
             {
                 mapScaleTweaks = new Dictionary <int, float>
                 {
                     {
                         863,
                         -0.02f
                     }
                 };
                 mapOffsetTweaks = new Dictionary <int, Vector2>
                 {
                     {
                         864,
                         new Vector2(60f, -20f)
                     }
                 };
             }
             GameObject gameObject = this.SetupWorldQuestObject(worldQuest, mapScaleTweaks, mapOffsetTweaks);
             if (gameObject != null)
             {
                 AdventureMapWorldQuest component = gameObject.GetComponent <AdventureMapWorldQuest>();
                 component.SetQuestID(worldQuest.QuestID);
                 StackableMapIcon component2 = gameObject.GetComponent <StackableMapIcon>();
                 if (component2 != null)
                 {
                     component2.RegisterWithManager(worldQuest.StartLocationMapID);
                 }
             }
         }
     }
     this.m_pinchZoomContentManager.ForceZoomFactorChanged();
 }
Exemplo n.º 3
0
        public void UpdateWorldQuests()
        {
            AdventureMapPanel.ClearWorldQuestArea(this.m_missionAndWorldQuestArea_BrokenIsles);
            AdventureMapPanel.ClearWorldQuestArea(this.m_missionAndWorldQuestArea_Argus);
            AdventureMapPanel.ClearWorldQuestArea(this.m_missionAndWorldQuestArea_KulTiras);
            AdventureMapPanel.ClearWorldQuestArea(this.m_missionAndWorldQuestArea_Zandalar);
            foreach (WrapperWorldQuest worldQuest in WorldQuestData.WorldQuestDictionary.Values)
            {
                if (!this.IsFilterEnabled(MapFilterType.All))
                {
                    bool flag = false;
                    if (!flag && this.IsFilterEnabled(MapFilterType.OrderResources))
                    {
                        flag |= worldQuest.Currencies.Any((WrapperWorldQuestReward reward) => reward.RecordID == 1220);
                    }
                    if (!flag && this.IsFilterEnabled(MapFilterType.Gold) && worldQuest.Money > 0)
                    {
                        flag = true;
                    }
                    if (!flag && this.IsFilterEnabled(MapFilterType.Gear))
                    {
                        flag |= worldQuest.Items.Any(delegate(WrapperWorldQuestReward reward)
                        {
                            ItemRec record2 = StaticDB.itemDB.GetRecord(reward.RecordID);
                            return(record2 != null && (record2.ClassID == 2 || record2.ClassID == 3 || record2.ClassID == 4 || record2.ClassID == 6));
                        });
                    }
                    if (!flag && this.IsFilterEnabled(MapFilterType.ProfessionMats))
                    {
                        flag |= worldQuest.Items.Any(delegate(WrapperWorldQuestReward reward)
                        {
                            ItemRec record2 = StaticDB.itemDB.GetRecord(reward.RecordID);
                            return(record2 != null && record2.ClassID == 7);
                        });
                    }
                    if (!flag && this.IsFilterEnabled(MapFilterType.PetCharms))
                    {
                        flag |= worldQuest.Items.Any((WrapperWorldQuestReward reward) => reward.RecordID == 116415);
                    }
                    if (!flag && this.IsFilterEnabled(MapFilterType.Bounty_HighmountainTribes))
                    {
                        bool flag2 = flag;
                        bool flag3;
                        if (PersistentBountyData.bountiesByWorldQuestDictionary.ContainsKey(worldQuest.QuestID))
                        {
                            flag3 = PersistentBountyData.bountiesByWorldQuestDictionary[worldQuest.QuestID].BountyQuestIDs.Any((int questID) => questID == 42233);
                        }
                        else
                        {
                            flag3 = false;
                        }
                        flag = (flag2 || flag3);
                    }
                    if (!flag && this.IsFilterEnabled(MapFilterType.Bounty_CourtOfFarondis))
                    {
                        bool flag4 = flag;
                        bool flag5;
                        if (PersistentBountyData.bountiesByWorldQuestDictionary.ContainsKey(worldQuest.QuestID))
                        {
                            flag5 = PersistentBountyData.bountiesByWorldQuestDictionary[worldQuest.QuestID].BountyQuestIDs.Any((int questID) => questID == 42420);
                        }
                        else
                        {
                            flag5 = false;
                        }
                        flag = (flag4 || flag5);
                    }
                    if (!flag && this.IsFilterEnabled(MapFilterType.Bounty_Dreamweavers))
                    {
                        bool flag6 = flag;
                        bool flag7;
                        if (PersistentBountyData.bountiesByWorldQuestDictionary.ContainsKey(worldQuest.QuestID))
                        {
                            flag7 = PersistentBountyData.bountiesByWorldQuestDictionary[worldQuest.QuestID].BountyQuestIDs.Any((int questID) => questID == 42170);
                        }
                        else
                        {
                            flag7 = false;
                        }
                        flag = (flag6 || flag7);
                    }
                    if (!flag && this.IsFilterEnabled(MapFilterType.Bounty_Wardens))
                    {
                        bool flag8 = flag;
                        bool flag9;
                        if (PersistentBountyData.bountiesByWorldQuestDictionary.ContainsKey(worldQuest.QuestID))
                        {
                            flag9 = PersistentBountyData.bountiesByWorldQuestDictionary[worldQuest.QuestID].BountyQuestIDs.Any((int questID) => questID == 42422);
                        }
                        else
                        {
                            flag9 = false;
                        }
                        flag = (flag8 || flag9);
                    }
                    if (!flag && this.IsFilterEnabled(MapFilterType.Bounty_Nightfallen))
                    {
                        bool flag10 = flag;
                        bool flag11;
                        if (PersistentBountyData.bountiesByWorldQuestDictionary.ContainsKey(worldQuest.QuestID))
                        {
                            flag11 = PersistentBountyData.bountiesByWorldQuestDictionary[worldQuest.QuestID].BountyQuestIDs.Any((int questID) => questID == 42421);
                        }
                        else
                        {
                            flag11 = false;
                        }
                        flag = (flag10 || flag11);
                    }
                    if (!flag && this.IsFilterEnabled(MapFilterType.Bounty_Valarjar))
                    {
                        bool flag12 = flag;
                        bool flag13;
                        if (PersistentBountyData.bountiesByWorldQuestDictionary.ContainsKey(worldQuest.QuestID))
                        {
                            flag13 = PersistentBountyData.bountiesByWorldQuestDictionary[worldQuest.QuestID].BountyQuestIDs.Any((int questID) => questID == 42234);
                        }
                        else
                        {
                            flag13 = false;
                        }
                        flag = (flag12 || flag13);
                    }
                    if (!flag && this.IsFilterEnabled(MapFilterType.Bounty_KirinTor))
                    {
                        bool flag14 = flag;
                        bool flag15;
                        if (PersistentBountyData.bountiesByWorldQuestDictionary.ContainsKey(worldQuest.QuestID))
                        {
                            flag15 = PersistentBountyData.bountiesByWorldQuestDictionary[worldQuest.QuestID].BountyQuestIDs.Any((int questID) => questID == 43179);
                        }
                        else
                        {
                            flag15 = false;
                        }
                        flag = (flag14 || flag15);
                    }
                    if (!flag && this.IsFilterEnabled(MapFilterType.Invasion))
                    {
                        QuestInfoRec record = StaticDB.questInfoDB.GetRecord(worldQuest.QuestInfoID);
                        if (record == null)
                        {
                            break;
                        }
                        bool flag16 = record.Type == 7;
                        if (flag16)
                        {
                            flag = true;
                        }
                    }
                    if (!flag)
                    {
                        continue;
                    }
                }
                GameObject gameObject = Object.Instantiate <GameObject>(AdventureMapPanel.instance.m_AdvMapWorldQuestPrefab);
                if (worldQuest.StartLocationMapID == 1220)
                {
                    gameObject.transform.SetParent(this.m_missionAndWorldQuestArea_BrokenIsles.transform, false);
                    float mapScale   = 0.10271506f;
                    float mapOffsetX = 1036.88025f;
                    float mapOffsetY = 597.2115f;
                    this.SetupWorldQuestIcon(worldQuest, gameObject, mapOffsetX, mapOffsetY, mapScale);
                }
                else if (worldQuest.StartLocationMapID == 1669)
                {
                    gameObject.transform.localScale = new Vector3(1.33f, 1.33f, 1.33f);
                    gameObject.transform.SetParent(this.m_missionAndWorldQuestArea_Argus.transform, false);
                    int   worldMapAreaID = worldQuest.WorldMapAreaID;
                    float mapScale2;
                    float mapOffsetX2;
                    float mapOffsetY2;
                    switch (worldMapAreaID)
                    {
                    case 882:
                        goto IL_5EF;

                    default:
                        if (worldMapAreaID == 1170)
                        {
                            goto IL_5EF;
                        }
                        if (worldMapAreaID == 1171)
                        {
                            goto IL_618;
                        }
                        if (worldMapAreaID != 830 && worldMapAreaID != 1135)
                        {
                            Debug.LogError(string.Concat(new object[]
                            {
                                "UNHANDLED WORLD QUEST AREA ID ",
                                worldQuest.QuestTitle,
                                " ",
                                worldQuest.WorldMapAreaID
                            }));
                        }
                        else
                        {
                            mapScale2   = 0.3132809f;
                            mapOffsetX2 = 2115.88f;
                            mapOffsetY2 = -7.788513f;
                            this.SetupWorldQuestIcon(worldQuest, gameObject, mapOffsetX2, mapOffsetY2, mapScale2);
                        }
                        break;

                    case 885:
                        goto IL_618;
                    }
IL_67F:
                    goto IL_761;
IL_5EF:
                    mapScale2   = 0.39f;
                    mapOffsetX2 = 4832.76f;
                    mapOffsetY2 = -1232f;
                    this.SetupWorldQuestIcon(worldQuest, gameObject, mapOffsetX2, mapOffsetY2, mapScale2);
                    goto IL_67F;
IL_618:
                    mapScale2   = 0.38f;
                    mapOffsetX2 = 3981f;
                    mapOffsetY2 = 1520f;
                    this.SetupWorldQuestIcon(worldQuest, gameObject, mapOffsetX2, mapOffsetY2, mapScale2);
                }
                else if (worldQuest.StartLocationMapID == 1642)
                {
                    gameObject.transform.SetParent(this.m_missionAndWorldQuestArea_Zandalar.transform, false);
                    float mapScale3   = 0.10271506f;
                    float mapOffsetX3 = 1036.88025f;
                    float mapOffsetY3 = 597.2115f;
                    this.SetupWorldQuestIcon(worldQuest, gameObject, mapOffsetX3, mapOffsetY3, mapScale3);
                }
                else if (worldQuest.StartLocationMapID == 1643)
                {
                    gameObject.transform.SetParent(this.m_missionAndWorldQuestArea_KulTiras.transform, false);
                    float mapScale4   = 0.10271506f;
                    float mapOffsetX4 = 1036.88025f;
                    float mapOffsetY4 = 597.2115f;
                    this.SetupWorldQuestIcon(worldQuest, gameObject, mapOffsetX4, mapOffsetY4, mapScale4);
                }
                else
                {
                    Debug.LogError(string.Concat(new object[]
                    {
                        "UNHANDLED WORLD QUEST AREA ID ",
                        worldQuest.QuestTitle,
                        " ",
                        worldQuest.WorldMapAreaID
                    }));
                }
IL_761:
                AdventureMapWorldQuest component = gameObject.GetComponent <AdventureMapWorldQuest>();
                component.SetQuestID(worldQuest.QuestID);
                StackableMapIcon component2 = gameObject.GetComponent <StackableMapIcon>();
                if (component2 != null)
                {
                    component2.RegisterWithManager(worldQuest.StartLocationMapID);
                }
            }
            this.m_pinchZoomContentManager.ForceZoomFactorChanged();
        }