mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
Replace values by defines
Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
parent
fdfd9c647a
commit
59861857e5
4 changed files with 16 additions and 13 deletions
|
|
@ -363,7 +363,7 @@ Spell::Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 origi
|
|||
// determine reflection
|
||||
m_canReflect = false;
|
||||
|
||||
if(m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC && (m_spellInfo->AttributesEx2 & 0x4)==0)
|
||||
if(m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC && !(m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_CANT_REFLECTED))
|
||||
{
|
||||
for(int j=0;j<3;j++)
|
||||
{
|
||||
|
|
@ -373,7 +373,7 @@ Spell::Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 origi
|
|||
if(!IsPositiveTarget(m_spellInfo->EffectImplicitTargetA[j],m_spellInfo->EffectImplicitTargetB[j]))
|
||||
m_canReflect = true;
|
||||
else
|
||||
m_canReflect = (m_spellInfo->AttributesEx & (1<<7)) ? true : false;
|
||||
m_canReflect = (m_spellInfo->AttributesEx & SPELL_ATTR_EX_NEGATIVE) ? true : false;
|
||||
|
||||
if(m_canReflect)
|
||||
continue;
|
||||
|
|
@ -4602,15 +4602,16 @@ uint8 Spell::CheckCasterAuras() const
|
|||
//Check whether the cast should be prevented by any state you might have.
|
||||
uint8 prevented_reason = 0;
|
||||
// Have to check if there is a stun aura. Otherwise will have problems with ghost aura apply while logging out
|
||||
if(!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_STUNNED) && m_caster->HasAuraType(SPELL_AURA_MOD_STUN))
|
||||
uint32 unitflag = m_caster->GetUInt32Value(UNIT_FIELD_FLAGS); // Get unit state
|
||||
if(unitflag & UNIT_FLAG_STUNNED && !(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_STUNNED))
|
||||
prevented_reason = SPELL_FAILED_STUNNED;
|
||||
else if(m_caster->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED) && !(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_CONFUSED))
|
||||
else if(unitflag & UNIT_FLAG_CONFUSED && !(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_CONFUSED))
|
||||
prevented_reason = SPELL_FAILED_CONFUSED;
|
||||
else if(m_caster->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING) && !(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_FEARED))
|
||||
else if(unitflag & UNIT_FLAG_FLEEING && !(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_FEARED))
|
||||
prevented_reason = SPELL_FAILED_FLEEING;
|
||||
else if(m_caster->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED) && m_spellInfo->PreventionType==SPELL_PREVENTION_TYPE_SILENCE)
|
||||
else if(unitflag & UNIT_FLAG_SILENCED && m_spellInfo->PreventionType==SPELL_PREVENTION_TYPE_SILENCE)
|
||||
prevented_reason = SPELL_FAILED_SILENCED;
|
||||
else if(m_caster->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED) && m_spellInfo->PreventionType==SPELL_PREVENTION_TYPE_PACIFY)
|
||||
else if(unitflag & UNIT_FLAG_PACIFIED && m_spellInfo->PreventionType==SPELL_PREVENTION_TYPE_PACIFY)
|
||||
prevented_reason = SPELL_FAILED_PACIFIED;
|
||||
|
||||
// Attr must make flag drop spell totally immune from all effects
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue