public AddonReader(ILogger logger, DataConfig dataConfig, AreaDB areaDb, IAddonDataProvider addonDataProvider)
        {
            this.logger            = logger;
            this.addonDataProvider = addonDataProvider;

            this.squareReader = new SquareReader(this);

            this.itemDb     = new ItemDB(logger, dataConfig);
            this.creatureDb = new CreatureDB(logger, dataConfig);

            this.BagReader       = new BagReader(squareReader, 20, itemDb);
            this.equipmentReader = new EquipmentReader(squareReader, 30);
            this.PlayerReader    = new PlayerReader(squareReader, creatureDb);
            this.LevelTracker    = new LevelTracker(PlayerReader);

            this.areaDb         = areaDb;
            this.worldMapAreaDb = new WorldMapAreaDB(logger, dataConfig);
        }
 public PlayerReader(ISquareReader reader, CreatureDB creatureDb)
 {
     this.reader     = reader;
     this.creatureDb = creatureDb;
 }
Example #3
0
 public void SetCube(GameObject timeCube)
 {
     this.db = timeCube.GetComponent <CreatureDB>();
 }
Example #4
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;
        }
Example #5
0
        public RequirementFactory(ILogger logger, AddonReader addonReader)
        {
            this.logger          = logger;
            this.addonReader     = addonReader;
            this.playerReader    = addonReader.PlayerReader;
            this.bagReader       = addonReader.BagReader;
            this.equipmentReader = addonReader.EquipmentReader;
            this.spellBookReader = addonReader.SpellBookReader;
            this.talentReader    = addonReader.TalentReader;
            this.creatureDb      = addonReader.CreatureDb;
            this.itemDb          = addonReader.ItemDb;

            keywordDictionary = new Dictionary <string, Func <string, Requirement> >()
            {
                { ">=", GetInclusiveValueBasedRequirement },
                { "<=", GetInclusiveValueBasedRequirement },
                { ">", GetExcusiveValueBasedRequirement },
                { "<", GetExcusiveValueBasedRequirement },
                { "==", GetEqualsValueBasedRequirement },
                { "npcID:", CreateNpcRequirement },
                { "BagItem:", CreateBagItemRequirement },
                { "SpellInRange:", CreateSpellInRangeRequirement },
                { "TargetCastingSpell", CreateTargetCastingSpellRequirement },
                { "Form", CreateFormRequirement },
                { "Race", CreateRaceRequirement },
                { "Spell", CreateSpellRequirement },
                { "Talent", CreateTalentRequirement },
                { "Trigger:", CreateTriggerRequirement }
            };

            booleanDictionary = new Dictionary <string, Func <bool> >
            {
                // Target Based
                { "TargetYieldXP", () => playerReader.TargetYieldXP },

                // Range
                { "InMeleeRange", () => playerReader.IsInMeleeRange },
                { "InDeadZoneRange", () => playerReader.IsInDeadZone },
                { "OutOfCombatRange", () => !playerReader.WithInCombatRange },
                { "InCombatRange", () => playerReader.WithInCombatRange },

                // Pet
                { "Has Pet", () => playerReader.Bits.HasPet },
                { "Pet Happy", () => playerReader.Bits.PetHappy },

                // Auto Spell
                { "AutoAttacking", () => playerReader.Bits.IsAutoRepeatSpellOn_AutoAttack },
                { "Shooting", () => playerReader.Bits.IsAutoRepeatSpellOn_Shoot },
                { "AutoShot", () => playerReader.Bits.IsAutoRepeatSpellOn_AutoShot },

                // Temporary Enchants
                { "HasMainHandEnchant", () => playerReader.Bits.MainHandEnchant_Active },
                { "HasOffHandEnchant", () => playerReader.Bits.OffHandEnchant_Active },

                // Equipment - Bag
                { "Items Broken", () => playerReader.Bits.ItemsAreBroken },
                { "BagFull", () => bagReader.BagsFull },
                { "HasRangedWeapon", () => equipmentReader.HasRanged() },
                { "HasAmmo", () => playerReader.Bits.HasAmmo },

                // General Buff Condition
                { "Eating", () => playerReader.Buffs.Eating },
                { "Drinking", () => playerReader.Buffs.Drinking },
                { "Mana Regeneration", () => playerReader.Buffs.ManaRegeneration },
                { "Well Fed", () => playerReader.Buffs.WellFed },
                { "Clearcasting", () => playerReader.Buffs.Clearcasting },

                // Player Affected
                { "Swimming", () => playerReader.Bits.IsSwimming },
                { "Falling", () => playerReader.Bits.IsFalling },

                //Priest
                { "Fortitude", () => playerReader.Buffs.Fortitude },
                { "InnerFire", () => playerReader.Buffs.InnerFire },
                { "Divine Spirit", () => playerReader.Buffs.DivineSpirit },
                { "Renew", () => playerReader.Buffs.Renew },
                { "Shield", () => playerReader.Buffs.Shield },

                // Druid
                { "Mark of the Wild", () => playerReader.Buffs.MarkOfTheWild },
                { "Thorns", () => playerReader.Buffs.Thorns },
                { "TigersFury", () => playerReader.Buffs.TigersFury },
                { "Prowl", () => playerReader.Buffs.Prowl },
                { "Rejuvenation", () => playerReader.Buffs.Rejuvenation },
                { "Regrowth", () => playerReader.Buffs.Regrowth },

                // Paladin
                { "Seal", () => playerReader.Buffs.Seal },
                { "Aura", () => playerReader.Buffs.Aura },
                { "Devotion Aura", () => playerReader.Buffs.Aura },
                { "Blessing", () => playerReader.Buffs.Blessing },
                { "Blessing of Might", () => playerReader.Buffs.Blessing },

                // Mage
                { "Frost Armor", () => playerReader.Buffs.FrostArmor },
                { "Ice Armor", () => playerReader.Buffs.FrostArmor },
                { "Arcane Intellect", () => playerReader.Buffs.ArcaneIntellect },
                { "Ice Barrier", () => playerReader.Buffs.IceBarrier },
                { "Ward", () => playerReader.Buffs.Ward },
                { "Fire Power", () => playerReader.Buffs.FirePower },
                { "Mana Shield", () => playerReader.Buffs.ManaShield },
                { "Presence of Mind", () => playerReader.Buffs.PresenceOfMind },
                { "Arcane Power", () => playerReader.Buffs.ArcanePower },

                // Rogue
                { "Slice and Dice", () => playerReader.Buffs.SliceAndDice },
                { "Stealth", () => playerReader.Buffs.Stealth },

                // Warrior
                { "Battle Shout", () => playerReader.Buffs.BattleShout },

                // Warlock
                { "Demon Skin", () => playerReader.Buffs.Demon },
                { "Demon Armor", () => playerReader.Buffs.Demon },
                { "Soul Link", () => playerReader.Buffs.SoulLink },
                { "Soulstone Resurrection", () => playerReader.Buffs.SoulstoneResurrection },
                { "Shadow Trance", () => playerReader.Buffs.ShadowTrance },

                // Shaman
                { "Lightning Shield", () => playerReader.Buffs.LightningShield },
                { "Water Shield", () => playerReader.Buffs.WaterShield },
                { "Shamanistic Focus", () => playerReader.Buffs.ShamanisticFocus },
                { "Focused", () => playerReader.Buffs.ShamanisticFocus },
                { "Stoneskin", () => playerReader.Buffs.Stoneskin },

                //Hunter
                { "Aspect of the Cheetah", () => playerReader.Buffs.Aspect },
                { "Aspect of the Pack", () => playerReader.Buffs.Aspect },
                { "Aspect of the Beast", () => playerReader.Buffs.Aspect },
                { "Aspect of the Hawk", () => playerReader.Buffs.Aspect },
                { "Aspect of the Wild", () => playerReader.Buffs.Aspect },
                { "Aspect of the Monkey", () => playerReader.Buffs.Aspect },
                { "Rapid Fire", () => playerReader.Buffs.RapidFire },
                { "Quick Shots", () => playerReader.Buffs.QuickShots },

                // Debuff Section
                // Druid Debuff
                { "Demoralizing Roar", () => playerReader.TargetDebuffs.Roar },
                { "Faerie Fire", () => playerReader.TargetDebuffs.FaerieFire },
                { "Rip", () => playerReader.TargetDebuffs.Rip },
                { "Moonfire", () => playerReader.TargetDebuffs.Moonfire },
                { "Entangling Roots", () => playerReader.TargetDebuffs.EntanglingRoots },
                { "Rake", () => playerReader.TargetDebuffs.Rake },

                // Warrior Debuff
                { "Rend", () => playerReader.TargetDebuffs.Rend },

                // Priest Debuff
                { "Shadow Word: Pain", () => playerReader.TargetDebuffs.ShadowWordPain },

                // Mage Debuff
                { "Frostbite", () => playerReader.TargetDebuffs.Frostbite },
                { "Slow", () => playerReader.TargetDebuffs.Slow },

                // Warlock Debuff
                { "Curse of Weakness", () => playerReader.TargetDebuffs.Curseof },
                { "Curse of Elements", () => playerReader.TargetDebuffs.Curseof },
                { "Curse of Recklessness", () => playerReader.TargetDebuffs.Curseof },
                { "Curse of Shadow", () => playerReader.TargetDebuffs.Curseof },
                { "Curse of Agony", () => playerReader.TargetDebuffs.Curseof },
                { "Curse of", () => playerReader.TargetDebuffs.Curseof },
                { "Corruption", () => playerReader.TargetDebuffs.Corruption },
                { "Immolate", () => playerReader.TargetDebuffs.Immolate },
                { "Siphon Life", () => playerReader.TargetDebuffs.SiphonLife },

                // Hunter Debuff
                { "Serpent Sting", () => playerReader.TargetDebuffs.SerpentSting },
            };

            valueDictionary = new Dictionary <string, Func <int> >
            {
                { "Health%", () => playerReader.HealthPercent },
                { "TargetHealth%", () => playerReader.TargetHealthPercentage },
                { "PetHealth%", () => playerReader.PetHealthPercentage },
                { "Mana%", () => playerReader.ManaPercentage },
                { "BagCount", () => bagReader.BagItems.Count },
                { "MobCount", () => addonReader.CombatCreatureCount },
                { "MinRange", () => playerReader.MinRange },
                { "MaxRange", () => playerReader.MaxRange },
                { "LastAutoShotMs", () => playerReader.AutoShot.ElapsedMs },
                { "LastMainHandMs", () => playerReader.MainHandSwing.ElapsedMs }
            };
        }