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
This commit is contained in:
ariel-
2022-05-08 20:40:02 +02:00
committed by Ovahlord
parent cecaedfb80
commit dc46f0621b
3 changed files with 36 additions and 22 deletions

View File

@@ -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');

View File

@@ -478,27 +478,6 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex)
// special cases
switch (triggered_spell_id)
{
// 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:
{

View File

@@ -77,7 +77,8 @@ enum RogueSpells
SPELL_ROGUE_RUPTURE = 1943,
SPELL_ROGUE_HONOR_AMONG_THIEVES_TRIGGERED = 51699,
SPELL_ROGUE_BLACKJACK_R1 = 79123,
SPELL_RACIAL_ELUSIVENESS = 21009
SPELL_RACIAL_ELUSIVENESS = 21009,
SPELL_ROGUE_STEALTH = 1784
};
enum RogueSpellIcons
@@ -1522,6 +1523,36 @@ class spell_rog_gouge : public AuraScript
}
};
// -11327 - Vanish
class spell_rog_vanish : public AuraScript
{
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.Register(&spell_rog_vanish::ApplyStealth, EFFECT_1, SPELL_AURA_MOD_STEALTH, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
}
};
void AddSC_rogue_spell_scripts()
{
RegisterSpellScript(spell_rog_bandits_guile);
@@ -1557,4 +1588,5 @@ void AddSC_rogue_spell_scripts()
RegisterSpellAndAuraScriptPair(spell_rog_tricks_of_the_trade, spell_rog_tricks_of_the_trade_aura);
RegisterSpellScript(spell_rog_tricks_of_the_trade_proc);
RegisterSpellScript(spell_rog_honor_among_thieves);
RegisterSpellScript(spell_rog_vanish);
}