Cleanup in spell code

--HG--
branch : trunk
This commit is contained in:
win32
2009-12-21 15:45:28 +02:00
parent c3ee3f537d
commit c92fbc0dfb
4 changed files with 84 additions and 133 deletions

View File

@@ -1996,7 +1996,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff
{
// Cast healing spell, completely avoid damage
RemainingDamage = 0;
uint32 defenseSkillValue = pVictim->GetDefenseSkillValue();
// Max heal when defense skill denies critical hits from raid bosses
// Formula: max defense at level + 140 (raiting from gear)
@@ -2005,7 +2005,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff
? 1.0f
: float(defenseSkillValue) / float(reqDefForMaxHeal);
int32 healAmount = pVictim->GetMaxHealth() * ((*i)->GetSpellProto()->EffectBasePoints[1] + 1) / 100.0f * pctFromDefense;
int32 healAmount = pVictim->GetMaxHealth() * (*i)->GetAmount() / 100.0f * pctFromDefense;
pVictim->CastCustomSpell(pVictim, 66235, &healAmount, NULL, NULL, true);
((Player*)pVictim)->AddSpellCooldown(66235,0,time(NULL) + 120);
}