diff options
Diffstat (limited to 'src/server/scripts/Spells')
| -rw-r--r-- | src/server/scripts/Spells/spell_paladin.cpp | 20 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_rogue.cpp | 4 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 2de2e5a13cf..5beb421c88b 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -71,31 +71,31 @@ public: void Absorb(AuraEffect * aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount) { - Unit* pVictim = GetTarget(); - int32 remainingHealth = pVictim->GetHealth() - dmgInfo.GetDamage(); - uint32 allowedHealth = pVictim->CountPctFromMaxHealth(35); + Unit* victim = GetTarget(); + int32 remainingHealth = victim->GetHealth() - dmgInfo.GetDamage(); + uint32 allowedHealth = victim->CountPctFromMaxHealth(35); // If damage kills us - if (remainingHealth <= 0 && !pVictim->ToPlayer()->HasSpellCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL)) + if (remainingHealth <= 0 && !victim->ToPlayer()->HasSpellCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL)) { // Cast healing spell, completely avoid damage absorbAmount = dmgInfo.GetDamage(); - uint32 defenseSkillValue = pVictim->GetDefenseSkillValue(); + uint32 defenseSkillValue = victim->GetDefenseSkillValue(); // Max heal when defense skill denies critical hits from raid bosses // Formula: max defense at level + 140 (raiting from gear) - uint32 reqDefForMaxHeal = pVictim->getLevel() * 5 + 140; + uint32 reqDefForMaxHeal = victim->getLevel() * 5 + 140; float pctFromDefense = (defenseSkillValue >= reqDefForMaxHeal) ? 1.0f : float(defenseSkillValue) / float(reqDefForMaxHeal); - int32 healAmount = int32(pVictim->CountPctFromMaxHealth(uint32(healPct * pctFromDefense))); - pVictim->CastCustomSpell(pVictim, PAL_SPELL_ARDENT_DEFENDER_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff); - pVictim->ToPlayer()->AddSpellCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL, 0, time(NULL) + 120); + int32 healAmount = int32(victim->CountPctFromMaxHealth(uint32(healPct * pctFromDefense))); + victim->CastCustomSpell(victim, PAL_SPELL_ARDENT_DEFENDER_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff); + victim->ToPlayer()->AddSpellCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL, 0, time(NULL) + 120); } else if (remainingHealth < int32(allowedHealth)) { // Reduce damage that brings us under 35% (or full damage if we are already under 35%) by x% - uint32 damageToReduce = (pVictim->GetHealth() < allowedHealth) + uint32 damageToReduce = (victim->GetHealth() < allowedHealth) ? dmgInfo.GetDamage() : allowedHealth - remainingHealth; absorbAmount = CalculatePctN(damageToReduce, absorbPct); diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 035c6d9b9b5..e82e7fc79fd 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -227,8 +227,8 @@ public: void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) { Unit* target = GetTarget(); - Unit* pVictim = target->getVictim(); - if (pVictim && (target->GetHealthPct() > pVictim->GetHealthPct())) + Unit* victim = target->getVictim(); + if (victim && (target->GetHealthPct() > victim->GetHealthPct())) { if (!target->HasAura(ROGUE_SPELL_PREY_ON_THE_WEAK)) { |
