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