[9851] Restore work of 1856 and ranks

This commit is contained in:
Laise 2010-05-08 13:46:54 +03:00
parent 921b0d668f
commit 5c17458fb8
2 changed files with 2 additions and 25 deletions

View file

@ -2514,30 +2514,7 @@ void Spell::EffectTriggerSpell(SpellEffectIndex effIndex)
if (unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
// get highest rank of the Stealth spell
uint32 spellId = 0;
const PlayerSpellMap& sp_list = ((Player*)unitTarget)->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;
SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first);
if (!spellInfo)
continue;
if (spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE && spellInfo->SpellFamilyFlags & SPELLFAMILYFLAG_ROGUE_STEALTH)
{
spellId = spellInfo->Id;
break;
}
}
// no Stealth spell found
if (!spellId)
return;
uint32 spellId = 1784;
// reset cooldown on it if needed
if (((Player*)unitTarget)->HasSpellCooldown(spellId))
((Player*)unitTarget)->RemoveSpellCooldown(spellId);