mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
Prevent (in some cases) remove aura state flag if exist similar aura.
Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
parent
17e2bcc81d
commit
2cd801a9ef
2 changed files with 43 additions and 46 deletions
|
|
@ -968,7 +968,7 @@ void Aura::_AddAura()
|
|||
if (!secondaura)
|
||||
{
|
||||
// Update Seals information
|
||||
if( IsSealSpell(GetSpellProto()) )
|
||||
if (IsSealSpell(m_spellProto))
|
||||
m_target->ModifyAuraState(AURA_STATE_JUDGEMENT, true);
|
||||
|
||||
// Conflagrate aura state on Immolate
|
||||
|
|
@ -976,15 +976,15 @@ void Aura::_AddAura()
|
|||
m_target->ModifyAuraState(AURA_STATE_IMMOLATE, true);
|
||||
|
||||
// Faerie Fire (druid versions)
|
||||
if( m_spellProto->SpellFamilyName == SPELLFAMILY_DRUID && m_spellProto->SpellFamilyFlags & 0x0000000000000400LL)
|
||||
if (m_spellProto->SpellFamilyName == SPELLFAMILY_DRUID && m_spellProto->SpellFamilyFlags & 0x0000000000000400LL)
|
||||
m_target->ModifyAuraState(AURA_STATE_FAERIE_FIRE, true);
|
||||
|
||||
// Victorious
|
||||
if( m_spellProto->SpellFamilyName == SPELLFAMILY_WARRIOR && m_spellProto->SpellFamilyFlags & 0x0004000000000000LL)
|
||||
if (m_spellProto->SpellFamilyName == SPELLFAMILY_WARRIOR && m_spellProto->SpellFamilyFlags & 0x0004000000000000LL)
|
||||
m_target->ModifyAuraState(AURA_STATE_WARRIOR_VICTORY_RUSH, true);
|
||||
|
||||
// Swiftmend state on Regrowth & Rejuvenation
|
||||
if(m_spellProto->SpellFamilyName == SPELLFAMILY_DRUID && m_spellProto->SpellFamilyFlags & 0x50 )
|
||||
if (m_spellProto->SpellFamilyName == SPELLFAMILY_DRUID && m_spellProto->SpellFamilyFlags & 0x50 )
|
||||
m_target->ModifyAuraState(AURA_STATE_SWIFTMEND, true);
|
||||
|
||||
// Deadly poison aura state
|
||||
|
|
@ -1058,59 +1058,55 @@ void Aura::_RemoveAura()
|
|||
|
||||
//*****************************************************
|
||||
// Update target aura state flag (at last aura remove)
|
||||
// TODO: Make it easer
|
||||
//*****************************************************
|
||||
// Update Seals information
|
||||
if( IsSealSpell(GetSpellProto()) )
|
||||
m_target->ModifyAuraState(AURA_STATE_JUDGEMENT,false);
|
||||
|
||||
// Conflagrate aura state
|
||||
if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellProto()->SpellFamilyFlags & 4))
|
||||
m_target->ModifyAuraState(AURA_STATE_IMMOLATE, false);
|
||||
|
||||
// Faerie Fire (druid versions)
|
||||
if( m_spellProto->SpellFamilyName == SPELLFAMILY_DRUID && m_spellProto->SpellFamilyFlags & 0x0000000000000400LL)
|
||||
m_target->ModifyAuraState(AURA_STATE_FAERIE_FIRE, false);
|
||||
|
||||
// Victorious
|
||||
if( m_spellProto->SpellFamilyName == SPELLFAMILY_WARRIOR && m_spellProto->SpellFamilyFlags & 0x0004000000000000LL)
|
||||
m_target->ModifyAuraState(AURA_STATE_WARRIOR_VICTORY_RUSH, false);
|
||||
|
||||
// Swiftmend aura state
|
||||
if(GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID && GetSpellProto()->SpellFamilyFlags & 0x50)
|
||||
uint32 removeState = 0;
|
||||
switch(m_spellProto->SpellFamilyName)
|
||||
{
|
||||
bool found = false;
|
||||
Unit::AuraList const& RejorRegr = m_target->GetAurasByType(SPELL_AURA_PERIODIC_HEAL);
|
||||
for(Unit::AuraList::const_iterator i = RejorRegr.begin(); i != RejorRegr.end(); ++i)
|
||||
{
|
||||
if((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID && (*i)->GetSpellProto()->SpellFamilyFlags & 0x50 )
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!found)
|
||||
m_target->ModifyAuraState(AURA_STATE_SWIFTMEND, false);
|
||||
case SPELLFAMILY_PALADIN:
|
||||
if (IsSealSpell(m_spellProto))
|
||||
removeState = AURA_STATE_JUDGEMENT; // Update Seals information
|
||||
break;
|
||||
case SPELLFAMILY_WARLOCK:
|
||||
if(m_spellProto->SpellFamilyFlags & 4)
|
||||
removeState = AURA_STATE_IMMOLATE; // Conflagrate aura state
|
||||
break;
|
||||
case SPELLFAMILY_DRUID:
|
||||
if(m_spellProto->SpellFamilyFlags & 0x0000000000000400LL)
|
||||
removeState = AURA_STATE_FAERIE_FIRE; // Faerie Fire (druid versions)
|
||||
else if(m_spellProto->SpellFamilyFlags & 0x50)
|
||||
removeState = AURA_STATE_SWIFTMEND; // Swiftmend aura state
|
||||
break;
|
||||
case SPELLFAMILY_WARRIOR:
|
||||
if(m_spellProto->SpellFamilyFlags & 0x0004000000000000LL)
|
||||
removeState = AURA_STATE_WARRIOR_VICTORY_RUSH; // Victorious
|
||||
break;
|
||||
case SPELLFAMILY_ROGUE:
|
||||
if(m_spellProto->SpellFamilyFlags & 0x10000)
|
||||
removeState = AURA_STATE_DEADLY_POISON; // Deadly poison aura state
|
||||
break;
|
||||
case SPELLFAMILY_HUNTER:
|
||||
if(m_spellProto->SpellFamilyFlags & 0x1000000000000000LL)
|
||||
removeState = AURA_STATE_FAERIE_FIRE; // Sting (hunter versions)
|
||||
|
||||
}
|
||||
|
||||
// Deadly poison aura state
|
||||
if(m_spellProto->SpellFamilyName == SPELLFAMILY_ROGUE && m_spellProto->SpellFamilyFlags & 0x10000)
|
||||
// Remove state (but need check other auras for it)
|
||||
if (removeState)
|
||||
{
|
||||
// current aura already removed, search present of another
|
||||
bool found = false;
|
||||
Unit::AuraList const& auras = m_target->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
|
||||
for(Unit::AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
||||
Unit::AuraMap& Auras = m_target->GetAuras();
|
||||
for(Unit::AuraMap::iterator i = Auras.begin(); i != Auras.end(); ++i)
|
||||
{
|
||||
SpellEntry const* itr_spell = (*itr)->GetSpellProto();
|
||||
if(itr_spell && itr_spell->SpellFamilyName==SPELLFAMILY_ROGUE && itr_spell->SpellFamilyFlags & 0x10000)
|
||||
SpellEntry const *auraSpellInfo = (*i).second->GetSpellProto();
|
||||
if(auraSpellInfo->SpellFamilyName == m_spellProto->SpellFamilyName &&
|
||||
auraSpellInfo->SpellFamilyFlags == m_spellProto->SpellFamilyFlags )
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// this has been last deadly poison aura
|
||||
// this has been last aura
|
||||
if(!found)
|
||||
m_target->ModifyAuraState(AURA_STATE_DEADLY_POISON,false);
|
||||
m_target->ModifyAuraState(AuraState(removeState), false);
|
||||
}
|
||||
|
||||
// reset cooldown state for spells
|
||||
|
|
|
|||
|
|
@ -254,6 +254,7 @@ enum SpellFamilyNames
|
|||
#define SPELLFAMILYFLAG_ROGUE_KIDNEYSHOT 0x000200000LL
|
||||
#define SPELLFAMILYFLAG_ROGUE__FINISHING_MOVE 0x9003E0000LL
|
||||
|
||||
#define SPELLFAMILYFLAG_PALADIN_SEALS 0x26000C000A000000LL
|
||||
// Spell clasification
|
||||
enum SpellSpecific
|
||||
{
|
||||
|
|
@ -302,7 +303,7 @@ inline bool IsSealSpell(SpellEntry const *spellInfo)
|
|||
{
|
||||
//Collection of all the seal family flags. No other paladin spell has any of those.
|
||||
return spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN &&
|
||||
( spellInfo->SpellFamilyFlags & 0x26000C000A000000LL );
|
||||
( spellInfo->SpellFamilyFlags & SPELLFAMILYFLAG_PALADIN_SEALS );
|
||||
}
|
||||
|
||||
inline bool IsElementalShield(SpellEntry const *spellInfo)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue