mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[11633] Implement function Unit::HasAffectedAura
This commit is contained in:
parent
54f623d2b8
commit
3443a97a28
5 changed files with 27 additions and 24 deletions
|
|
@ -4526,19 +4526,10 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||||
}
|
}
|
||||||
// only check at first call, Stealth auras are already removed at second call
|
// only check at first call, Stealth auras are already removed at second call
|
||||||
// for now, ignore triggered spells
|
// for now, ignore triggered spells
|
||||||
if( strict && !m_IsTriggeredSpell)
|
if (strict && !m_IsTriggeredSpell)
|
||||||
{
|
{
|
||||||
bool checkForm = true;
|
|
||||||
// Ignore form req aura
|
// Ignore form req aura
|
||||||
Unit::AuraList const& ignore = m_caster->GetAurasByType(SPELL_AURA_MOD_IGNORE_SHAPESHIFT);
|
if (!m_caster->HasAffectedAura(SPELL_AURA_MOD_IGNORE_SHAPESHIFT, m_spellInfo))
|
||||||
for(Unit::AuraList::const_iterator i = ignore.begin(); i != ignore.end(); ++i)
|
|
||||||
{
|
|
||||||
if (!(*i)->isAffectedOnSpell(m_spellInfo))
|
|
||||||
continue;
|
|
||||||
checkForm = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (checkForm)
|
|
||||||
{
|
{
|
||||||
// Cannot be used in this stance/form
|
// Cannot be used in this stance/form
|
||||||
SpellCastResult shapeError = GetErrorAtShapeshiftedCast(m_spellInfo, m_caster->GetShapeshiftForm());
|
SpellCastResult shapeError = GetErrorAtShapeshiftedCast(m_spellInfo, m_caster->GetShapeshiftForm());
|
||||||
|
|
|
||||||
|
|
@ -8282,17 +8282,15 @@ void Aura::HandleAuraSafeFall( bool Apply, bool Real )
|
||||||
|
|
||||||
bool Aura::IsCritFromAbilityAura(Unit* caster, uint32& damage)
|
bool Aura::IsCritFromAbilityAura(Unit* caster, uint32& damage)
|
||||||
{
|
{
|
||||||
Unit::AuraList const& auras = caster->GetAurasByType(SPELL_AURA_ABILITY_PERIODIC_CRIT);
|
if (!caster->HasAffectedAura(SPELL_AURA_ABILITY_PERIODIC_CRIT, GetSpellProto()))
|
||||||
for(Unit::AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
return false;
|
||||||
{
|
|
||||||
if (!(*itr)->isAffectedOnSpell(GetSpellProto()))
|
|
||||||
continue;
|
|
||||||
if (!caster->IsSpellCrit(GetTarget(), GetSpellProto(), GetSpellSchoolMask(GetSpellProto())))
|
|
||||||
break;
|
|
||||||
|
|
||||||
|
if (caster->IsSpellCrit(GetTarget(), GetSpellProto(), GetSpellSchoolMask(GetSpellProto())))
|
||||||
|
{
|
||||||
damage = caster->SpellCriticalDamageBonus(GetSpellProto(), damage, GetTarget());
|
damage = caster->SpellCriticalDamageBonus(GetSpellProto(), damage, GetTarget());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -488,11 +488,6 @@ void Unit::RemoveSpellsCausingAura(AuraType auraType, SpellAuraHolder* except)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Unit::HasAuraType(AuraType auraType) const
|
|
||||||
{
|
|
||||||
return (!m_modAuras[auraType].empty());
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Called by DealDamage for auras that have a chance to be dispelled on damage taken. */
|
/* Called by DealDamage for auras that have a chance to be dispelled on damage taken. */
|
||||||
void Unit::RemoveSpellbyDamageTaken(AuraType auraType, uint32 damage)
|
void Unit::RemoveSpellbyDamageTaken(AuraType auraType, uint32 damage)
|
||||||
{
|
{
|
||||||
|
|
@ -4919,6 +4914,24 @@ void Unit::_ApplyAllAuraMods()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Unit::HasAuraType(AuraType auraType) const
|
||||||
|
{
|
||||||
|
return !GetAurasByType(auraType).empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Unit::HasAffectedAura(AuraType auraType, SpellEntry const* spellProto) const
|
||||||
|
{
|
||||||
|
Unit::AuraList const& auras = GetAurasByType(auraType);
|
||||||
|
|
||||||
|
for (Unit::AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
||||||
|
{
|
||||||
|
if ((*itr)->isAffectedOnSpell(spellProto))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Aura* Unit::GetAura(uint32 spellId, SpellEffectIndex effindex)
|
Aura* Unit::GetAura(uint32 spellId, SpellEffectIndex effindex)
|
||||||
{
|
{
|
||||||
SpellAuraHolderBounds bounds = GetSpellAuraHolderBounds(spellId);
|
SpellAuraHolderBounds bounds = GetSpellAuraHolderBounds(spellId);
|
||||||
|
|
|
||||||
|
|
@ -1411,6 +1411,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HasAuraType(AuraType auraType) const;
|
bool HasAuraType(AuraType auraType) const;
|
||||||
|
bool HasAffectedAura(AuraType auraType, SpellEntry const* spellProto) const;
|
||||||
bool HasAura(uint32 spellId, SpellEffectIndex effIndex) const;
|
bool HasAura(uint32 spellId, SpellEffectIndex effIndex) const;
|
||||||
bool HasAura(uint32 spellId) const
|
bool HasAura(uint32 spellId) const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11632"
|
#define REVISION_NR "11633"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue