diff options
author | Sorikoff <46191832+Sorikoff@users.noreply.github.com> | 2019-08-02 19:34:09 +0300 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-12-18 00:01:56 +0100 |
commit | 1fd0ba816f317cd298c1efe7a64deb6ad891256d (patch) | |
tree | a9e2806de5f0f29e474faac0f219d0846561741e | |
parent | 2e9191c153aaa16aa03b3f3acd9033cae750e2a1 (diff) |
Scripts/Spells: Devour Humanoid (#23660)
(cherry picked from commit 0d53a0ba981a2471fcd951465f6be5d073fddd38)
3 files changed, 20 insertions, 5 deletions
diff --git a/sql/updates/world/master/2021_12_17_28_world_2019_08_02_02_world.sql b/sql/updates/world/master/2021_12_17_28_world_2019_08_02_02_world.sql new file mode 100644 index 00000000000..e7ce85498b2 --- /dev/null +++ b/sql/updates/world/master/2021_12_17_28_world_2019_08_02_02_world.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_death_knight_devour_humanoid'; +INSERT INTO `spell_script_names` VALUES +(53110,'spell_death_knight_devour_humanoid'); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 59974523b9c..19570c7ceee 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3079,11 +3079,6 @@ void Spell::EffectScriptEffect() unitCaster->CastSpell(unitTarget, urand(0, 1) ? damage : 52505, CastSpellExtraArgs(TRIGGERED_FULL_MASK) .SetOriginalCastId(m_castId)); return; - case 53110: // Devour Humanoid - if (unitTarget) - unitTarget->CastSpell(m_caster, damage, CastSpellExtraArgs(TRIGGERED_FULL_MASK) - .SetOriginalCastId(m_castId)); - return; case 57347: // Retrieving (Wintergrasp RP-GG pickup spell) { if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT || m_caster->GetTypeId() != TYPEID_PLAYER) diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index f02097a3408..eb95cd1c68b 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -23,6 +23,7 @@ #include "Player.h" #include "ScriptedEscortAI.h" #include "SpellInfo.h" +#include "SpellScript.h" //How to win friends and influence enemies // texts signed for creature 28939 but used for 28939, 28940, 28610 @@ -745,6 +746,21 @@ public: }; }; +class spell_death_knight_devour_humanoid : public SpellScript +{ + PrepareSpellScript(spell_death_knight_devour_humanoid); + + void HandleScriptEffect(SpellEffIndex /* effIndex */) + { + GetHitUnit()->CastSpell(GetCaster(), GetEffectValue(), true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_death_knight_devour_humanoid::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + void AddSC_the_scarlet_enclave_c2() { new npc_crusade_persuaded(); @@ -752,4 +768,5 @@ void AddSC_the_scarlet_enclave_c2() new npc_koltira_deathweaver(); new npc_high_inquisitor_valroth(); new npc_a_special_surprise(); + RegisterSpellScript(spell_death_knight_devour_humanoid); } |