diff options
author | Jeremy <Golrag@users.noreply.github.com> | 2025-06-15 10:02:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-15 10:02:54 +0200 |
commit | 65276ba69a8058ca3e077ac23f86baab005cb53e (patch) | |
tree | 96e4110342c4d2f0d96ec2e0430fd992a515420f | |
parent | f429777cdc88ed7d57a2603e9651d0b92e223ab3 (diff) |
Scripts/Spells: Fix warrior bloodthirst heal (#31027)
-rw-r--r-- | sql/updates/world/master/2025_06_15_02_world.sql | 4 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_warrior.cpp | 14 |
2 files changed, 15 insertions, 3 deletions
diff --git a/sql/updates/world/master/2025_06_15_02_world.sql b/sql/updates/world/master/2025_06_15_02_world.sql new file mode 100644 index 00000000000..7ce950b521b --- /dev/null +++ b/sql/updates/world/master/2025_06_15_02_world.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_warr_bloodthirst'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(215568, 'spell_warr_bloodthirst'), +(335096, 'spell_warr_bloodthirst'); diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 2f82cb3fb93..7e91e4381e3 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -106,6 +106,7 @@ class spell_warr_avatar : public SpellScript }; // 23881 - Bloodthirst +// 335096 - Bloodbath class spell_warr_bloodthirst : public SpellScript { bool Validate(SpellInfo const* /*spellInfo*/) override @@ -113,14 +114,21 @@ class spell_warr_bloodthirst : public SpellScript return ValidateSpellInfo({ SPELL_WARRIOR_BLOODTHIRST_HEAL }); } - void HandleDummy(SpellEffIndex /*effIndex*/) + void CastHeal(SpellEffIndex /*effIndex*/) const { - GetCaster()->CastSpell(GetCaster(), SPELL_WARRIOR_BLOODTHIRST_HEAL, true); + if (GetHitUnit() != GetExplTargetUnit()) + return; + + GetCaster()->CastSpell(GetCaster(), SPELL_WARRIOR_BLOODTHIRST_HEAL, CastSpellExtraArgsInit + { + .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR, + .TriggeringSpell = GetSpell() + }); } void Register() override { - OnEffectHit += SpellEffectFn(spell_warr_bloodthirst::HandleDummy, EFFECT_3, SPELL_EFFECT_DUMMY); + OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst::CastHeal, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); } }; |