fix (Core/Spells) Correct Life Tap mana gain and cleanup (#15278)

This commit is contained in:
Tereneckla
2023-03-11 22:28:12 +00:00
committed by GitHub
parent 479c965c4e
commit 88d31a1a71

View File

@@ -753,7 +753,6 @@ class spell_warl_siphon_life : public AuraScript
};
// -1454 - Life Tap
#define LIFE_TAP_COEFFICIENT 0.9F
class spell_warl_life_tap : public SpellScript
{
PrepareSpellScript(spell_warl_life_tap);
@@ -773,12 +772,11 @@ class spell_warl_life_tap : public SpellScript
Player* caster = GetCaster()->ToPlayer();
if (Unit* target = GetHitUnit())
{
int32 damage = GetEffectValue() + LIFE_TAP_COEFFICIENT;
int32 damage2Mana = GetEffectValue();
int32 mana = int32(damage2Mana + (caster->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + static_cast<uint8>(SPELL_SCHOOL_SHADOW)) * 0.5f));
int32 spellEffect = GetEffectValue();
int32 mana = int32(spellEffect + (caster->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_SHADOW) * 0.5f));
// Shouldn't Appear in Combat Log
target->ModifyHealth(-damage);
target->ModifyHealth(-spellEffect);
// Improved Life Tap mod
if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, WARLOCK_ICON_ID_IMPROVED_LIFE_TAP, 0))
@@ -801,7 +799,7 @@ class spell_warl_life_tap : public SpellScript
SpellCastResult CheckCast()
{
if ((int32(GetCaster()->GetHealth()) > int32(GetSpellInfo()->Effects[EFFECT_0].CalcValue() + (3.1 * GetSpellInfo()->BaseLevel) + LIFE_TAP_COEFFICIENT )))
if ((int32(GetCaster()->GetHealth()) > int32(GetSpellInfo()->Effects[EFFECT_0].CalcValue())))
return SPELL_CAST_OK;
return SPELL_FAILED_FIZZLE;
}