mirror of
https://github.com/mangosfour/server.git
synced 2025-12-22 22:37:06 +00:00
Not apply/remove passive auras on aura state change (not need)
Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
parent
edfeb6597d
commit
1a63e23ffd
1 changed files with 1 additions and 45 deletions
|
|
@ -7206,51 +7206,7 @@ void Unit::RemoveAllAttackers()
|
||||||
|
|
||||||
void Unit::ModifyAuraState(AuraState flag, bool apply)
|
void Unit::ModifyAuraState(AuraState flag, bool apply)
|
||||||
{
|
{
|
||||||
if (apply)
|
ApplyModFlag(UNIT_FIELD_AURASTATE, 1<<(flag-1), apply);
|
||||||
{
|
|
||||||
if (!HasFlag(UNIT_FIELD_AURASTATE, 1<<(flag-1)))
|
|
||||||
{
|
|
||||||
SetFlag(UNIT_FIELD_AURASTATE, 1<<(flag-1));
|
|
||||||
if(GetTypeId() == TYPEID_PLAYER)
|
|
||||||
{
|
|
||||||
const PlayerSpellMap& sp_list = ((Player*)this)->GetSpellMap();
|
|
||||||
for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
|
|
||||||
{
|
|
||||||
if(itr->second->state == PLAYERSPELL_REMOVED) continue;
|
|
||||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first);
|
|
||||||
if (!spellInfo || !IsPassiveSpell(itr->first)) continue;
|
|
||||||
if (spellInfo->CasterAuraState == flag)
|
|
||||||
CastSpell(this, itr->first, true, NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (HasFlag(UNIT_FIELD_AURASTATE,1<<(flag-1)))
|
|
||||||
{
|
|
||||||
RemoveFlag(UNIT_FIELD_AURASTATE, 1<<(flag-1));
|
|
||||||
Unit::AuraMap& tAuras = GetAuras();
|
|
||||||
for (Unit::AuraMap::iterator itr = tAuras.begin(); itr != tAuras.end();)
|
|
||||||
{
|
|
||||||
SpellEntry const* spellProto = (*itr).second->GetSpellProto();
|
|
||||||
if (spellProto->CasterAuraState == flag)
|
|
||||||
{
|
|
||||||
// exceptions (applied at state but not removed at state change)
|
|
||||||
// Rampage
|
|
||||||
if(spellProto->SpellIconID==2006 && spellProto->SpellFamilyName==SPELLFAMILY_WARRIOR && spellProto->SpellFamilyFlags==0x100000)
|
|
||||||
{
|
|
||||||
++itr;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
RemoveAura(itr);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
++itr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Unit *Unit::GetOwner() const
|
Unit *Unit::GetOwner() const
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue