Core: Rename spell attributes, use more general names
--HG-- branch : trunk
This commit is contained in:
@@ -947,7 +947,7 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 dama
|
||||
if (damage < 0)
|
||||
return;
|
||||
|
||||
if (spellInfo->AttributesEx4 & SPELL_ATTR_EX4_FIXED_DAMAGE)
|
||||
if (spellInfo->AttributesEx4 & SPELL_ATTR4_FIXED_DAMAGE)
|
||||
{
|
||||
damageInfo->damage = damage;
|
||||
return;
|
||||
@@ -1438,7 +1438,7 @@ bool Unit::IsDamageReducedByArmor(SpellSchoolMask schoolMask, SpellEntry const *
|
||||
if (spellInfo)
|
||||
{
|
||||
// there are spells with no specific attribute but they have "ignores armor" in tooltip
|
||||
if (sSpellMgr.GetSpellCustomAttr(spellInfo->Id) & SPELL_ATTR_CU_IGNORE_ARMOR)
|
||||
if (sSpellMgr.GetSpellCustomAttr(spellInfo->Id) & SPELL_ATTR0_CU_IGNORE_ARMOR)
|
||||
return false;
|
||||
|
||||
// bleeding effects are not reduced by armor
|
||||
@@ -2648,10 +2648,10 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell)
|
||||
|
||||
bool canDodge = true;
|
||||
bool canParry = true;
|
||||
bool canBlock = spell->AttributesEx3 & SPELL_ATTR_EX3_BLOCKABLE_SPELL;
|
||||
bool canBlock = spell->AttributesEx3 & SPELL_ATTR3_BLOCKABLE_SPELL;
|
||||
|
||||
// Same spells cannot be parry/dodge
|
||||
if (spell->Attributes & SPELL_ATTR_IMPOSSIBLE_DODGE_PARRY_BLOCK)
|
||||
if (spell->Attributes & SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK)
|
||||
return SPELL_MISS_NONE;
|
||||
|
||||
// Chance resist mechanic
|
||||
@@ -3332,14 +3332,14 @@ bool Unit::IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled, bool skip
|
||||
(m_currentSpells[CURRENT_GENERIC_SPELL]->getState() != SPELL_STATE_FINISHED) &&
|
||||
(withDelayed || m_currentSpells[CURRENT_GENERIC_SPELL]->getState() != SPELL_STATE_DELAYED))
|
||||
{
|
||||
if (!isAutoshoot || !(m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_RESET_AUTO_ACTIONS))
|
||||
if (!isAutoshoot || !(m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->AttributesEx2 & SPELL_ATTR2_NOT_RESET_AUTO_ACTIONS))
|
||||
return(true);
|
||||
}
|
||||
// channeled spells may be delayed, but they are still considered casted
|
||||
else if (!skipChanneled && m_currentSpells[CURRENT_CHANNELED_SPELL] &&
|
||||
(m_currentSpells[CURRENT_CHANNELED_SPELL]->getState() != SPELL_STATE_FINISHED))
|
||||
{
|
||||
if (!isAutoshoot || !(m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_RESET_AUTO_ACTIONS))
|
||||
if (!isAutoshoot || !(m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->AttributesEx2 & SPELL_ATTR2_NOT_RESET_AUTO_ACTIONS))
|
||||
return(true);
|
||||
}
|
||||
// autorepeat spells may be finished or delayed, but they are still considered casted
|
||||
@@ -3939,7 +3939,7 @@ void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit
|
||||
Aura * aura = iter->second;
|
||||
if (aura->GetCasterGUID() == casterGUID)
|
||||
{
|
||||
if (aura->GetSpellProto()->AttributesEx7 & SPELL_ATTR_EX7_DISPEL_CHARGES)
|
||||
if (aura->GetSpellProto()->AttributesEx7 & SPELL_ATTR7_DISPEL_CHARGES)
|
||||
aura->DropCharge();
|
||||
else
|
||||
RemoveAuraFromStack(iter, AURA_REMOVE_BY_ENEMY_SPELL);
|
||||
@@ -4018,7 +4018,7 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit
|
||||
}
|
||||
}
|
||||
|
||||
bool stealCharge = aura->GetSpellProto()->AttributesEx7 & SPELL_ATTR_EX7_DISPEL_CHARGES;
|
||||
bool stealCharge = aura->GetSpellProto()->AttributesEx7 & SPELL_ATTR7_DISPEL_CHARGES;
|
||||
|
||||
if (stealCharge)
|
||||
aura->DropCharge();
|
||||
@@ -4268,9 +4268,9 @@ void Unit::RemoveArenaAuras(bool onleave)
|
||||
{
|
||||
AuraApplication const * aurApp = iter->second;
|
||||
Aura const * aura = aurApp->GetBase();
|
||||
if (!(aura->GetSpellProto()->AttributesEx4 & SPELL_ATTR_EX4_UNK21) // don't remove stances, shadowform, pally/hunter auras
|
||||
if (!(aura->GetSpellProto()->AttributesEx4 & SPELL_ATTR4_UNK21) // don't remove stances, shadowform, pally/hunter auras
|
||||
&& !aura->IsPassive() // don't remove passive auras
|
||||
&& (!(aura->GetSpellProto()->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) || !(aura->GetSpellProto()->Attributes & SPELL_ATTR_UNK8)) // not unaffected by invulnerability auras or not having that unknown flag (that seemed the most probable)
|
||||
&& (!(aura->GetSpellProto()->Attributes & SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY) || !(aura->GetSpellProto()->Attributes & SPELL_ATTR0_UNK8)) // not unaffected by invulnerability auras or not having that unknown flag (that seemed the most probable)
|
||||
&& (aurApp->IsPositive() ^ onleave)) // remove positive buffs on enter, negative buffs on leave
|
||||
RemoveAura(iter);
|
||||
else
|
||||
@@ -4888,7 +4888,7 @@ void Unit::AddGameObject(GameObject* gameObj)
|
||||
{
|
||||
SpellEntry const* createBySpell = sSpellStore.LookupEntry(gameObj->GetSpellId());
|
||||
// Need disable spell use for owner
|
||||
if (createBySpell && createBySpell->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE)
|
||||
if (createBySpell && createBySpell->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE)
|
||||
// note: item based cooldowns and cooldown spell mods with charges ignored (unknown existed cases)
|
||||
this->ToPlayer()->AddSpellAndCategoryCooldowns(createBySpell,0,NULL,true);
|
||||
}
|
||||
@@ -4918,7 +4918,7 @@ void Unit::RemoveGameObject(GameObject* gameObj, bool del)
|
||||
{
|
||||
SpellEntry const* createBySpell = sSpellStore.LookupEntry(spellid);
|
||||
// Need activate spell use for owner
|
||||
if (createBySpell && createBySpell->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE)
|
||||
if (createBySpell && createBySpell->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE)
|
||||
// note: item based cooldowns and cooldown spell mods with charges ignored (unknown existed cases)
|
||||
this->ToPlayer()->SendCooldownEvent(createBySpell);
|
||||
}
|
||||
@@ -9854,7 +9854,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
|
||||
{
|
||||
// Send infinity cooldown - client does that automatically but after relog cooldown needs to be set again
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(minion->GetUInt32Value(UNIT_CREATED_BY_SPELL));
|
||||
if (spellInfo && (spellInfo->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE))
|
||||
if (spellInfo && (spellInfo->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE))
|
||||
this->ToPlayer()->AddSpellAndCategoryCooldowns(spellInfo, 0, NULL ,true);
|
||||
}
|
||||
}
|
||||
@@ -9896,7 +9896,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
|
||||
{
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(minion->GetUInt32Value(UNIT_CREATED_BY_SPELL));
|
||||
// Remove infinity cooldown
|
||||
if (spellInfo && (spellInfo->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE))
|
||||
if (spellInfo && (spellInfo->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE))
|
||||
this->ToPlayer()->SendCooldownEvent(spellInfo);
|
||||
}
|
||||
|
||||
@@ -10744,7 +10744,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
|
||||
}
|
||||
|
||||
// Some spells don't benefit from done mods
|
||||
if (spellProto->AttributesEx3 & SPELL_ATTR_EX3_NO_DONE_BONUS)
|
||||
if (spellProto->AttributesEx3 & SPELL_ATTR3_NO_DONE_BONUS)
|
||||
{
|
||||
DoneTotal = 0;
|
||||
DoneTotalMod = 1.0f;
|
||||
@@ -10827,7 +10827,7 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
|
||||
return false;
|
||||
|
||||
// not critting spell
|
||||
if ((spellProto->AttributesEx2 & SPELL_ATTR_EX2_CANT_CRIT))
|
||||
if ((spellProto->AttributesEx2 & SPELL_ATTR2_CANT_CRIT))
|
||||
return false;
|
||||
|
||||
float crit_chance = 0.0f;
|
||||
@@ -11390,7 +11390,7 @@ bool Unit::IsImmunedToDamage(SpellSchoolMask shoolMask)
|
||||
|
||||
bool Unit::IsImmunedToDamage(SpellEntry const* spellInfo)
|
||||
{
|
||||
if (spellInfo->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY)
|
||||
if (spellInfo->Attributes & SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY)
|
||||
return false;
|
||||
|
||||
uint32 shoolMask = GetSpellSchoolMask(spellInfo);
|
||||
@@ -11423,7 +11423,7 @@ bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo)
|
||||
if (itr->type == spellInfo->Id)
|
||||
return true;
|
||||
|
||||
if (spellInfo->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY)
|
||||
if (spellInfo->Attributes & SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY)
|
||||
return false;
|
||||
|
||||
if (spellInfo->Dispel)
|
||||
@@ -11841,7 +11841,7 @@ void Unit::ApplySpellDispelImmunity(const SpellEntry * spellProto, DispelType ty
|
||||
{
|
||||
ApplySpellImmune(spellProto->Id,IMMUNITY_DISPEL, type, apply);
|
||||
|
||||
if (apply && spellProto->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY)
|
||||
if (apply && spellProto->AttributesEx & SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY)
|
||||
{
|
||||
// Create dispel mask by dispel type
|
||||
uint32 dispelMask = GetDispellMask(type);
|
||||
@@ -12984,9 +12984,9 @@ void Unit::ModSpellCastTime(SpellEntry const* spellProto, int32 & castTime, Spel
|
||||
if (Player* modOwner = GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_CASTING_TIME, castTime, spell);
|
||||
|
||||
if (!(spellProto->Attributes & (SPELL_ATTR_UNK4|SPELL_ATTR_TRADESPELL)) && spellProto->SpellFamilyName)
|
||||
if (!(spellProto->Attributes & (SPELL_ATTR0_UNK4|SPELL_ATTR0_TRADESPELL)) && spellProto->SpellFamilyName)
|
||||
castTime = int32(float(castTime) * GetFloatValue(UNIT_MOD_CAST_SPEED));
|
||||
else if (spellProto->Attributes & SPELL_ATTR_REQ_AMMO && !(spellProto->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG))
|
||||
else if (spellProto->Attributes & SPELL_ATTR0_REQ_AMMO && !(spellProto->AttributesEx2 & SPELL_ATTR2_AUTOREPEAT_FLAG))
|
||||
castTime = int32(float(castTime) * m_modAttackSpeedPct[RANGED_ATTACK]);
|
||||
else if (spellProto->SpellVisual[0] == 3881 && HasAura(67556)) // cooking with Chef Hat.
|
||||
castTime = 500;
|
||||
@@ -13753,7 +13753,7 @@ void CharmInfo::InitPossessCreateSpells()
|
||||
{
|
||||
uint32 spellId = m_unit->ToCreature()->m_spells[i];
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
|
||||
if (spellInfo && spellInfo->Attributes & SPELL_ATTR_CASTABLE_WHILE_DEAD)
|
||||
if (spellInfo && spellInfo->Attributes & SPELL_ATTR0_CASTABLE_WHILE_DEAD)
|
||||
spellId = 0;
|
||||
if (IsPassiveSpell(spellId))
|
||||
m_unit->CastSpell(m_unit, spellId, true);
|
||||
@@ -13777,7 +13777,7 @@ void CharmInfo::InitCharmCreateSpells()
|
||||
{
|
||||
uint32 spellId = m_unit->ToCreature()->m_spells[x];
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
|
||||
if (spellInfo && spellInfo->Attributes & SPELL_ATTR_CASTABLE_WHILE_DEAD)
|
||||
if (spellInfo && spellInfo->Attributes & SPELL_ATTR0_CASTABLE_WHILE_DEAD)
|
||||
spellId = 0;
|
||||
|
||||
if (!spellId)
|
||||
@@ -14148,7 +14148,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag,
|
||||
continue;
|
||||
|
||||
// Triggered spells not triggering additional spells
|
||||
bool triggered= !(spellProto->AttributesEx3 & SPELL_ATTR_EX3_CAN_PROC_TRIGGERED) ?
|
||||
bool triggered= !(spellProto->AttributesEx3 & SPELL_ATTR3_CAN_PROC_TRIGGERED) ?
|
||||
(procExtra & PROC_EX_INTERNAL_TRIGGERED && !(procFlag & PROC_FLAG_DONE_TRAP_ACTIVATION)) : false;
|
||||
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
@@ -14195,7 +14195,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag,
|
||||
if (GetTypeId() == TYPEID_PLAYER && i->spellProcEvent && i->spellProcEvent->cooldown)
|
||||
cooldown = i->spellProcEvent->cooldown;
|
||||
|
||||
if (spellInfo->AttributesEx3 & SPELL_ATTR_EX3_DISABLE_PROC)
|
||||
if (spellInfo->AttributesEx3 & SPELL_ATTR3_DISABLE_PROC)
|
||||
SetCantProc(true);
|
||||
|
||||
// This bool is needed till separate aura effect procs are still here
|
||||
@@ -14377,7 +14377,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag,
|
||||
if (useCharges && takeCharges)
|
||||
i->aura->DropCharge();
|
||||
|
||||
if (spellInfo->AttributesEx3 & SPELL_ATTR_EX3_DISABLE_PROC)
|
||||
if (spellInfo->AttributesEx3 & SPELL_ATTR3_DISABLE_PROC)
|
||||
SetCantProc(false);
|
||||
}
|
||||
|
||||
@@ -14939,7 +14939,7 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura * aura, SpellEntry co
|
||||
// Additional checks for triggered spells (ignore trap casts)
|
||||
if (procExtra & PROC_EX_INTERNAL_TRIGGERED && !(procFlag & PROC_FLAG_DONE_TRAP_ACTIVATION))
|
||||
{
|
||||
if (!(spellProto->AttributesEx3 & SPELL_ATTR_EX3_CAN_PROC_TRIGGERED))
|
||||
if (!(spellProto->AttributesEx3 & SPELL_ATTR3_CAN_PROC_TRIGGERED))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -552,7 +552,7 @@ enum UnitFlags
|
||||
UNIT_FLAG_DISABLE_MOVE = 0x00000004,
|
||||
UNIT_FLAG_PVP_ATTACKABLE = 0x00000008, // allow apply pvp rules to attackable state in addition to faction dependent state
|
||||
UNIT_FLAG_RENAME = 0x00000010,
|
||||
UNIT_FLAG_PREPARATION = 0x00000020, // don't take reagents for spells with SPELL_ATTR_EX5_NO_REAGENT_WHILE_PREP
|
||||
UNIT_FLAG_PREPARATION = 0x00000020, // don't take reagents for spells with SPELL_ATTR5_NO_REAGENT_WHILE_PREP
|
||||
UNIT_FLAG_UNK_6 = 0x00000040,
|
||||
UNIT_FLAG_NOT_ATTACKABLE_1 = 0x00000080, // ?? (UNIT_FLAG_PVP_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1) is NON_PVP_ATTACKABLE
|
||||
UNIT_FLAG_OOC_NOT_ATTACKABLE = 0x00000100, // 2.0.8 - (OOC Out Of Combat) Can not be attacked when not in combat. Removed if unit for some reason enter combat.
|
||||
|
||||
Reference in New Issue
Block a user