From d7981de01e739addf30035a2701538606baea2e6 Mon Sep 17 00:00:00 2001 From: Stifler82 Date: Thu, 11 Feb 2021 14:08:27 +0000 Subject: [PATCH] fix(Core/Spell): solve issue with Life Tap All Ranks (#4408) --- .../pending_db_world/rev_1612257567543292300.sql | 11 +++++++++++ src/server/scripts/Spells/spell_warlock.cpp | 5 +++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1612257567543292300.sql diff --git a/data/sql/updates/pending_db_world/rev_1612257567543292300.sql b/data/sql/updates/pending_db_world/rev_1612257567543292300.sql new file mode 100644 index 000000000..41d639d29 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1612257567543292300.sql @@ -0,0 +1,11 @@ +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1612257567543292300'); +DELETE FROM `spell_dbc` WHERE `ID` IN (1454, 1455, 1456, 11687, 11688, 11689, 27222, 57946); +INSERT INTO `spell_dbc` VALUES +(1454, 0, 0, 0, 65536, 1024, 33554432, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 8, 0, 0, 0, 101, 0, 16, 6, 6, 0, -2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1225, 0, 208, 0, 0, 'Life Tap', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, 'Rank 1', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, 'Converts ${$m1} health into ${$m1*$+$SPS*.5*$} mana. Spell power increases the amount of mana returned.\r\n', 'Converts ${$m1} health into ${$m1*$+$SPS*.5*$} mana. Spell power increases the amount of mana returned.', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, 0, 133, 1500, 0, 5, 262144, 0, 0, 0, 1, 1, 0, 1065350000, 1065350000, 1065350000, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 175, 0), +(1455, 0, 0, 0, 65536, 1024, 33554432, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 8, 0, 0, 0, 101, 0, 16, 6, 6, 0, -2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1225, 0, 208, 0, 0, 'Life Tap', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, 'Rank 1', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, 'Converts ${$m1} health into ${$m1*$+$SPS*.5*$} mana. Spell power increases the amount of mana returned.\r\n', 'Converts ${$m1} health into ${$m1*$+$SPS*.5*$} mana. Spell power increases the amount of mana returned.', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, 0, 133, 1500, 0, 5, 262144, 0, 0, 0, 1, 1, 0, 1065350000, 1065350000, 1065350000, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 175, 0), +(1456, 0, 0, 0, 65536, 1024, 33554432, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 8, 0, 0, 0, 101, 0, 16, 6, 6, 0, -2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 0, 0, 131, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1225, 0, 208, 0, 0, 'Life Tap', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, 'Rank 1', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, 'Converts ${$m1} health into ${$m1*$+$SPS*.5*$} mana. Spell power increases the amount of mana returned.\r\n', 'Converts ${$m1} health into ${$m1*$+$SPS*.5*$} mana. Spell power increases the amount of mana returned.', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, 0, 133, 1500, 0, 5, 262144, 0, 0, 0, 1, 1, 0, 1065350000, 1065350000, 1065350000, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 175, 0), +(11687, 0, 0, 0, 65536, 1024, 33554432, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 8, 0, 0, 0, 101, 0, 16, 6, 6, 0, -2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 0, 0, 214, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1225, 0, 208, 0, 0, 'Life Tap', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, 'Rank 1', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, 'Converts ${$m1} health into ${$m1*$+$SPS*.5*$} mana. Spell power increases the amount of mana returned.\r\n', 'Converts ${$m1} health into ${$m1*$+$SPS*.5*$} mana. Spell power increases the amount of mana returned.', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, 0, 133, 1500, 0, 5, 262144, 0, 0, 0, 1, 1, 0, 1065350000, 1065350000, 1065350000, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 175, 0), +(11688, 0, 0, 0, 65536, 1024, 33554432, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 8, 0, 0, 0, 101, 0, 16, 6, 6, 0, -2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 0, 0, 305, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1225, 0, 208, 0, 0, 'Life Tap', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, 'Rank 1', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, 'Converts ${$m1} health into ${$m1*$+$SPS*.5*$} mana. Spell power increases the amount of mana returned.\r\n', 'Converts ${$m1} health into ${$m1*$+$SPS*.5*$} mana. Spell power increases the amount of mana returned.', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, 0, 133, 1500, 0, 5, 262144, 0, 0, 0, 1, 1, 0, 1065350000, 1065350000, 1065350000, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 175, 0), +(11689, 0, 0, 0, 65536, 1024, 33554432, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 8, 0, 0, 0, 101, 0, 16, 6, 6, 0, -2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 0, 0, 826, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1225, 0, 208, 0, 0, 'Life Tap', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, 'Rank 1', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, 'Converts ${$m1} health into ${$m1*$+$SPS*.5*$} mana. Spell power increases the amount of mana returned.\r\n', 'Converts ${$m1} health into ${$m1*$+$SPS*.5*$} mana. Spell power increases the amount of mana returned.', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, 0, 133, 1500, 0, 5, 262144, 0, 0, 0, 1, 1, 0, 1065350000, 1065350000, 1065350000, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 175, 0), +(27222, 0, 0, 0, 65536, 1024, 33554432, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 8, 0, 0, 0, 101, 0, 16, 6, 6, 0, -2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 0, 0, 1123, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1225, 0, 208, 0, 0, 'Life Tap', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, 'Rank 1', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, 'Converts ${$m1} health into ${$m1*$+$SPS*.5*$} mana. Spell power increases the amount of mana returned.\r\n', 'Converts ${$m1} health into ${$m1*$+$SPS*.5*$} mana. Spell power increases the amount of mana returned.', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, 0, 133, 1500, 0, 5, 262144, 0, 0, 0, 1, 1, 0, 1065350000, 1065350000, 1065350000, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 175, 0), +(57946, 0, 0, 0, 65536, 1024, 33554432, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 8, 0, 0, 0, 101, 0, 16, 6, 6, 0, -2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 0, 0, 1999, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1225, 0, 208, 0, 0, 'Life Tap', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, 'Rank 1', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, 'Converts ${$m1} health into ${$m1*$+$SPS*.5*$} mana. Spell power increases the amount of mana returned.\r\n', 'Converts ${$m1} health into ${$m1*$+$SPS*.5*$} mana. Spell power increases the amount of mana returned.', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16712190, 0, 133, 1500, 0, 5, 262144, 0, 0, 0, 1, 1, 0, 1065350000, 1065350000, 1065350000, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 175, 0); diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index ec6e1a149..eda142d16 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -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; }