bool Guardian::UpdateStats(Stats stat) { // value = ((base_value * base_pct) + total_value) * total_pct float value = GetTotalStatValue(stat); ApplyStatBuffMod(stat, m_statFromOwner[stat], false); float ownersBonus = 0.0f; Unit* owner = GetOwner(); // Handle Death Knight Glyphs and Talents float mod = 0.75f; if (IsPetGhoul() && (stat == STAT_STAMINA || stat == STAT_STRENGTH)) { if (stat == STAT_STAMINA) mod = 0.3f; // Default Owner's Stamina scale else mod = 0.7f; // Default Owner's Strength scale ownersBonus = float(owner->GetStat(stat)) * mod; value += ownersBonus; } else if (stat == STAT_STAMINA) { ownersBonus = CalculatePct(owner->GetStat(STAT_STAMINA), 30); value += ownersBonus; } //warlock's and mage's pets gain 30% of owner's intellect else if (stat == STAT_INTELLECT) { if (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE) { ownersBonus = CalculatePct(owner->GetStat(stat), 30); value += ownersBonus; } } /* else if (stat == STAT_STRENGTH) { if (IsPetGhoul()) value += float(owner->GetStat(stat)) * 0.3f; } */ SetStat(stat, int32(value)); m_statFromOwner[stat] = ownersBonus; ApplyStatBuffMod(stat, m_statFromOwner[stat], true); switch (stat) { case STAT_STRENGTH: UpdateAttackPowerAndDamage(); break; case STAT_AGILITY: UpdateArmor(); break; case STAT_STAMINA: UpdateMaxHealth(); break; case STAT_INTELLECT: UpdateMaxPower(POWER_MANA); break; default: break; } return true; }
bool Guardian::UpdateStats(Stats stat) { if (stat >= MAX_STATS) return false; // value = ((base_value * base_pct) + total_value) * total_pct float value = GetTotalStatValue(stat); ApplyStatBuffMod(stat, m_statFromOwner[stat], false); float ownersBonus = 0.0f; Unit *owner = GetOwner(); if (stat == STAT_STAMINA) { if (owner->getClass() == CLASS_WARLOCK && isPet() || isHunterPet()) { // TOTAL_PCT should be applied after ownersBonus UnitMods unitMod = UnitMods(UNIT_MOD_STAT_START + stat); value *= (1.0f / m_auraModifiersGroup[unitMod][TOTAL_PCT]) ; ownersBonus = CalculatePct(owner->GetStat(stat), 30); value += ownersBonus; value *= m_auraModifiersGroup[unitMod][TOTAL_PCT]; } } else if (stat == STAT_INTELLECT) { // Warlock and Mage pets gain 30% of owners intellect if (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE) { // TOTAL_PCT should be applied after ownersBonus UnitMods unitMod = UnitMods(UNIT_MOD_STAT_START + stat); value *= (1.0f / m_auraModifiersGroup[unitMod][TOTAL_PCT]) ; ownersBonus = CalculatePct(owner->GetStat(stat), 30); value += ownersBonus; value *= m_auraModifiersGroup[unitMod][TOTAL_PCT]; } } SetStat(stat, int32(value)); m_statFromOwner[stat] = ownersBonus; ApplyStatBuffMod(stat, m_statFromOwner[stat], true); switch (stat) { case STAT_STRENGTH: UpdateAttackPowerAndDamage(); break; case STAT_AGILITY: UpdateArmor(); break; case STAT_STAMINA: UpdateMaxHealth(); break; case STAT_INTELLECT: UpdateMaxPower(POWER_MANA); break; case STAT_SPIRIT: default: break; } return true; }
bool Pet::UpdateStats(Stats stat) { if (stat > STAT_SPIRIT) return false; // value = ((base_value * base_pct) + total_value) * total_pct float value = GetTotalStatValue(stat); Unit* owner = GetOwner(); // chained, use original owner instead if (owner && owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->GetEntry() == GetEntry()) { if (Unit* creator = GetCreator()) owner = creator; } if (stat == STAT_STAMINA) { if(owner && owner->GetTypeId() == TYPEID_PLAYER && owner->getClass() == CLASS_WARLOCK) value += float(owner->GetStat(stat)) * 0.75f; else if (owner) value += float(owner->GetStat(stat)) * 0.3f; } // warlock's and mage's pets gain 30% of owner's intellect else if (stat == STAT_INTELLECT && getPetType() == SUMMON_PET) { if (owner && (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE)) value += float(owner->GetStat(stat)) * 0.3f; } // deathknight's ghoul gain 100% of owner's strength else if (stat == STAT_STRENGTH && getPetType() == SUMMON_PET) { if (owner && (owner->getClass() == CLASS_DEATH_KNIGHT)) { value += float(owner->GetStat(stat)) * 1.0f; } } SetStat(stat, int32(value)); switch (stat) { case STAT_STRENGTH: UpdateAttackPowerAndDamage(); break; case STAT_AGILITY: UpdateArmor(); break; case STAT_STAMINA: UpdateMaxHealth(); break; case STAT_INTELLECT: UpdateMaxPower(POWER_MANA); break; case STAT_SPIRIT: default: break; } return true; }
bool Pet::UpdateStats(Stats stat) { if(stat > STAT_SPIRIT) return false; // value = ((base_value * base_pct) + total_value) * total_pct float value = GetTotalStatValue(stat); Unit *owner = GetOwner(); if ( stat == STAT_STAMINA ) { if(owner) { float scale_coeff = 0.3f; switch (owner->getClass()) { case CLASS_HUNTER: scale_coeff = 0.45f; break; case CLASS_WARLOCK: scale_coeff = 0.75f; break; } value += float(owner->GetStat(stat)) * scale_coeff; } } //warlock's and mage's pets gain 30% of owner's intellect else if ( stat == STAT_INTELLECT && getPetType() == SUMMON_PET ) { if(owner && (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE) ) value += float(owner->GetStat(stat)) * 0.3f; } SetStat(stat, int32(value)); switch(stat) { case STAT_STRENGTH: UpdateAttackPowerAndDamage(); break; case STAT_AGILITY: UpdateArmor(); break; case STAT_STAMINA: UpdateMaxHealth(); break; case STAT_INTELLECT: UpdateMaxPower(POWER_MANA); break; case STAT_SPIRIT: default: break; } return true; }
bool Pet::UpdateStats(Stats stat) { if(stat > STAT_SPIRIT) return false; // value = ((base_value * base_pct) + total_value) * total_pct float value = GetTotalStatValue(stat); Unit *owner = GetOwner(); if (owner) { switch(stat) { case STAT_STAMINA: // warlock's pets gain 75% of owner's stamina if (getPetType() == SUMMON_PET && owner->getClass() == CLASS_WARLOCK) value += owner->GetStat(stat) * 0.75f; else { if (getPetType() == SUMMON_PET || getPetType() == HUNTER_PET || owner->getClass() == CLASS_DEATH_KNIGHT) value += owner->GetStat(stat) * 0.3f; } break; case STAT_INTELLECT: // warlock's and mage's pets gain 30% of owner's intellect if (getPetType() == SUMMON_PET && (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE)) value += owner->GetStat(stat) * 0.3f; break; }; } SetStat(stat, int32(value)); switch(stat) { case STAT_STRENGTH: UpdateAttackPowerAndDamage(); break; case STAT_AGILITY: UpdateArmor(); break; case STAT_STAMINA: UpdateMaxHealth(); break; case STAT_INTELLECT: UpdateMaxPower(POWER_MANA); break; case STAT_SPIRIT: default: break; } return true; }
bool Guardian::UpdateStats(Stats stat) { if (stat > STAT_SPIRIT) return false; // value = ((base_value * base_pct) + total_value) * total_pct float value = GetTotalStatValue(stat); Unit* owner = GetOwner(); if (stat == STAT_STAMINA) { if (owner && (IsHunterPet() || owner->getClass() == CLASS_WARLOCK)) value += float(owner->GetStat(stat)) * 0.3f; } //warlock's and mage's pets gain 30% of owner's intellect else if (stat == STAT_INTELLECT && IsPet()) { if (owner && (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE)) value += float(owner->GetStat(stat)) * 0.3f; } SetStat(stat, int32(value)); switch (stat) { case STAT_STRENGTH: UpdateAttackPowerAndDamage(); break; case STAT_AGILITY: UpdateArmor(); break; case STAT_STAMINA: UpdateMaxHealth(); break; case STAT_INTELLECT: UpdateMaxPower(POWER_MANA); break; case STAT_SPIRIT: default: break; } return true; }
SPELL_EFFECT_OVERRIDE_RETURNS AH_16191( Aura *aur, bool apply, uint8 i ) { if( apply == true && aur->GetSpellProto()->eff[i].EffectApplyAuraName == SPELL_AURA_MOD_STAT ) { Unit *c = aur->GetUnitCaster(); if( c ) { Unit *owner = c->GetTopOwner(); aur->mod->m_amount = aur->GetSpellProto()->eff[i].EffectBasePoints * owner->GetStat( STAT_SPIRIT ) / 100; //my max health should be owner's max health uint32 MyMaxHealth = owner->GetMaxHealth() * 10 / 100; if(c->GetMaxHealth() < MyMaxHealth ) { c->SetMaxHealth( MyMaxHealth ); c->SetHealth( MyMaxHealth ); } } } return SPELL_EFFECT_OVERRIDE_CONTINUE_EXECUTION; }
bool Guardian::UpdateStats(Stats stat) { if (stat >= MAX_STATS) return false; // value = ((base_value * base_pct) + total_value) * total_pct float value = GetTotalStatValue(stat); ApplyStatBuffMod(stat, m_statFromOwner[stat], false); float ownersBonus = 0.0f; Unit* owner = GetOwner(); // Handle Death Knight Glyphs and Talents float mod = 0.75f; if (IsPetGhoul() && (stat == STAT_STAMINA || stat == STAT_STRENGTH)) { if (stat == STAT_STAMINA) mod = 0.3f; // Default Owner's Stamina scale else mod = 0.7f; // Default Owner's Strength scale // Check just if owner has Ravenous Dead since it's effect is not an aura AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0); if (aurEff) { SpellInfo const* spellInfo = aurEff->GetSpellInfo(); // Then get the SpellProto and add the dummy effect value AddPct(mod, spellInfo->Effects[EFFECT_1].CalcValue(owner)); // Ravenous Dead edits the original scale } // Glyph of the Ghoul aurEff = owner->GetAuraEffect(58686, 0); if (aurEff) mod += CalculatePct(1.0f, aurEff->GetAmount()); // Glyph of the Ghoul adds a flat value to the scale mod ownersBonus = float(owner->GetStat(stat)) * mod; value += ownersBonus; } else if (stat == STAT_STAMINA) { ownersBonus = CalculatePct(owner->GetStat(STAT_STAMINA), 30); value += ownersBonus; } //warlock's and mage's pets gain 30% of owner's intellect else if (stat == STAT_INTELLECT) { if (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE) { ownersBonus = CalculatePct(owner->GetStat(stat), 30); value += ownersBonus; } } /* else if (stat == STAT_STRENGTH) { if (IsPetGhoul()) value += float(owner->GetStat(stat)) * 0.3f; } */ SetStat(stat, int32(value)); m_statFromOwner[stat] = ownersBonus; ApplyStatBuffMod(stat, m_statFromOwner[stat], true); switch (stat) { case STAT_STRENGTH: UpdateAttackPowerAndDamage(); break; case STAT_AGILITY: UpdateArmor(); break; case STAT_STAMINA: UpdateMaxHealth(); break; case STAT_INTELLECT: UpdateMaxPower(POWER_MANA); break; case STAT_SPIRIT: default: break; } return true; }
bool Pet::UpdateStats(Stats stat) { if(stat > STAT_SPIRIT) return false; // value = ((base_value * base_pct) + total_value) * total_pct float value = GetTotalStatValue(stat); Unit *owner = GetOwner(); if ( stat == STAT_STAMINA ) { if(owner) { float scale_coeff = 0.3f; switch (owner->getClass()) { case CLASS_HUNTER: scale_coeff = 0.4493f; break; case CLASS_WARLOCK: { CreatureInfo const *cinfo = GetCreatureInfo(); CreatureFamily petFamily = (CreatureFamily) cinfo->family; switch (petFamily) { case CREATURE_FAMILY_FELHUNTER: value += float(owner->GetStat(stat)) * 0.7125f; break; case CREATURE_FAMILY_VOIDWALKER: value += float(owner->GetStat(stat)) * 0.825f; break; case CREATURE_FAMILY_FELGUARD: value += float(owner->GetStat(stat)) * 0.825f; break; case CREATURE_FAMILY_SUCCUBUS: value += float(owner->GetStat(stat)) * 0.6825f; break; case CREATURE_FAMILY_IMP: value += float(owner->GetStat(stat)) * 0.63f; break; default: value += float(owner->GetStat(stat)) * 0.3f; break; } break; } case CLASS_DEATH_KNIGHT: scale_coeff = 0.3928f; break; } value += float(owner->GetStat(stat)) * scale_coeff; } } //warlock's and mage's pets gain 30% of owner's intellect else if ( stat == STAT_INTELLECT && getPetType() == SUMMON_PET ) { if(owner && (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE) ) value += float(owner->GetStat(stat)) * 0.3f; } SetStat(stat, int32(value)); switch(stat) { case STAT_STRENGTH: UpdateAttackPowerAndDamage(); break; case STAT_AGILITY: UpdateArmor(); break; case STAT_STAMINA: UpdateMaxHealth(); break; case STAT_INTELLECT: UpdateMaxPower(POWER_MANA); break; case STAT_SPIRIT: default: break; } return true; }
bool Guardian::UpdateStats(Stats stat) { if (stat >= MAX_STATS) return false; // value = ((base_value * base_pct) + total_value) * total_pct float value = GetTotalStatValue(stat); ApplyStatBuffMod(stat, m_statFromOwner[stat], false); float ownersBonus = 0.0f; Unit *owner = GetOwner(); // Handle Death Knight Glyphs and Talents float mod = 0.75f; if (IsPetGhoul() && (stat == STAT_STAMINA || stat == STAT_STRENGTH)) { switch (stat) { case STAT_STAMINA: mod = 0.3f; break; // Default Owner's Stamina scale case STAT_STRENGTH: mod = 0.7f; break; // Default Owner's Strength scale default: break; } // Ravenous Dead AuraEffect const *aurEff = NULL; // Check just if owner has Ravenous Dead since it's effect is not an aura aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0); if (aurEff) { SpellEntry const* sProto = aurEff->GetSpellProto(); // Then get the SpellProto and add the dummy effect value mod += mod * (SpellMgr::CalculateSpellEffectAmount(sProto, 1) / 100.0f); // Ravenous Dead edits the original scale } // Glyph of the Ghoul aurEff = owner->GetAuraEffect(58686, 0); if (aurEff) mod += (aurEff->GetAmount() / 100.0f); // Glyph of the Ghoul adds a flat value to the scale mod ownersBonus = float(owner->GetStat(stat)) * mod; value += ownersBonus; } else if (stat == STAT_STAMINA) { if (owner->getClass() == CLASS_WARLOCK && isPet()) { ownersBonus = float(owner->GetStat(STAT_STAMINA)) * 0.75f; value += ownersBonus; } else { mod = 0.45f; if (isPet()) { switch(ToPet()->GetTalentType()) { case PET_TALENT_TYPE_NOT_HUNTER_PET: break; case PET_TALENT_TYPE_FEROCITY: mod = 0.67f; break; case PET_TALENT_TYPE_TENACITY: mod = 0.78f; break; case PET_TALENT_TYPE_CUNNING: mod = 0.725f; break; } PetSpellMap::const_iterator itr = (ToPet()->m_spells.find(62758)); // Wild Hunt rank 1 if (itr == ToPet()->m_spells.end()) itr = ToPet()->m_spells.find(62762); // Wild Hunt rank 2 if (itr != ToPet()->m_spells.end()) // If pet has Wild Hunt { SpellEntry const* sProto = sSpellStore.LookupEntry(itr->first); // Then get the SpellProto and add the dummy effect value mod += mod * (SpellMgr::CalculateSpellEffectAmount(sProto, 0) / 100.0f); } } ownersBonus = float(owner->GetStat(stat)) * mod; value += ownersBonus; } } //warlock's and mage's pets gain 30% of owner's intellect else if (stat == STAT_INTELLECT) { if (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE) { ownersBonus = float(owner->GetStat(stat)) * 0.3f; value += ownersBonus; } } /* else if (stat == STAT_STRENGTH) { if (IsPetGhoul()) value += float(owner->GetStat(stat)) * 0.3f; } */ SetStat(stat, int32(value)); m_statFromOwner[stat] = ownersBonus; ApplyStatBuffMod(stat, m_statFromOwner[stat], true); switch (stat) { case STAT_STRENGTH: UpdateAttackPowerAndDamage(); break; case STAT_AGILITY: UpdateArmor(); break; case STAT_STAMINA: UpdateMaxHealth(); break; case STAT_INTELLECT: UpdateMaxPower(POWER_MANA); break; case STAT_SPIRIT: default: break; } return true; }
bool Guardian::UpdateStats(Stats stat) { if (stat >= MAX_STATS) return false; // value = ((base_value * base_pct) + total_value) * total_pct float value = GetTotalStatValue(stat); Unit *owner = GetOwner(); // Handle Death Knight Glyphs and Talents if (IsPetGhoul() && (stat == STAT_STAMINA || stat == STAT_STRENGTH)) { float mod = 0.0f; switch (stat) { case STAT_STAMINA: mod = 0.3f; break; // Default Owner's Stamina scale case STAT_STRENGTH: mod = 0.7f; break; // Default Owner's Strength scale default: break; } // Ravenous Dead AuraEffect const *aurEff; // Check just if owner has Ravenous Dead since it's effect is not an aura if (aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0)) { SpellEntry const* sProto = aurEff->GetSpellProto(); // Then get the SpellProto and add the dummy effect value mod += mod * (sProto->EffectBasePoints[1] / 100.0f); // Ravenous Dead edits the original scale } // Glyph of the Ghoul if (aurEff = owner->GetAuraEffect(58686, 0)) mod += (aurEff->GetAmount() / 100.0f); // Glyph of the Ghoul adds a flat value to the scale mod value += float(owner->GetStat(stat)) * mod; } else if (stat == STAT_STAMINA) { if (owner->getClass() == CLASS_WARLOCK && isPet()) value += float(owner->GetStat(STAT_STAMINA)) * 0.75f; else value += float(owner->GetStat(stat)) * 0.3f; } //warlock's and mage's pets gain 30% of owner's intellect else if (stat == STAT_INTELLECT) { if (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE) value += float(owner->GetStat(stat)) * 0.3f; } /* else if (stat == STAT_STRENGTH) { if (IsPetGhoul()) value += float(owner->GetStat(stat)) * 0.3f; } */ SetStat(stat, int32(value)); switch (stat) { case STAT_STRENGTH: UpdateAttackPowerAndDamage(); break; case STAT_AGILITY: UpdateArmor(); break; case STAT_STAMINA: UpdateMaxHealth(); break; case STAT_INTELLECT: UpdateMaxPower(POWER_MANA); break; case STAT_SPIRIT: default: break; } return true; }
bool Guardian::UpdateStats(Stats stat) { if (stat >= MAX_STATS) return false; // value = ((base_value * base_pct) + total_value) * total_pct float value = GetTotalStatValue(stat); ApplyStatBuffMod(stat, m_statFromOwner[stat], false); float ownersBonus = 0.0f; Unit *owner = GetOwner(); // Handle Death Knight Glyphs and Talents float mod = 0.75f; if (IsPetGhoul() && (stat == STAT_STAMINA || stat == STAT_STRENGTH)) { switch (stat) { case STAT_STAMINA: mod = 0.3f; break; // Default Owner's Stamina scale case STAT_STRENGTH: mod = 0.7f; break; // Default Owner's Strength scale default: break; } // Ravenous Dead AuraEffect const *aurEff = NULL; // Check just if owner has Ravenous Dead since it's effect is not an aura aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0); if (aurEff) { SpellInfo const* spellInfo = aurEff->GetSpellInfo(); // Then get the SpellProto and add the dummy effect value AddPctN(mod, spellInfo->Effects[EFFECT_1].CalcValue()); // Ravenous Dead edits the original scale } // Glyph of the Ghoul aurEff = owner->GetAuraEffect(58686, 0); if (aurEff) mod += CalculatePctN(1.0f, aurEff->GetAmount()); // Glyph of the Ghoul adds a flat value to the scale mod ownersBonus = float(owner->GetStat(stat)) * mod; // ownersBonus is multiplied by TOTAL_PCT too ownersBonus *= GetModifierValue(UNIT_MOD_STAT_STAMINA, TOTAL_PCT); value += ownersBonus; } else if (stat == STAT_STAMINA) { if (owner->getClass() == CLASS_WARLOCK && isPet()) { ownersBonus = CalculatePctN(owner->GetStat(STAT_STAMINA), 75); value += ownersBonus; } else { mod = 0.45f; if (isPet()) { PetSpellMap::const_iterator itr = (ToPet()->m_spells.find(62758)); // Wild Hunt rank 1 if (itr == ToPet()->m_spells.end()) itr = ToPet()->m_spells.find(62762); // Wild Hunt rank 2 if (itr != ToPet()->m_spells.end()) // If pet has Wild Hunt { SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value AddPctN(mod, spellInfo->Effects[EFFECT_0].CalcValue()); } } ownersBonus = float(owner->GetStat(stat)) * mod; value += ownersBonus; } } //warlock's and mage's pets gain 30% of owner's intellect else if (stat == STAT_INTELLECT) { if (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE) { ownersBonus = CalculatePctN(owner->GetStat(stat), 30); value += ownersBonus; } } /* else if (stat == STAT_STRENGTH) { if (IsPetGhoul()) value += float(owner->GetStat(stat)) * 0.3f; } */ SetStat(stat, int32(value)); m_statFromOwner[stat] = ownersBonus; ApplyStatBuffMod(stat, m_statFromOwner[stat], true); switch (stat) { case STAT_STRENGTH: UpdateAttackPowerAndDamage(); break; case STAT_AGILITY: UpdateArmor(); break; case STAT_STAMINA: UpdateMaxHealth(); break; case STAT_INTELLECT: UpdateMaxPower(POWER_MANA); break; case STAT_SPIRIT: default: break; } return true; }
bool Guardian::UpdateStats(Stats stat) { if (stat >= MAX_STATS) return false; // value = ((base_value * base_pct) + total_value) * total_pct float value = GetTotalStatValue(stat); ApplyStatBuffMod(stat, m_statFromOwner[stat], false); float ownersBonus = 0.0f; Unit* owner = GetOwner(); // Handle Death Knight Glyphs and Talents float mod = 0.75f; if (IsPetGhoul() && (stat == STAT_STAMINA || stat == STAT_STRENGTH)) { switch (stat) { case STAT_STAMINA: mod = 0.9f; break; // Default is 0.48 case STAT_STRENGTH: mod = 0.7f; break; // Default Owner's Strength scale default: break; } // Check just if owner has Ravenous Dead since it's effect is not an aura AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0); if (aurEff) { SpellInfo const* spellInfo = aurEff->GetSpellInfo(); // Then get the SpellProto and add the dummy effect value AddPct(mod, spellInfo->Effects[EFFECT_1].CalcValue(owner)); // Ravenous Dead edits the original scale } // Glyph of the Ghoul aurEff = owner->GetAuraEffect(58686, 0); if (aurEff) mod += CalculatePct(1.0f, aurEff->GetAmount()); // Glyph of the Ghoul adds a flat value to the scale mod ownersBonus = float(owner->GetStat(stat)) * mod; value += ownersBonus; } else if (stat == STAT_STAMINA) { int pct = 30; switch(owner->getClass()) { case CLASS_WARLOCK: pct = 75; break; case CLASS_DEATH_KNIGHT: // Ebon Gargoyle if(GetEntry() == 27829) { pct = 80; } break; case CLASS_MAGE: pct = 78; break; case CLASS_SHAMAN: pct = 78; break; case CLASS_HUNTER: pct = 67; // Looks for creature template if(CreatureTemplate const* cinfo = GetCreatureTemplate()) { // Checks the pet talent type CreatureFamilyEntry const* pet_family = sCreatureFamilyStore.LookupEntry(cinfo->family); if (pet_family) { switch(pet_family->petTalentType) { // Ferocity case 0: pct = 67; break; // Tenacity case 1: pct = 78; break; // Cunning case 2: pct = 73; break; } } } break; } ownersBonus = CalculatePct(owner->GetStat(STAT_STAMINA) - owner->GetCreateStat(STAT_STAMINA), pct); value += ownersBonus; } //warlock's and mage's pets gain 30% of owner's intellect else if (stat == STAT_INTELLECT) { if (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE) { ownersBonus = CalculatePct(owner->GetStat(stat), 30); value += ownersBonus; } } /* else if (stat == STAT_STRENGTH) { if (IsPetGhoul()) value += float(owner->GetStat(stat)) * 0.3f; } */ SetStat(stat, int32(value)); m_statFromOwner[stat] = ownersBonus; ApplyStatBuffMod(stat, m_statFromOwner[stat], true); switch (stat) { case STAT_STRENGTH: UpdateAttackPowerAndDamage(); break; case STAT_AGILITY: UpdateArmor(); break; case STAT_STAMINA: UpdateMaxHealth(); break; case STAT_INTELLECT: UpdateMaxPower(POWER_MANA); break; case STAT_SPIRIT: default: break; } return true; }
bool Guardian::UpdateStats(Stats stat) { if (stat >= MAX_STATS) return false; float value = GetTotalStatValue(stat); ApplyStatBuffMod(stat, m_statFromOwner[stat], false); float ownersBonus = 0.0f; Unit* owner = GetOwner(); // Handle Death Knight Glyphs and Talents float mod = 0.75f; switch (stat) { case STAT_STAMINA: { mod = 0.3f; if (IsPetGhoul() || IsPetGargoyle()) mod = 0.45f; else if (owner->getClass() == CLASS_WARLOCK && isPet()) mod = 0.75f; else if (owner->getClass() == CLASS_MAGE && isPet()) mod = 0.75f; else { mod = 0.45f; if (isPet()) { switch (ToPet()->GetSpecializationId()) { case SPEC_PET_FEROCITY: mod = 0.67f; break; case SPEC_PET_TENACITY: mod = 0.78f; break; case SPEC_PET_CUNNING: mod = 0.725f; break; } } } ownersBonus = float(owner->GetStat(stat)) * mod; ownersBonus *= GetModifierValue(UNIT_MOD_STAT_STAMINA, TOTAL_PCT); value += ownersBonus; break; } case STAT_STRENGTH: { mod = 0.7f; ownersBonus = owner->GetStat(stat) * mod; value += ownersBonus; break; } case STAT_INTELLECT: { if (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE) { mod = 0.3f; ownersBonus = owner->GetStat(stat) * mod; } else if (owner->getClass() == CLASS_DEATH_KNIGHT && GetEntry() == 31216) { mod = 0.3f; if (owner->GetSimulacrumTarget()) ownersBonus = owner->GetSimulacrumTarget()->GetStat(stat) * mod; else ownersBonus = owner->GetStat(stat) * mod; } value += ownersBonus; break; } default: break; } SetStat(stat, int32(value)); m_statFromOwner[stat] = ownersBonus; ApplyStatBuffMod(stat, m_statFromOwner[stat], true); switch (stat) { case STAT_STRENGTH: UpdateAttackPowerAndDamage(); break; case STAT_AGILITY: UpdateArmor(); break; case STAT_STAMINA: UpdateMaxHealth(); break; case STAT_INTELLECT: UpdateMaxPower(POWER_MANA); if (owner->getClass() == CLASS_MAGE) UpdateAttackPowerAndDamage(); break; case STAT_SPIRIT: default: break; } return true; }
bool Guardian::UpdateStats(Stats stat) { if (stat >= MAX_STATS) return false; // value = ((base_value * base_pct) + total_value) * total_pct float value = GetTotalStatValue(stat); ApplyStatBuffMod(stat, m_statFromOwner[stat], false); float ownersBonus = 0.0f; Unit* owner = GetOwner(); float mod = 0.75f; switch (stat) { case STAT_STRENGTH: { if (IsPetGhoul()) { mod = 0.7f; // Glyph of the Ghoul if (AuraEffect const* aurEff = owner->GetAuraEffect(58686, 0)) mod += CalculatePct(1.0f, aurEff->GetAmount()); ownersBonus = owner->GetStat(stat) * mod; value += ownersBonus; } break; } case STAT_STAMINA: { mod = 0.0f; if (IsPetGhoul() || IsPetGargoyle()) { // Glyph of the Ghoul if (AuraEffect const* aurEff = owner->GetAuraEffect(58686, 0)) mod += CalculatePct(1.0f, aurEff->GetAmount()); } ownersBonus = owner->GetStat(stat) * mod; ownersBonus *= GetModifierValue(UNIT_MOD_STAT_STAMINA, TOTAL_PCT); value += ownersBonus; break; } case STAT_INTELLECT: { if (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE) { mod = 0.3f; ownersBonus = owner->GetStat(stat) * mod; } else if (owner->getClass() == CLASS_DEATH_KNIGHT && GetEntry() == 31216) { mod = 0.3f; if (owner->getSimulacrumTarget()) ownersBonus = owner->getSimulacrumTarget()->GetStat(stat) * mod; else ownersBonus = owner->GetStat(stat) * mod; } value += ownersBonus; break; } } SetStat(stat, int32(value)); m_statFromOwner[stat] = ownersBonus; ApplyStatBuffMod(stat, m_statFromOwner[stat], true); switch (stat) { case STAT_STRENGTH: UpdateAttackPowerAndDamage(); break; case STAT_AGILITY: UpdateArmor(); break; case STAT_STAMINA: UpdateMaxHealth(); break; case STAT_INTELLECT: UpdateMaxPower(POWER_MANA); if (isPet() && (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE)) UpdateAttackPowerAndDamage(); break; case STAT_SPIRIT: default: break; } return true; }
bool Pet::UpdateStats(Stats stat) { if (stat > STAT_SPIRIT) return false; // value = ((base_value * base_pct) + total_value) * total_pct float value = GetTotalStatValue(stat); CreatureInfo const *cinfo = GetCreatureInfo(); Unit *owner = GetOwner(); // chained, use original owner instead if (owner && owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->GetEntry() == GetEntry()) if (Unit *creator = GetCreator()) owner = creator; if (owner && owner->GetTypeId() == TYPEID_PLAYER) { float scale_coeff = 0.0f; switch(stat) { case STAT_STRENGTH: { if (owner->getClass() == CLASS_DEATH_KNIGHT) { if (getPetType() == SUMMON_PET) { scale_coeff = 0.7f; // Ravenous Dead if (SpellEntry const* spell = ((Player*)owner)->GetKnownTalentRankById(1934)) scale_coeff *= 1.0f + spell->CalculateSimpleValue(EFFECT_INDEX_1) / 100.0f; // Glyph of Ghoul if (Aura *glyph = owner->GetDummyAura(58686)) scale_coeff += glyph->GetModifier()->m_amount / 100.0f; } } break; } case STAT_STAMINA: { scale_coeff = 0.3f; switch (owner->getClass()) { case CLASS_HUNTER: { scale_coeff = 0.45f; //Wild Hunt uint32 bonus_id = 0; if (HasSpell(62762)) bonus_id = 62762; else if (HasSpell(62758)) bonus_id = 62758; if (const SpellEntry *bonusProto = sSpellStore.LookupEntry(bonus_id)) scale_coeff *= 1 + bonusProto->CalculateSimpleValue(EFFECT_INDEX_0) / 100.0f; break; } case CLASS_WARLOCK: { scale_coeff = 0.75f; break; } case CLASS_DEATH_KNIGHT: { if (getPetType() == SUMMON_PET) { // Ravenous Dead if (owner->GetTypeId() == TYPEID_PLAYER) if (SpellEntry const* spell = ((Player*)owner)->GetKnownTalentRankById(1934)) scale_coeff *= 1.0f + spell->CalculateSimpleValue(EFFECT_INDEX_1) / 100.0f; // Glyph of Ghoul if (Aura *glyph = owner->GetDummyAura(58686)) scale_coeff += glyph->GetModifier()->m_amount / 100.0f; } break; } case CLASS_DRUID: { //For treants, use 70% of stamina / 3 treants, guessed scale_coeff = 0.7f / 3.0f; break; } } break; } case STAT_INTELLECT: { //warlock's and mage's pets gain 30% of owner's intellect if (getPetType() == SUMMON_PET) { if (owner && (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE) ) scale_coeff = 0.3f; } break; } } value += float(owner->GetStat(stat)) * scale_coeff; } SetStat(stat, int32(value)); switch(stat) { case STAT_STRENGTH: UpdateAttackPowerAndDamage(); break; case STAT_AGILITY: UpdateArmor(); break; case STAT_STAMINA: UpdateMaxHealth(); break; case STAT_INTELLECT: UpdateMaxPower(POWER_MANA); break; case STAT_SPIRIT: default: break; } return true; }