mirror of
https://github.com/mangosfour/server.git
synced 2025-12-31 13:37:07 +00:00
[11977] More uses of wrappers introduced in 11971
Also fix a typo that caused problems with Stances Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
parent
8433b67599
commit
e29e640341
7 changed files with 35 additions and 37 deletions
|
|
@ -432,7 +432,7 @@ m_isPersistent(false), m_in_use(0), m_spellAuraHolder(holder)
|
|||
modOwner->ApplySpellMod(spellproto->Id, SPELLMOD_ACTIVATION_TIME, m_modifier.periodictime);
|
||||
|
||||
// Start periodic on next tick or at aura apply
|
||||
if (!(spellproto->AttributesEx5 & SPELL_ATTR_EX5_START_PERIODIC_AT_APPLY))
|
||||
if (!spellproto->HasAttribute(SPELL_ATTR_EX5_START_PERIODIC_AT_APPLY))
|
||||
m_periodicTimer = m_modifier.periodictime;
|
||||
}
|
||||
|
||||
|
|
@ -4982,7 +4982,7 @@ void Aura::HandleModMechanicImmunity(bool apply, bool /*Real*/)
|
|||
|
||||
Unit *target = GetTarget();
|
||||
|
||||
if (apply && GetSpellProto()->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY)
|
||||
if (apply && GetSpellProto()->HasAttribute(SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY))
|
||||
{
|
||||
uint32 mechanic = 1 << (misc-1);
|
||||
|
||||
|
|
@ -5025,7 +5025,7 @@ void Aura::HandleModMechanicImmunityMask(bool apply, bool /*Real*/)
|
|||
{
|
||||
uint32 mechanic = m_modifier.m_miscvalue;
|
||||
|
||||
if(apply && GetSpellProto()->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY)
|
||||
if (apply && GetSpellProto()->HasAttribute(SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY))
|
||||
GetTarget()->RemoveAurasAtMechanicImmunity(mechanic,GetId());
|
||||
|
||||
// check implemented in Unit::IsImmuneToSpell and Unit::IsImmuneToSpellEffect
|
||||
|
|
@ -5049,7 +5049,7 @@ void Aura::HandleAuraModEffectImmunity(bool apply, bool /*Real*/)
|
|||
|
||||
void Aura::HandleAuraModStateImmunity(bool apply, bool Real)
|
||||
{
|
||||
if(apply && Real && GetSpellProto()->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY)
|
||||
if (apply && Real && GetSpellProto()->HasAttribute(SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY))
|
||||
{
|
||||
Unit::AuraList const& auraList = GetTarget()->GetAurasByType(AuraType(m_modifier.m_miscvalue));
|
||||
for(Unit::AuraList::const_iterator itr = auraList.begin(); itr != auraList.end();)
|
||||
|
|
@ -5073,14 +5073,13 @@ void Aura::HandleAuraModSchoolImmunity(bool apply, bool Real)
|
|||
target->ApplySpellImmune(GetId(), IMMUNITY_SCHOOL, m_modifier.m_miscvalue, apply);
|
||||
|
||||
// remove all flag auras (they are positive, but they must be removed when you are immune)
|
||||
if( GetSpellProto()->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY
|
||||
&& GetSpellProto()->AttributesEx2 & SPELL_ATTR_EX2_DAMAGE_REDUCED_SHIELD )
|
||||
if (GetSpellProto()->HasAttribute(SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY) && GetSpellProto()->HasAttribute(SPELL_ATTR_EX2_DAMAGE_REDUCED_SHIELD))
|
||||
target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION);
|
||||
|
||||
// TODO: optimalize this cycle - use RemoveAurasWithInterruptFlags call or something else
|
||||
if( Real && apply
|
||||
&& GetSpellProto()->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY
|
||||
&& IsPositiveSpell(GetId()) ) //Only positive immunity removes auras
|
||||
if (Real && apply
|
||||
&& GetSpellProto()->HasAttribute(SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY)
|
||||
&& IsPositiveSpell(GetId())) // Only positive immunity removes auras
|
||||
{
|
||||
uint32 school_mask = m_modifier.m_miscvalue;
|
||||
Unit::SpellAuraHolderMap& Auras = target->GetSpellAuraHolderMap();
|
||||
|
|
@ -5089,10 +5088,10 @@ void Aura::HandleAuraModSchoolImmunity(bool apply, bool Real)
|
|||
next = iter;
|
||||
++next;
|
||||
SpellEntry const *spell = iter->second->GetSpellProto();
|
||||
if((GetSpellSchoolMask(spell) & school_mask)//Check for school mask
|
||||
&& !( spell->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) //Spells unaffected by invulnerability
|
||||
&& !iter->second->IsPositive() //Don't remove positive spells
|
||||
&& spell->Id != GetId() ) //Don't remove self
|
||||
if ((GetSpellSchoolMask(spell) & school_mask) // Check for school mask
|
||||
&& !spell->HasAttribute(SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) //Spells unaffected by invulnerability
|
||||
&& !iter->second->IsPositive() // Don't remove positive spells
|
||||
&& spell->Id != GetId() ) // Don't remove self
|
||||
{
|
||||
target->RemoveAurasDueToSpell(spell->Id);
|
||||
if(Auras.empty())
|
||||
|
|
@ -5786,7 +5785,7 @@ void Aura::HandleModTotalPercentStat(bool apply, bool /*Real*/)
|
|||
}
|
||||
|
||||
//recalculate current HP/MP after applying aura modifications (only for spells with 0x10 flag)
|
||||
if ((m_modifier.m_miscvalue == STAT_STAMINA) && (maxHPValue > 0) && (GetSpellProto()->Attributes & 0x10))
|
||||
if (m_modifier.m_miscvalue == STAT_STAMINA && maxHPValue > 0 && GetSpellProto()->HasAttribute(SPELL_ATTR_UNK4))
|
||||
{
|
||||
// newHP = (curHP / maxHP) * newMaxHP = (newMaxHP * curHP) / maxHP -> which is better because no int -> double -> int conversion is needed
|
||||
uint32 newHPValue = (target->GetMaxHealth() * curHPValue) / maxHPValue;
|
||||
|
|
@ -6584,7 +6583,7 @@ void Aura::HandleShapeshiftBoosts(bool apply)
|
|||
for (Unit::SpellAuraHolderMap::iterator itr = tAuras.begin(); itr != tAuras.end();)
|
||||
{
|
||||
SpellEntry const *spellInfo = itr->second->GetSpellProto();
|
||||
if (itr->second->IsPassive() && (spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT)
|
||||
if (itr->second->IsPassive() && spellInfo->HasAttribute(SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT)
|
||||
&& (spellInfo->StancesNot & (1<<(form-1))))
|
||||
{
|
||||
target->RemoveAurasDueToSpell(itr->second->GetId());
|
||||
|
|
@ -6705,7 +6704,7 @@ void Aura::HandleShapeshiftBoosts(bool apply)
|
|||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first);
|
||||
if (!spellInfo || !IsPassiveSpell(spellInfo))
|
||||
continue;
|
||||
if ((spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT) && spellInfo->StancesNot & (1<<(form-1)))
|
||||
if (spellInfo->HasAttribute(SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT) && (spellInfo->StancesNot & (1<<(form-1))))
|
||||
target->CastSpell(target, itr->first, true, NULL, this);
|
||||
}
|
||||
}
|
||||
|
|
@ -7186,7 +7185,7 @@ void Aura::PeriodicTick()
|
|||
if (pCaster->GetTypeId() == TYPEID_PLAYER)
|
||||
pdamage -= target->GetSpellDamageReduction(pdamage);
|
||||
|
||||
target->CalculateDamageAbsorbAndResist(pCaster, GetSpellSchoolMask(spellProto), DOT, pdamage, &absorb, &resist, !(GetSpellProto()->AttributesEx2 & SPELL_ATTR_EX2_CANT_REFLECTED));
|
||||
target->CalculateDamageAbsorbAndResist(pCaster, GetSpellSchoolMask(spellProto), DOT, pdamage, &absorb, &resist, !GetSpellProto()->HasAttribute(SPELL_ATTR_EX2_CANT_REFLECTED));
|
||||
|
||||
DETAIL_FILTER_LOG(LOG_FILTER_PERIODIC_AFFECTS, "PeriodicTick: %s attacked %s for %u dmg inflicted by %u abs is %u",
|
||||
GetCasterGuid().GetString().c_str(), target->GetGuidStr().c_str(), pdamage, GetId(),absorb);
|
||||
|
|
@ -7278,7 +7277,7 @@ void Aura::PeriodicTick()
|
|||
if (GetCasterGuid().IsPlayer())
|
||||
pdamage -= target->GetSpellDamageReduction(pdamage);
|
||||
|
||||
target->CalculateDamageAbsorbAndResist(pCaster, GetSpellSchoolMask(spellProto), DOT, pdamage, &absorb, &resist, !(spellProto->AttributesEx2 & SPELL_ATTR_EX2_CANT_REFLECTED));
|
||||
target->CalculateDamageAbsorbAndResist(pCaster, GetSpellSchoolMask(spellProto), DOT, pdamage, &absorb, &resist, !spellProto->HasAttribute(SPELL_ATTR_EX2_CANT_REFLECTED));
|
||||
|
||||
DETAIL_FILTER_LOG(LOG_FILTER_PERIODIC_AFFECTS, "PeriodicTick: %s health leech of %s for %u dmg inflicted by %u abs is %u",
|
||||
GetCasterGuid().GetString().c_str(), target->GetGuidStr().c_str(), pdamage, GetId(),absorb);
|
||||
|
|
@ -8579,8 +8578,8 @@ m_permanent(false), m_isRemovedOnShapeLost(true), m_deleted(false), m_in_use(0)
|
|||
|
||||
m_isRemovedOnShapeLost = (GetCasterGuid() == m_target->GetObjectGuid() &&
|
||||
m_spellProto->Stances &&
|
||||
!(m_spellProto->AttributesEx2 & SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT) &&
|
||||
!(m_spellProto->Attributes & SPELL_ATTR_NOT_SHAPESHIFT));
|
||||
!m_spellProto->HasAttribute(SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT) &&
|
||||
!m_spellProto->HasAttribute(SPELL_ATTR_NOT_SHAPESHIFT));
|
||||
|
||||
Unit* unitCaster = caster && caster->isType(TYPEMASK_UNIT) ? (Unit*)caster : NULL;
|
||||
|
||||
|
|
@ -8669,7 +8668,7 @@ void SpellAuraHolder::_AddSpellAuraHolder()
|
|||
// set infinity cooldown state for spells
|
||||
if(caster && caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (m_spellProto->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE)
|
||||
if (m_spellProto->HasAttribute(SPELL_ATTR_DISABLED_WHILE_ACTIVE))
|
||||
{
|
||||
Item* castItem = m_castItemGuid ? ((Player*)caster)->GetItemByGuid(m_castItemGuid) : NULL;
|
||||
((Player*)caster)->AddSpellAndCategoryCooldowns(m_spellProto,castItem ? castItem->GetEntry() : 0, NULL,true);
|
||||
|
|
@ -8877,7 +8876,7 @@ void SpellAuraHolder::_RemoveSpellAuraHolder()
|
|||
// reset cooldown state for spells
|
||||
if(caster && caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if ( GetSpellProto()->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE )
|
||||
if (GetSpellProto()->HasAttribute(SPELL_ATTR_DISABLED_WHILE_ACTIVE))
|
||||
// note: item based cooldowns and cooldown spell mods with charges ignored (unknown existing cases)
|
||||
((Player*)caster)->SendCooldownEvent(GetSpellProto());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue