Skip to content

Commit

Permalink
fix(Scripts/Rogue): Fix Vanish not granting stealth (azerothcore#18155)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyeriah committed Jan 12, 2024
1 parent b13596a commit c863a8c
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/server/scripts/Spells/spell_rogue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,8 @@ class spell_rog_pickpocket : public SpellScript

enum vanish
{
SPELL_PARALYZE = 38132,
SPELL_STEALTH = 1784,
SPELL_PARALYZE = 38132,
SPELL_CLEAN_ESCAPE_AURA = 23582,
SPELL_CLEAN_ESCAPE_HEAL = 23583
};
Expand Down Expand Up @@ -742,8 +743,22 @@ class spell_rog_vanish : public SpellScript

void HandleEffect(SpellEffIndex /*effIndex*/)
{
if (GetCaster() && GetCaster()->HasAura(SPELL_CLEAN_ESCAPE_AURA))
GetCaster()->CastSpell(GetCaster(), SPELL_CLEAN_ESCAPE_HEAL, true);
if (GetCaster())
{
GetCaster()->RemoveAurasByType(SPELL_AURA_MOD_STALKED);

if (!GetCaster()->HasAura(SPELL_STEALTH))
{
// Remove stealth cooldown if needed.
if (GetCaster()->IsPlayer() && GetCaster()->HasSpellCooldown(SPELL_STEALTH))
GetCaster()->ToPlayer()->RemoveSpellCooldown(SPELL_STEALTH);

GetCaster()->CastSpell(GetCaster(), SPELL_STEALTH, true);
}

if (GetCaster()->HasAura(SPELL_CLEAN_ESCAPE_AURA))
GetCaster()->CastSpell(GetCaster(), SPELL_CLEAN_ESCAPE_HEAL, true);
}
}

void Register() override
Expand Down

0 comments on commit c863a8c

Please sign in to comment.