Exemplo n.º 1
0
        internal void ModPetStatsPerLevel(PetLevelStatInfo levelStatInfo)
        {
            BaseHealth = levelStatInfo.Health;
            if (PowerType == PowerType.Mana && levelStatInfo.Mana > 0)
            {
                BasePower = levelStatInfo.Mana;
            }

            for (StatType stat = 0; stat < StatType.End; stat++)
            {
                SetBaseStat(stat, levelStatInfo.BaseStats[(int)stat]);
            }

            this.UpdatePetResistance(DamageSchool.Physical);
            SetInt32(UnitFields.HEALTH, MaxHealth);
        }
Exemplo n.º 2
0
        internal static void UpdatePetResistance(this NPC pet, DamageSchool school)
        {
            int num;

            if (school == DamageSchool.Physical)
            {
                num = (pet.Armor * PetMgr.PetArmorOfOwnerPercent + 50) / 100;
                PetLevelStatInfo petLevelStatInfo = pet.Entry.GetPetLevelStatInfo(pet.Level);
                if (petLevelStatInfo != null)
                {
                    num += petLevelStatInfo.Armor;
                }
            }
            else
            {
                num = (pet.GetResistance(school) * PetMgr.PetResistanceOfOwnerPercent + 50) / 100;
            }

            pet.SetBaseResistance(school, num);
        }