Core/Spells: updated Gift of the Naaru to Cataclysm
This commit is contained in:
1 parent
e8e1e0ac09
commit
96260bf628
1 file changed
+6
-24
@@ -1813,33 +1813,15 @@ class spell_gen_gift_of_naaru : public SpellScriptLoader
|
||||
|
||||
void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (!GetCaster())
|
||||
Unit* target = GetOwner()->ToUnit();
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
float heal = 0.0f;
|
||||
switch (GetSpellInfo()->SpellFamilyName)
|
||||
{
|
||||
case SPELLFAMILY_MAGE:
|
||||
case SPELLFAMILY_WARLOCK:
|
||||
case SPELLFAMILY_PRIEST:
|
||||
heal = 1.885f * float(GetCaster()->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask()));
|
||||
break;
|
||||
case SPELLFAMILY_PALADIN:
|
||||
case SPELLFAMILY_SHAMAN:
|
||||
heal = std::max(1.885f * float(GetCaster()->SpellBaseDamageBonusDone(GetSpellInfo()->GetSchoolMask())), 1.1f * float(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK)));
|
||||
break;
|
||||
case SPELLFAMILY_WARRIOR:
|
||||
case SPELLFAMILY_HUNTER:
|
||||
case SPELLFAMILY_DEATHKNIGHT:
|
||||
heal = 1.1f * float(std::max(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK), GetCaster()->GetTotalAttackPowerValue(RANGED_ATTACK)));
|
||||
break;
|
||||
case SPELLFAMILY_GENERIC:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
uint64 health = target->GetMaxHealth();
|
||||
int32 healthPct = CalculatePct(health, GetSpellInfo()->Effects[EFFECT_1].BasePoints);
|
||||
|
||||
int32 healTick = std::floor(heal / aurEff->GetTotalTicks());
|
||||
amount += int32(std::max(healTick, 0));
|
||||
if (healthPct)
|
||||
amount = std::floor(healthPct / aurEff->GetTotalTicks());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
Reference in new issue
Block a user