Exemplo n.º 1
0
        public void InitDBs(AssetBundle nonLocalizedBundle, AssetBundle localizedBundle)
        {
            if (StaticDB.s_initialized)
            {
                Debug.Log("WARNING! ATTEMPTED TO INIT STATIC DBS THAT WERE ALREADY INITIALIZED!! IGNORING");
                return;
            }
            string str    = "Assets/BundleAssets/StaticDB/";
            string locale = Main.instance.GetLocale();

            this.m_azeriteEmpoweredItemDB = new AzeriteEmpoweredItemDB();
            if (!this.m_azeriteEmpoweredItemDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load AzeriteEmpoweredItem static DB");
            }
            this.m_charShipmentDB = new CharShipmentDB();
            if (!this.m_charShipmentDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load charShipmentDB static DB");
            }
            this.m_charShipmentContainerDB = new CharShipmentContainerDB();
            if (!this.m_charShipmentContainerDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load charShipmentContainerDB static DB");
            }
            this.m_chrClassesDB = new ChrClassesDB();
            if (!this.m_chrClassesDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load chrClasses static DB");
            }
            this.m_communityIconDB = new CommunityIconDB();
            if (!this.m_communityIconDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load CommunityIcon static DB");
            }
            this.m_creatureDB = new CreatureDB();
            if (!this.m_creatureDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load creature static DB");
            }
            this.m_currencyTypesDB = new CurrencyTypesDB();
            if (!this.m_currencyTypesDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load currencyTypes static DB");
            }
            this.m_currencyContainerDB = new CurrencyContainerDB();
            if (!this.m_currencyContainerDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load currencyContainer static DB");
            }
            this.m_factionDB = new FactionDB();
            if (!this.m_factionDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load faction static DB");
            }
            this.m_garrAbilityDB = new GarrAbilityDB();
            if (!this.m_garrAbilityDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrAbility static DB");
            }
            this.m_garrAbilityCategoryDB = new GarrAbilityCategoryDB();
            if (!this.m_garrAbilityCategoryDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrAbilityCategory static DB");
            }
            this.m_garrAbilityEffectDB = new GarrAbilityEffectDB();
            if (!this.m_garrAbilityEffectDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrAbilityEffect static DB");
            }
            this.m_garrClassSpecDB = new GarrClassSpecDB();
            if (!this.m_garrClassSpecDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrClassSpec static DB");
            }
            this.m_garrEncounterDB = new GarrEncounterDB();
            if (!this.m_garrEncounterDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrEncounter static DB");
            }
            this.m_garrEncounterSetXEncounterDB = new GarrEncounterSetXEncounterDB();
            if (!this.m_garrEncounterSetXEncounterDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrEncounterSetXEncounterDB static DB");
            }
            this.m_garrFollItemSetMemberDB = new GarrFollItemSetMemberDB();
            if (!this.m_garrFollItemSetMemberDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrFollItemSetMember static DB");
            }
            this.m_garrFollowerDB = new GarrFollowerDB();
            if (!this.m_garrFollowerDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrFollower static DB");
            }
            this.m_garrFollowerLevelXPDB = new GarrFollowerLevelXPDB();
            if (!this.m_garrFollowerLevelXPDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrFollowerLevelXP static DB");
            }
            this.m_garrFollowerTypeDB = new GarrFollowerTypeDB();
            if (!this.m_garrFollowerTypeDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load m_garrFollowerType static DB");
            }
            this.m_garrFollowerQualityDB = new GarrFollowerQualityDB();
            if (!this.m_garrFollowerQualityDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load m_garrFollowerQuality static DB");
            }
            this.m_garrFollowerXAbilityDB = new GarrFollowerXAbilityDB();
            if (!this.m_garrFollowerXAbilityDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load m_garrFollowerXAbilty static DB");
            }
            this.m_garrMechanicDB = new GarrMechanicDB();
            if (!this.m_garrMechanicDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrMechanic static DB");
            }
            this.m_garrMechanicTypeDB = new GarrMechanicTypeDB();
            if (!this.m_garrMechanicTypeDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrMechanicType static DB");
            }
            this.m_garrMissionDB = new GarrMissionDB();
            if (!this.m_garrMissionDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrMission static DB");
            }
            this.m_garrMissionRewardDB = new GarrMissionRewardDB();
            if (!this.m_garrMissionRewardDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrMissionReward static DB");
            }
            this.m_garrMissionTypeDB = new GarrMissionTypeDB();
            if (!this.m_garrMissionTypeDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrMissionType static DB");
            }
            this.m_garrMissionXEncounterDB = new GarrMissionXEncounterDB();
            if (!this.m_garrMissionXEncounterDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrMissionXEncounter static DB");
            }
            this.m_garrStringDB = new GarrStringDB();
            if (!this.m_garrStringDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrStringDB static DB");
            }
            this.m_garrTalentDB = new GarrTalentDB();
            if (!this.m_garrTalentDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrTalent static DB");
            }
            this.m_garrTalentTreeDB = new GarrTalentTreeDB();
            if (!this.m_garrTalentTreeDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrTalentTree static DB");
            }
            this.m_itemDB = new ItemDB();
            if (!this.m_itemDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load item static DB");
            }
            this.m_itemSubClassDB = new ItemSubClassDB();
            if (!this.m_itemSubClassDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load item sub class static DB");
            }
            this.m_itemEffectDB = new ItemEffectDB();
            if (!this.m_itemEffectDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load item effect static DB");
            }
            this.m_itemNameDescriptionDB = new ItemNameDescriptionDB();
            if (!this.m_itemNameDescriptionDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load item name description DB");
            }
            this.m_mobileStringsDB = new MobileStringsDB();
            if (!this.m_mobileStringsDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load MobileStrings static DB");
            }
            this.m_questDB = new QuestV2DB();
            if (!this.m_questDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load Quest static DB");
            }
            this.m_questInfoDB = new QuestInfoDB();
            if (!this.m_questInfoDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load QuestInfo static DB");
            }
            this.m_spellEffectDB = new SpellEffectDB();
            if (!this.m_spellEffectDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load SpellEffect static DB");
            }
            this.m_spellTooltipDB = new SpellTooltipDB();
            if (!this.m_spellTooltipDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load SpellTooltip static DB");
            }
            this.m_vw_mobileSpellDB = new VW_MobileSpellDB();
            if (!this.m_vw_mobileSpellDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load VW_MobileSpellDB static DB");
            }
            this.m_uiTextureAtlasMemberDB = new UiTextureAtlasMemberDB();
            if (!this.m_uiTextureAtlasMemberDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load uiTextureAtlasMember static DB");
            }
            this.m_uiTextureAtlasDB = new UiTextureAtlasDB();
            if (!this.m_uiTextureAtlasDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load uiTextureAtlas static DB");
            }
            this.m_uiTextureKitDB = new UiTextureKitDB();
            if (!this.m_uiTextureKitDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load uiTextureKit static DB");
            }
            this.m_worldMapAreaDB = new WorldMapAreaDB();
            if (!this.m_worldMapAreaDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load worldMapArea static DB");
            }
            this.m_rewardPackDB = new RewardPackDB();
            if (!this.m_rewardPackDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load rewardPack static DB");
            }
            this.m_rewardPackXItemDB = new RewardPackXItemDB();
            if (!this.m_rewardPackXItemDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load rewardPackXItem static DB");
            }
            this.m_rewardPackXCurrencyTypeDB = new RewardPackXCurrencyTypeDB();
            if (!this.m_rewardPackXCurrencyTypeDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load rewardPackXCurrencyType static DB");
            }
            if (localizedBundle != null)
            {
                localizedBundle.Unload(true);
            }
            if (nonLocalizedBundle != null)
            {
                nonLocalizedBundle.Unload(true);
            }
            StaticDB.s_initialized = true;
        }
Exemplo n.º 2
0
        public static int[] GetBuffsForCurrentMission(int garrFollowerID, int garrMissionID, GameObject missionFollowerSlotGroup, int missionDuration)
        {
            HashSet <int> nums = new HashSet <int>();

            if (!PersistentFollowerData.followerDictionary.ContainsKey(garrFollowerID))
            {
                return(nums.ToArray <int>());
            }
            WrapperGarrisonFollower item = PersistentFollowerData.followerDictionary[garrFollowerID];

            for (int i = 0; i < item.AbilityIDs.Count; i++)
            {
                GarrAbilityRec record = StaticDB.garrAbilityDB.GetRecord(item.AbilityIDs[i]);
                if (record != null)
                {
                    foreach (GarrAbilityEffectRec recordsByParentID in StaticDB.garrAbilityEffectDB.GetRecordsByParentID(record.ID))
                    {
                        bool flag          = false;
                        uint abilityAction = recordsByParentID.AbilityAction;
                        switch (abilityAction)
                        {
                        case 0:
                        {
                            break;
                        }

                        case 1:
                        {
                            MissionFollowerSlot[] componentsInChildren = missionFollowerSlotGroup.GetComponentsInChildren <MissionFollowerSlot>(true);
                            int num = 0;
                            MissionFollowerSlot[] missionFollowerSlotArray = componentsInChildren;
                            for (int j = 0; j < (int)missionFollowerSlotArray.Length; j++)
                            {
                                if (missionFollowerSlotArray[j].GetCurrentGarrFollowerID() > 0)
                                {
                                    num++;
                                }
                            }
                            flag = num == 1;
                            break;
                        }

                        case 5:
                        {
                            MissionFollowerSlot[] componentsInChildren1 = missionFollowerSlotGroup.GetComponentsInChildren <MissionFollowerSlot>(true);
                            bool flag1 = false;
                            MissionFollowerSlot[] missionFollowerSlotArray1 = componentsInChildren1;
                            for (int k = 0; k < (int)missionFollowerSlotArray1.Length; k++)
                            {
                                int currentGarrFollowerID = missionFollowerSlotArray1[k].GetCurrentGarrFollowerID();
                                if (currentGarrFollowerID > 0 && currentGarrFollowerID != item.GarrFollowerID)
                                {
                                    GarrFollowerRec garrFollowerRec = StaticDB.garrFollowerDB.GetRecord(currentGarrFollowerID);
                                    if (garrFollowerRec != null)
                                    {
                                        if ((GarrisonStatus.Faction() != PVP_FACTION.ALLIANCE ? garrFollowerRec.HordeGarrFollRaceID : garrFollowerRec.AllianceGarrFollRaceID) == recordsByParentID.ActionRace)
                                        {
                                            flag1 = true;
                                            break;
                                        }
                                    }
                                }
                            }
                            flag = flag1;
                            break;
                        }

                        case 6:
                        {
                            flag = (float)missionDuration >= (float)((float)recordsByParentID.ActionHours) * 3600f;
                            break;
                        }

                        case 7:
                        {
                            flag = (float)missionDuration <= (float)((float)recordsByParentID.ActionHours) * 3600f;
                            break;
                        }

                        case 9:
                        {
                            GarrMissionRec garrMissionRec = StaticDB.garrMissionDB.GetRecord(garrMissionID);
                            flag = (garrMissionRec == null ? false : (float)((float)garrMissionRec.TravelDuration) >= (float)((float)recordsByParentID.ActionHours) * 3600f);
                            break;
                        }

                        case 10:
                        {
                            GarrMissionRec record1 = StaticDB.garrMissionDB.GetRecord(garrMissionID);
                            flag = (record1 == null ? false : (float)((float)record1.TravelDuration) <= (float)((float)recordsByParentID.ActionHours) * 3600f);
                            break;
                        }

                        case 12:
                        {
                            break;
                        }

                        default:
                        {
                            switch (abilityAction)
                            {
                            case 22:
                            {
                                MissionFollowerSlot[] componentsInChildren2 = missionFollowerSlotGroup.GetComponentsInChildren <MissionFollowerSlot>(true);
                                bool flag2 = false;
                                MissionFollowerSlot[] missionFollowerSlotArray2 = componentsInChildren2;
                                for (int l = 0; l < (int)missionFollowerSlotArray2.Length; l++)
                                {
                                    int currentGarrFollowerID1 = missionFollowerSlotArray2[l].GetCurrentGarrFollowerID();
                                    if (currentGarrFollowerID1 > 0 && currentGarrFollowerID1 != item.GarrFollowerID)
                                    {
                                        GarrFollowerRec garrFollowerRec1 = StaticDB.garrFollowerDB.GetRecord(currentGarrFollowerID1);
                                        if (garrFollowerRec1 != null)
                                        {
                                            if ((GarrisonStatus.Faction() != PVP_FACTION.ALLIANCE ? garrFollowerRec1.HordeGarrClassSpecID : garrFollowerRec1.AllianceGarrClassSpecID) == recordsByParentID.ActionRecordID)
                                            {
                                                flag2 = true;
                                                break;
                                            }
                                        }
                                    }
                                }
                                flag = flag2;
                                break;
                            }

                            case 23:
                            {
                                bool flag3 = false;
                                if (PersistentMissionData.missionDictionary.ContainsKey(garrMissionID))
                                {
                                    WrapperGarrisonMission wrapperGarrisonMission = PersistentMissionData.missionDictionary[garrMissionID];
                                    for (int m = 0; m < wrapperGarrisonMission.Encounters.Count; m++)
                                    {
                                        int num1 = 0;
                                        while (num1 < wrapperGarrisonMission.Encounters[m].MechanicIDs.Count)
                                        {
                                            GarrMechanicDB           garrMechanicDB           = StaticDB.garrMechanicDB;
                                            WrapperGarrisonEncounter wrapperGarrisonEncounter = wrapperGarrisonMission.Encounters[m];
                                            GarrMechanicRec          garrMechanicRec          = garrMechanicDB.GetRecord(wrapperGarrisonEncounter.MechanicIDs[num1]);
                                            if (garrMechanicRec == null || recordsByParentID.GarrMechanicTypeID != garrMechanicRec.GarrMechanicTypeID)
                                            {
                                                num1++;
                                            }
                                            else
                                            {
                                                flag3 = true;
                                                break;
                                            }
                                        }
                                    }
                                }
                                flag = flag3;
                                break;
                            }

                            case 26:
                            {
                                MissionFollowerSlot[] componentsInChildren3 = missionFollowerSlotGroup.GetComponentsInChildren <MissionFollowerSlot>(true);
                                bool flag4 = false;
                                MissionFollowerSlot[] missionFollowerSlotArray3 = componentsInChildren3;
                                int num2 = 0;
                                while (num2 < (int)missionFollowerSlotArray3.Length)
                                {
                                    int currentGarrFollowerID2 = missionFollowerSlotArray3[num2].GetCurrentGarrFollowerID();
                                    if (currentGarrFollowerID2 <= 0 || currentGarrFollowerID2 == item.GarrFollowerID || (ulong)recordsByParentID.ActionRecordID != (long)currentGarrFollowerID2)
                                    {
                                        num2++;
                                    }
                                    else
                                    {
                                        flag4 = true;
                                        break;
                                    }
                                }
                                flag = flag4;
                                break;
                            }

                            default:
                            {
                                if (abilityAction == 37)
                                {
                                }
                                break;
                            }
                            }
                            break;
                        }
                        }
                        if (!flag)
                        {
                            continue;
                        }
                        nums.Add(record.ID);
                    }
                }
                else
                {
                    Debug.Log(string.Concat(new object[] { "Invalid Ability ID ", item.AbilityIDs[i], " from follower ", item.GarrFollowerID }));
                }
            }
            return(nums.ToArray <int>());
        }