From 0d9e3c8e43f71889ac7d91ab8faf8751a4b5ff0f Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Mon, 6 Jun 2011 17:32:42 +0400 Subject: [PATCH] [11615] Apply normal stealth at expire spell 1856 and ranks Instead current at apply mode. --- src/game/SpellAuras.cpp | 17 ++++++++++++++++- src/game/SpellEffects.cpp | 11 ----------- src/shared/revision_nr.h | 2 +- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 65d12f4ad..adf1251f0 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -4431,8 +4431,23 @@ void Aura::HandleModStealth(bool apply, bool Real) } else { + if (!Real) + return; + + // Vanish (triggered, normal stealth need apply before remove advanced stealth) + if (target->GetTypeId() == TYPEID_PLAYER && m_removeMode == AURA_REMOVE_BY_EXPIRE && + GetSpellProto()->IsFitToFamily(SPELLFAMILY_ROGUE, UI64LIT(0x000000000800))) + { + uint32 spellId = 1784; // Stealth + // reset cooldown on it if needed + if (((Player*)target)->HasSpellCooldown(spellId)) + ((Player*)target)->RemoveSpellCooldown(spellId); + + target->CastSpell(target, spellId, true); + } + // only at real aura remove of _last_ SPELL_AURA_MOD_STEALTH - if (Real && !target->HasAuraType(SPELL_AURA_MOD_STEALTH)) + if (!target->HasAuraType(SPELL_AURA_MOD_STEALTH)) { // if no GM invisibility if (target->GetVisibility()!=VISIBILITY_OFF) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 05a808710..82edd35dd 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -3327,17 +3327,6 @@ void Spell::EffectTriggerSpell(SpellEffectIndex effIndex) unitTarget->RemoveSpellsCausingAura(SPELL_AURA_MOD_ROOT); unitTarget->RemoveSpellsCausingAura(SPELL_AURA_MOD_DECREASE_SPEED); unitTarget->RemoveSpellsCausingAura(SPELL_AURA_MOD_STALKED); - - // if this spell is given to NPC it must handle rest by it's own AI - if (unitTarget->GetTypeId() != TYPEID_PLAYER) - return; - - uint32 spellId = 1784; - // reset cooldown on it if needed - if (((Player*)unitTarget)->HasSpellCooldown(spellId)) - ((Player*)unitTarget)->RemoveSpellCooldown(spellId); - - m_caster->CastSpell(unitTarget, spellId, true); return; } // just skip diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index f7cd1439b..4318c22f1 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11614" + #define REVISION_NR "11615" #endif // __REVISION_NR_H__