diff options
| author | Spp <spp@jorge.gr> | 2012-10-02 12:17:42 +0200 |
|---|---|---|
| committer | Spp <spp@jorge.gr> | 2012-10-02 12:17:42 +0200 |
| commit | 380db44583df7abdafb2dfa18d89017dae88d39b (patch) | |
| tree | f0176dee356aa1e75d54cf67f540560043155dc5 /src/server/game/Spells | |
| parent | f8846cdeaf1b0f104a986f227ed407359b46110f (diff) | |
Core/Utilities: Use generic templates with AddPct, ApplyPct and CalculatePct
Diffstat (limited to 'src/server/game/Spells')
| -rwxr-xr-x | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 36 | ||||
| -rwxr-xr-x | src/server/game/Spells/Auras/SpellAuras.cpp | 6 | ||||
| -rwxr-xr-x | src/server/game/Spells/Spell.cpp | 6 | ||||
| -rwxr-xr-x | src/server/game/Spells/SpellEffects.cpp | 64 | ||||
| -rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 6 |
5 files changed, 59 insertions, 59 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index f28a02a52fc..297b4df97c4 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -474,7 +474,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) // Glyph of Fear, Glyph of Frost nova and similar auras if ((*itr)->GetMiscValue() == 7801) { - AddPctN(amount, (*itr)->GetAmount()); + AddPct(amount, (*itr)->GetAmount()); break; } } @@ -527,7 +527,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) // Borrowed Time if (AuraEffect const* pAurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 2899, 1)) - bonus += CalculatePctN(1.0f, pAurEff->GetAmount()); + bonus += CalculatePct(1.0f, pAurEff->GetAmount()); DoneActualBenefit += caster->SpellBaseHealingBonusDone(m_spellInfo->GetSchoolMask()) * bonus; // Improved PW: Shield: its weird having a SPELLMOD_ALL_EFFECTS here but its blizzards doing :) @@ -539,7 +539,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) // Twin Disciplines if (AuraEffect const* pAurEff = caster->GetAuraEffect(SPELL_AURA_ADD_PCT_MODIFIER, SPELLFAMILY_PRIEST, 0x400000, 0, 0, caster->GetGUID())) - AddPctN(amount, pAurEff->GetAmount()); + AddPct(amount, pAurEff->GetAmount()); // Focused Power // Reuse variable, not sure if this code below can be moved before Twin Disciplines @@ -569,7 +569,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) if (!pAurEff) pAurEff = caster->GetAuraEffect(74411, 0); // Battleground - Dampening if (pAurEff) - AddPctN(amount, pAurEff->GetAmount()); + AddPct(amount, pAurEff->GetAmount()); return amount; } @@ -635,7 +635,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) else if (AuraEffect const* aurEff = caster->GetAuraEffect(60774, EFFECT_0)) amount += cp * aurEff->GetAmount(); - amount += uint32(CalculatePctU(caster->GetTotalAttackPowerValue(BASE_ATTACK), cp)); + amount += uint32(CalculatePct(caster->GetTotalAttackPowerValue(BASE_ATTACK), cp)); } // Rend else if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_WARRIOR && GetSpellInfo()->SpellFamilyFlags[0] & 0x20) @@ -653,7 +653,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) if (m_spellInfo->GetRank() >= 9) { if (GetBase()->GetUnitOwner()->HasAuraState(AURA_STATE_HEALTH_ABOVE_75_PERCENT, m_spellInfo, caster)) - AddPctN(amount, m_spellInfo->Effects[EFFECT_2].CalcValue(caster)); + AddPct(amount, m_spellInfo->Effects[EFFECT_2].CalcValue(caster)); } } // Unholy Blight damage over time effect @@ -674,10 +674,10 @@ int32 AuraEffect::CalculateAmount(Unit* caster) amount = GetBase()->GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.0025f; break; case 29166: // Innervate - ApplyPctF(amount, float(GetBase()->GetUnitOwner()->GetCreatePowers(POWER_MANA)) / GetTotalTicks()); + ApplyPct(amount, float(GetBase()->GetUnitOwner()->GetCreatePowers(POWER_MANA)) / GetTotalTicks()); break; case 48391: // Owlkin Frenzy - ApplyPctU(amount, GetBase()->GetUnitOwner()->GetCreatePowers(POWER_MANA)); + ApplyPct(amount, GetBase()->GetUnitOwner()->GetCreatePowers(POWER_MANA)); break; default: break; @@ -692,7 +692,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) if (caster->GetTypeId() == TYPEID_PLAYER) // Bonus from Glyph of Lightwell if (AuraEffect* modHealing = caster->GetAuraEffect(55673, 0)) - AddPctN(amount, modHealing->GetAmount()); + AddPct(amount, modHealing->GetAmount()); } break; case SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN: @@ -4745,7 +4745,7 @@ void AuraEffect::HandleModPowerCostPCT(AuraApplication const* aurApp, uint8 mode Unit* target = aurApp->GetTarget(); - float amount = CalculatePctN(1.0f, GetAmount()); + float amount = CalculatePct(1.0f, GetAmount()); for (int i = 0; i < MAX_SPELL_SCHOOL; ++i) if (GetMiscValue() & (1 << i)) target->ApplyModSignedFloatValue(UNIT_FIELD_POWER_COST_MULTIPLIER + i, amount, apply); @@ -6399,25 +6399,25 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const // Tenacity increase healing % taken if (AuraEffect const* Tenacity = target->GetAuraEffect(58549, 0)) - AddPctN(TakenTotalMod, Tenacity->GetAmount()); + AddPct(TakenTotalMod, Tenacity->GetAmount()); // Healing taken percent float minval = (float)target->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT); if (minval) - AddPctF(TakenTotalMod, minval); + AddPct(TakenTotalMod, minval); float maxval = (float)target->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT); if (maxval) - AddPctF(TakenTotalMod, maxval); + AddPct(TakenTotalMod, maxval); // Healing over time taken percent float minval_hot = (float)target->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HOT_PCT); if (minval_hot) - AddPctF(TakenTotalMod, minval_hot); + AddPct(TakenTotalMod, minval_hot); float maxval_hot = (float)target->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HOT_PCT); if (maxval_hot) - AddPctF(TakenTotalMod, maxval_hot); + AddPct(TakenTotalMod, maxval_hot); TakenTotalMod = std::max(TakenTotalMod, 0.0f); @@ -6510,8 +6510,8 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con if (m_spellInfo->ManaCostPercentage) { // max value - int32 maxmana = CalculatePctF(caster->GetMaxPower(powerType), drainAmount * 2.0f); - ApplyPctU(drainAmount, target->GetMaxPower(powerType)); + int32 maxmana = CalculatePct(caster->GetMaxPower(powerType), drainAmount * 2.0f); + ApplyPct(drainAmount, target->GetMaxPower(powerType)); if (drainAmount > maxmana) drainAmount = maxmana; } @@ -6548,7 +6548,7 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con // Mana Feed - Drain Mana if (manaFeedVal > 0) { - int32 feedAmount = CalculatePctN(gainedAmount, manaFeedVal); + int32 feedAmount = CalculatePct(gainedAmount, manaFeedVal); caster->CastCustomSpell(caster, 32554, &feedAmount, NULL, NULL, true, NULL, this); } } diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 4060ee42206..9c08ebae5ac 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1215,7 +1215,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b uint32 damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), GetEffect(0)->GetAmount(), DOT); damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT); int32 basepoints0 = aurEff->GetAmount() * GetEffect(0)->GetTotalTicks() * int32(damage) / 100; - int32 heal = int32(CalculatePctN(basepoints0, 15)); + int32 heal = int32(CalculatePct(basepoints0, 15)); caster->CastCustomSpell(target, 63675, &basepoints0, NULL, NULL, true, NULL, GetEffect(0)); caster->CastCustomSpell(caster, 75999, &heal, NULL, NULL, true, NULL, GetEffect(0)); @@ -1433,7 +1433,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b else if (aurEff->GetId() == 47537) multiplier += 0.5f; - int32 basepoints0 = int32(CalculatePctF(caster->GetMaxPower(POWER_MANA), multiplier)); + int32 basepoints0 = int32(CalculatePct(caster->GetMaxPower(POWER_MANA), multiplier)); caster->CastCustomSpell(caster, 47755, &basepoints0, NULL, NULL, true); } // effect on aura target @@ -1447,7 +1447,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b { case POWER_MANA: { - int32 basepoints0 = int32(CalculatePctN(target->GetMaxPower(POWER_MANA), 2)); + int32 basepoints0 = int32(CalculatePct(target->GetMaxPower(POWER_MANA), 2)); caster->CastCustomSpell(target, 63654, &basepoints0, NULL, NULL, true); break; } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 6b51f240b28..0564aa50273 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -6365,7 +6365,7 @@ void Spell::Delayed() // only called in DealDamage() if (delayReduce >= 100) return; - AddPctN(delaytime, -delayReduce); + AddPct(delaytime, -delayReduce); if (m_timer + delaytime > m_casttime) { @@ -6393,14 +6393,14 @@ void Spell::DelayedChannel() return; //check pushback reduce - int32 delaytime = CalculatePctN(m_spellInfo->GetDuration(), 25); // channeling delay is normally 25% of its time per hit + int32 delaytime = CalculatePct(m_spellInfo->GetDuration(), 25); // channeling delay is normally 25% of its time per hit int32 delayReduce = 100; // must be initialized to 100 for percent modifiers m_caster->ToPlayer()->ApplySpellMod(m_spellInfo->Id, SPELLMOD_NOT_LOSE_CASTING_TIME, delayReduce, this); delayReduce += m_caster->GetTotalAuraModifier(SPELL_AURA_REDUCE_PUSHBACK) - 100; if (delayReduce >= 100) return; - AddPctN(delaytime, -delayReduce); + AddPct(delaytime, -delayReduce); if (m_timer <= delaytime) { diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index dcbd1888b03..cbc478078e5 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -377,13 +377,13 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) } // Victory Rush else if (m_spellInfo->SpellFamilyFlags[1] & 0x100) - ApplyPctF(damage, m_caster->GetTotalAttackPowerValue(BASE_ATTACK)); + ApplyPct(damage, m_caster->GetTotalAttackPowerValue(BASE_ATTACK)); // Shockwave else if (m_spellInfo->Id == 46968) { int32 pct = m_caster->CalculateSpellDamage(unitTarget, m_spellInfo, 2); if (pct > 0) - damage += int32(CalculatePctN(m_caster->GetTotalAttackPowerValue(BASE_ATTACK), pct)); + damage += int32(CalculatePct(m_caster->GetTotalAttackPowerValue(BASE_ATTACK), pct)); break; } break; @@ -434,10 +434,10 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) pdamage = unitTarget->SpellDamageBonusTaken(m_caster, aura->GetSpellInfo(), pdamage, DOT, aura->GetBase()->GetStackAmount()); uint32 pct_dir = m_caster->CalculateSpellDamage(unitTarget, m_spellInfo, (effIndex + 1)); uint8 baseTotalTicks = uint8(m_caster->CalcSpellDuration(aura->GetSpellInfo()) / aura->GetSpellInfo()->Effects[EFFECT_0].Amplitude); - damage += int32(CalculatePctU(pdamage * baseTotalTicks, pct_dir)); + damage += int32(CalculatePct(pdamage * baseTotalTicks, pct_dir)); uint32 pct_dot = m_caster->CalculateSpellDamage(unitTarget, m_spellInfo, (effIndex + 2)) / 3; - m_spellValue->EffectBasePoints[1] = m_spellInfo->Effects[EFFECT_1].CalcBaseValue(int32(CalculatePctU(pdamage * baseTotalTicks, pct_dot))); + m_spellValue->EffectBasePoints[1] = m_spellInfo->Effects[EFFECT_1].CalcBaseValue(int32(CalculatePct(pdamage * baseTotalTicks, pct_dot))); apply_direct_bonus = false; // Glyph of Conflagrate @@ -495,7 +495,7 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) float multiple = ap / 410 + m_spellInfo->Effects[effIndex].DamageMultiplier; int32 energy = -(m_caster->ModifyPower(POWER_ENERGY, -30)); damage += int32(energy * multiple); - damage += int32(CalculatePctN(m_caster->ToPlayer()->GetComboPoints() * ap, 7)); + damage += int32(CalculatePct(m_caster->ToPlayer()->GetComboPoints() * ap, 7)); } // Wrath else if (m_spellInfo->SpellFamilyFlags[0] & 0x00000001) @@ -503,7 +503,7 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) // Improved Insect Swarm if (AuraEffect const* aurEff = m_caster->GetDummyAuraEffect(SPELLFAMILY_DRUID, 1771, 0)) if (unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x00200000, 0, 0)) - AddPctN(damage, aurEff->GetAmount()); + AddPct(damage, aurEff->GetAmount()); } break; } @@ -636,7 +636,7 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) { uint8 level = m_caster->getLevel(); uint32 block_value = m_caster->GetShieldBlockValue(uint32(float(level) * 29.5f), uint32(float(level) * 39.5f)); - damage += CalculatePctN(block_value, m_spellInfo->Effects[EFFECT_1].CalcValue()); + damage += CalculatePct(block_value, m_spellInfo->Effects[EFFECT_1].CalcValue()); break; } break; @@ -1436,8 +1436,8 @@ void Spell::EffectPowerBurn(SpellEffIndex effIndex) // burn x% of target's mana, up to maximum of 2x% of caster's mana (Mana Burn) if (m_spellInfo->Id == 8129) { - int32 maxDamage = int32(CalculatePctN(m_caster->GetMaxPower(powerType), damage * 2)); - damage = int32(CalculatePctN(unitTarget->GetMaxPower(powerType), damage)); + int32 maxDamage = int32(CalculatePct(m_caster->GetMaxPower(powerType), damage * 2)); + damage = int32(CalculatePct(unitTarget->GetMaxPower(powerType), damage)); damage = std::min(damage, maxDamage); } @@ -1493,7 +1493,7 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/) { if (Player* player = m_caster->ToPlayer()) if (player->HasSkill(SKILL_ENGINEERING)) - AddPctN(addhealth, 25); + AddPct(addhealth, 25); } // Swiftmend - consumes Regrowth or Rejuvenation else if (m_spellInfo->TargetAuraState == AURA_STATE_SWIFTMEND && unitTarget->HasAuraState(AURA_STATE_SWIFTMEND, m_spellInfo, m_caster)) @@ -1552,7 +1552,7 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/) for (Unit::AuraEffectList::const_iterator i = Periodic.begin(); i != Periodic.end(); ++i) { if (m_caster->GetGUID() == (*i)->GetCasterGUID()) - AddPctN(addhealth, aurEff->GetAmount()); + AddPct(addhealth, aurEff->GetAmount()); } } } @@ -1876,20 +1876,20 @@ void Spell::EffectEnergize(SpellEffIndex effIndex) case 31930: // Judgements of the Wise case 63375: // Improved Stormstrike case 68082: // Glyph of Seal of Command - damage = int32(CalculatePctN(unitTarget->GetCreateMana(), damage)); + damage = int32(CalculatePct(unitTarget->GetCreateMana(), damage)); break; case 48542: // Revitalize - damage = int32(CalculatePctN(unitTarget->GetMaxPower(power), damage)); + damage = int32(CalculatePct(unitTarget->GetMaxPower(power), damage)); break; case 67490: // Runic Mana Injector (mana gain increased by 25% for engineers - 3.2.0 patch change) { if (Player* player = m_caster->ToPlayer()) if (player->HasSkill(SKILL_ENGINEERING)) - AddPctN(damage, 25); + AddPct(damage, 25); break; } case 71132: // Glyph of Shadow Word: Pain - damage = int32(CalculatePctN(unitTarget->GetCreateMana(), 1)); // set 1 as value, missing in dbc + damage = int32(CalculatePct(unitTarget->GetCreateMana(), 1)); // set 1 as value, missing in dbc break; default: break; @@ -1972,7 +1972,7 @@ void Spell::EffectEnergizePct(SpellEffIndex effIndex) if (maxPower == 0) return; - uint32 gain = CalculatePctN(maxPower, damage); + uint32 gain = CalculatePct(maxPower, damage); m_caster->EnergizeBySpell(unitTarget, m_spellInfo->Id, gain, power); } @@ -3363,7 +3363,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) else if (m_spellInfo->SpellFamilyFlags[0] & 0x00008800 && unitTarget->HasAuraState(AURA_STATE_BLEEDING)) { if (AuraEffect const* rendAndTear = m_caster->GetDummyAuraEffect(SPELLFAMILY_DRUID, 2859, 0)) - AddPctN(totalDamagePercentMod, rendAndTear->GetAmount()); + AddPct(totalDamagePercentMod, rendAndTear->GetAmount()); } break; } @@ -3381,7 +3381,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) { // Glyph of Plague Strike if (AuraEffect const* aurEff = m_caster->GetAuraEffect(58657, EFFECT_0)) - AddPctN(totalDamagePercentMod, aurEff->GetAmount()); + AddPct(totalDamagePercentMod, aurEff->GetAmount()); break; } // Blood Strike @@ -3390,13 +3390,13 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) float bonusPct = m_spellInfo->Effects[EFFECT_2].CalcValue() * unitTarget->GetDiseasesByCaster(m_caster->GetGUID()) / 2.0f; // Death Knight T8 Melee 4P Bonus if (AuraEffect const* aurEff = m_caster->GetAuraEffect(64736, EFFECT_0)) - AddPctF(bonusPct, aurEff->GetAmount()); - AddPctF(totalDamagePercentMod, bonusPct); + AddPct(bonusPct, aurEff->GetAmount()); + AddPct(totalDamagePercentMod, bonusPct); // Glyph of Blood Strike if (m_caster->GetAuraEffect(59332, EFFECT_0)) if (unitTarget->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED)) - AddPctN(totalDamagePercentMod, 20); + AddPct(totalDamagePercentMod, 20); break; } // Death Strike @@ -3405,7 +3405,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) // Glyph of Death Strike if (AuraEffect const* aurEff = m_caster->GetAuraEffect(59336, EFFECT_0)) if (uint32 runic = std::min<uint32>(m_caster->GetPower(POWER_RUNIC_POWER), aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue())) - AddPctN(totalDamagePercentMod, runic); + AddPct(totalDamagePercentMod, runic); break; } // Obliterate (12.5% more damage per disease) @@ -3421,14 +3421,14 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) float bonusPct = m_spellInfo->Effects[EFFECT_2].CalcValue() * unitTarget->GetDiseasesByCaster(m_caster->GetGUID(), consumeDiseases) / 2.0f; // Death Knight T8 Melee 4P Bonus if (AuraEffect const* aurEff = m_caster->GetAuraEffect(64736, EFFECT_0)) - AddPctF(bonusPct, aurEff->GetAmount()); - AddPctF(totalDamagePercentMod, bonusPct); + AddPct(bonusPct, aurEff->GetAmount()); + AddPct(totalDamagePercentMod, bonusPct); break; } // Blood-Caked Strike - Blood-Caked Blade if (m_spellInfo->SpellIconID == 1736) { - AddPctF(totalDamagePercentMod, unitTarget->GetDiseasesByCaster(m_caster->GetGUID()) * 12.5f); + AddPct(totalDamagePercentMod, unitTarget->GetDiseasesByCaster(m_caster->GetGUID()) * 12.5f); break; } // Heart Strike @@ -3437,9 +3437,9 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) float bonusPct = m_spellInfo->Effects[EFFECT_2].CalcValue() * unitTarget->GetDiseasesByCaster(m_caster->GetGUID()); // Death Knight T8 Melee 4P Bonus if (AuraEffect const* aurEff = m_caster->GetAuraEffect(64736, EFFECT_0)) - AddPctF(bonusPct, aurEff->GetAmount()); + AddPct(bonusPct, aurEff->GetAmount()); - AddPctF(totalDamagePercentMod, bonusPct); + AddPct(totalDamagePercentMod, bonusPct); break; } break; @@ -3461,7 +3461,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) normalized = true; break; case SPELL_EFFECT_WEAPON_PERCENT_DAMAGE: - ApplyPctN(weaponDamagePercentMod, CalculateDamage(j, unitTarget)); + ApplyPct(weaponDamagePercentMod, CalculateDamage(j, unitTarget)); break; default: break; // not weapon damage effect, just skip @@ -4937,7 +4937,7 @@ void Spell::EffectResurrect(SpellEffIndex effIndex) return; uint32 health = target->CountPctFromMaxHealth(damage); - uint32 mana = CalculatePctN(target->GetMaxPower(POWER_MANA), damage); + uint32 mana = CalculatePct(target->GetMaxPower(POWER_MANA), damage); ExecuteLogEffectResurrect(effIndex, target); @@ -5087,7 +5087,7 @@ void Spell::EffectSelfResurrect(SpellEffIndex effIndex) { health = m_caster->CountPctFromMaxHealth(damage); if (m_caster->GetMaxPower(POWER_MANA) > 0) - mana = CalculatePctN(m_caster->GetMaxPower(POWER_MANA), damage); + mana = CalculatePct(m_caster->GetMaxPower(POWER_MANA), damage); } Player* player = m_caster->ToPlayer(); @@ -5404,12 +5404,12 @@ void Spell::EffectDestroyAllTotems(SpellEffIndex /*effIndex*/) if (spellInfo) { mana += spellInfo->ManaCost; - mana += int32(CalculatePctU(m_caster->GetCreateMana(), spellInfo->ManaCostPercentage)); + mana += int32(CalculatePct(m_caster->GetCreateMana(), spellInfo->ManaCostPercentage)); } totem->ToTotem()->UnSummon(); } } - ApplyPctN(mana, damage); + ApplyPct(mana, damage); if (mana) m_caster->CastCustomSpell(m_caster, 39104, &mana, NULL, NULL, true); } diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 0531549cbd3..37f6a4b8640 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -2026,16 +2026,16 @@ uint32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) { // health as power used case POWER_HEALTH: - powerCost += int32(CalculatePctU(caster->GetCreateHealth(), ManaCostPercentage)); + powerCost += int32(CalculatePct(caster->GetCreateHealth(), ManaCostPercentage)); break; case POWER_MANA: - powerCost += int32(CalculatePctU(caster->GetCreateMana(), ManaCostPercentage)); + powerCost += int32(CalculatePct(caster->GetCreateMana(), ManaCostPercentage)); break; case POWER_RAGE: case POWER_FOCUS: case POWER_ENERGY: case POWER_HAPPINESS: - powerCost += int32(CalculatePctU(caster->GetMaxPower(Powers(PowerType)), ManaCostPercentage)); + powerCost += int32(CalculatePct(caster->GetMaxPower(Powers(PowerType)), ManaCostPercentage)); break; case POWER_RUNE: case POWER_RUNIC_POWER: |
