Core/Spells: Fixed Vanish not applying stealth. Closes issue #4699.
--HG-- branch : trunk
This commit is contained in:
@@ -1648,41 +1648,20 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex)
|
|||||||
unitTarget->RemoveMovementImpairingAuras();
|
unitTarget->RemoveMovementImpairingAuras();
|
||||||
unitTarget->RemoveAurasByType(SPELL_AURA_MOD_STALKED);
|
unitTarget->RemoveAurasByType(SPELL_AURA_MOD_STALKED);
|
||||||
|
|
||||||
// if this spell is given to NPC it must handle rest by it's own AI
|
// If this spell is given to an NPC, it must handle the rest using its own AI
|
||||||
if (unitTarget->GetTypeId() != TYPEID_PLAYER)
|
if (unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// get highest rank of the Stealth spell
|
// See if we already are stealthed. If so, we're done.
|
||||||
uint32 spellId = 0;
|
if (unitTarget->HasAura(1784))
|
||||||
SpellEntry const *spellInfo;
|
|
||||||
const PlayerSpellMap& sp_list = unitTarget->ToPlayer()->GetSpellMap();
|
|
||||||
for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
|
|
||||||
{
|
|
||||||
// only highest rank is shown in spell book, so simply check if shown in spell book
|
|
||||||
if (!itr->second->active || itr->second->disabled || itr->second->state == PLAYERSPELL_REMOVED)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
spellInfo = sSpellStore.LookupEntry(itr->first);
|
|
||||||
if (!spellInfo)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE && spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_STEALTH)
|
|
||||||
{
|
|
||||||
spellId = spellInfo->Id;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// no Stealth spell found
|
|
||||||
if (!spellId)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// reset cooldown on it if needed
|
// Reset cooldown on stealth if needed
|
||||||
if (unitTarget->ToPlayer()->HasSpellCooldown(spellId))
|
if (unitTarget->ToPlayer()->HasSpellCooldown(1784))
|
||||||
unitTarget->ToPlayer()->RemoveSpellCooldown(spellId);
|
unitTarget->ToPlayer()->RemoveSpellCooldown(1784);
|
||||||
|
|
||||||
triggered_spell_id = spellId;
|
triggered_spell_id = 1784;
|
||||||
return;
|
break;
|
||||||
}
|
}
|
||||||
// Demonic Empowerment -- succubus
|
// Demonic Empowerment -- succubus
|
||||||
case 54437:
|
case 54437:
|
||||||
|
|||||||
Reference in New Issue
Block a user