diff options
author | ariel- <ariel-@users.noreply.github.com> | 2018-02-08 23:18:45 -0300 |
---|---|---|
committer | ariel- <ariel-@users.noreply.github.com> | 2018-02-08 23:18:45 -0300 |
commit | 303efcf0e4ee9ce3cfe308a3d6aa2aece1aa39da (patch) | |
tree | 841b381c3fce1ff2d42585053ffe612cd3e35a1c | |
parent | b4c16971cb6ab912606df2a27774d7ef10c4c6bc (diff) |
Core/Spells: remove 'Vanish Purge' hack, the spell is present on DB and is copy of one in vanilla DBC
Thanks to killerwife for the heads-up
-rw-r--r-- | sql/updates/world/3.3.5/2018_02_09_00_world_335.sql | 3 | ||||
-rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 21 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_rogue.cpp | 36 |
3 files changed, 38 insertions, 22 deletions
diff --git a/sql/updates/world/3.3.5/2018_02_09_00_world_335.sql b/sql/updates/world/3.3.5/2018_02_09_00_world_335.sql new file mode 100644 index 00000000000..6bb835c657e --- /dev/null +++ b/sql/updates/world/3.3.5/2018_02_09_00_world_335.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_rog_vanish'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(-11327, 'spell_rog_vanish'); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 492dab27bf5..0254204e7fe 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -774,27 +774,6 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex) break; } - // Vanish (not exist) - case 18461: - { - unitTarget->RemoveMovementImpairingAuras(true); - unitTarget->RemoveAurasByType(SPELL_AURA_MOD_STALKED); - - // If this spell is given to an NPC, it must handle the rest using its own AI - if (unitTarget->GetTypeId() != TYPEID_PLAYER) - return; - - // See if we already are stealthed. If so, we're done. - if (unitTarget->HasAura(1784)) - return; - - // Reset cooldown on stealth if needed - if (unitTarget->GetSpellHistory()->HasCooldown(1784)) - unitTarget->GetSpellHistory()->ResetCooldown(1784); - - unitTarget->CastSpell(unitTarget, 1784, true); - return; - } // Demonic Empowerment -- succubus case 54437: { diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 53e7c01a947..5c910210266 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -55,7 +55,8 @@ enum RogueSpells SPELL_ROGUE_QUICK_RECOVERY_ENERGY = 31663, SPELL_ROGUE_CRIPPLING_POISON = 3409, SPELL_ROGUE_MASTER_OF_SUBTLETY_BUFF = 31665, - SPELL_ROGUE_OVERKILL_BUFF = 58427 + SPELL_ROGUE_OVERKILL_BUFF = 58427, + SPELL_ROGUE_STEALTH = 1784 }; // 13877, 33735, (check 51211, 65956) - Blade Flurry @@ -1116,6 +1117,38 @@ class spell_rog_turn_the_tables : public SpellScriptLoader } }; +// -11327 - Vanish +class spell_rog_vanish : public AuraScript +{ + PrepareAuraScript(spell_rog_vanish); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_ROGUE_STEALTH }); + } + + void ApplyStealth(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* unitTarget = GetTarget(); + unitTarget->RemoveAurasByType(SPELL_AURA_MOD_STALKED); + + // See if we already are stealthed. If so, we're done. + if (unitTarget->HasAura(SPELL_ROGUE_STEALTH)) + return; + + // Reset cooldown on stealth if needed + if (unitTarget->GetSpellHistory()->HasCooldown(SPELL_ROGUE_STEALTH)) + unitTarget->GetSpellHistory()->ResetCooldown(SPELL_ROGUE_STEALTH); + + unitTarget->CastSpell(nullptr, SPELL_ROGUE_STEALTH, true); + } + + void Register() override + { + AfterEffectApply += AuraEffectApplyFn(spell_rog_vanish::ApplyStealth, EFFECT_1, SPELL_AURA_MOD_STEALTH, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + } +}; + void AddSC_rogue_spell_scripts() { new spell_rog_blade_flurry(); @@ -1140,4 +1173,5 @@ void AddSC_rogue_spell_scripts() new spell_rog_honor_among_thieves(); new spell_rog_honor_among_thieves_proc(); new spell_rog_turn_the_tables(); + RegisterAuraScript(spell_rog_vanish); } |