fix(Core/Spell): solve issue with Life Tap All Ranks (#4408)

This commit is contained in:
Stifler82
2021-02-11 14:08:27 +00:00
committed by GitHub
parent 5fad58815d
commit d7981de01e
2 changed files with 14 additions and 2 deletions

View File

@@ -915,6 +915,7 @@ public:
};
// -1454 - Life Tap
#define LIFE_TAP_COEFFICIENT 0.9F
class spell_warl_life_tap : public SpellScriptLoader
{
public:
@@ -939,7 +940,7 @@ public:
Player* caster = GetCaster()->ToPlayer();
if (Unit* target = GetHitUnit())
{
int32 damage = GetEffectValue() + 1.0f + (caster->GetStat(STAT_SPIRIT) * 1.5f);
int32 damage = GetEffectValue() + LIFE_TAP_COEFFICIENT;
int32 damage2Mana = GetEffectValue();
int32 mana = int32(damage2Mana + (caster->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW) * 0.5f));
@@ -967,7 +968,7 @@ public:
SpellCastResult CheckCast()
{
if ((int32(GetCaster()->GetHealth()) > int32(GetSpellInfo()->Effects[EFFECT_0].CalcValue() + (6.3875 * GetSpellInfo()->BaseLevel) + (GetCaster()->GetStat(STAT_SPIRIT) * 1.5f) + 1.0f )))
if ((int32(GetCaster()->GetHealth()) > int32(GetSpellInfo()->Effects[EFFECT_0].CalcValue() + (3.1 * GetSpellInfo()->BaseLevel) + LIFE_TAP_COEFFICIENT )))
return SPELL_CAST_OK;
return SPELL_FAILED_FIZZLE;
}