mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-29 13:22:48 +01:00
Core: Rename spell attributes, use more general names
--HG-- branch : trunk
This commit is contained in:
@@ -441,7 +441,7 @@ m_caster(Caster), m_spellValue(new SpellValue(m_spellInfo))
|
||||
switch (m_spellInfo->DmgClass)
|
||||
{
|
||||
case SPELL_DAMAGE_CLASS_MELEE:
|
||||
if (m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_REQ_OFFHAND)
|
||||
if (m_spellInfo->AttributesEx3 & SPELL_ATTR3_REQ_OFFHAND)
|
||||
m_attackType = OFF_ATTACK;
|
||||
else
|
||||
m_attackType = BASE_ATTACK;
|
||||
@@ -451,7 +451,7 @@ m_caster(Caster), m_spellValue(new SpellValue(m_spellInfo))
|
||||
break;
|
||||
default:
|
||||
// Wands
|
||||
if (m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG)
|
||||
if (m_spellInfo->AttributesEx2 & SPELL_ATTR2_AUTOREPEAT_FLAG)
|
||||
m_attackType = RANGED_ATTACK;
|
||||
else
|
||||
m_attackType = BASE_ATTACK;
|
||||
@@ -485,7 +485,7 @@ m_caster(Caster), m_spellValue(new SpellValue(m_spellInfo))
|
||||
|
||||
m_spellState = SPELL_STATE_NULL;
|
||||
|
||||
m_IsTriggeredSpell = bool(triggered || (info->AttributesEx4 & SPELL_ATTR_EX4_TRIGGERED));
|
||||
m_IsTriggeredSpell = bool(triggered || (info->AttributesEx4 & SPELL_ATTR4_TRIGGERED));
|
||||
m_CastItem = NULL;
|
||||
|
||||
unitTarget = NULL;
|
||||
@@ -511,7 +511,7 @@ m_caster(Caster), m_spellValue(new SpellValue(m_spellInfo))
|
||||
// determine reflection
|
||||
m_canReflect = false;
|
||||
|
||||
if (m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC && !IsAreaOfEffectSpell(m_spellInfo) && !(m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_CANT_REFLECTED))
|
||||
if (m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC && !IsAreaOfEffectSpell(m_spellInfo) && !(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CANT_REFLECTED))
|
||||
{
|
||||
for (int j = 0; j < MAX_SPELL_EFFECTS; ++j)
|
||||
{
|
||||
@@ -521,7 +521,7 @@ m_caster(Caster), m_spellValue(new SpellValue(m_spellInfo))
|
||||
if (!IsPositiveTarget(m_spellInfo->EffectImplicitTargetA[j], m_spellInfo->EffectImplicitTargetB[j]))
|
||||
m_canReflect = true;
|
||||
else
|
||||
m_canReflect = (m_spellInfo->AttributesEx & SPELL_ATTR_EX_NEGATIVE) ? true : false;
|
||||
m_canReflect = (m_spellInfo->AttributesEx & SPELL_ATTR1_NEGATIVE) ? true : false;
|
||||
|
||||
if (m_canReflect)
|
||||
continue;
|
||||
@@ -758,7 +758,7 @@ void Spell::SelectSpellTargets()
|
||||
break;
|
||||
case SPELL_EFFECT_APPLY_AREA_AURA_PARTY:
|
||||
// AreaAura
|
||||
if (m_spellInfo->Attributes & (SPELL_ATTR_CASTABLE_WHILE_SITTING | SPELL_ATTR_CASTABLE_WHILE_MOUNTED | SPELL_ATTR_UNK18 | SPELL_ATTR_NOT_SHAPESHIFT) || m_spellInfo->Attributes == SPELL_ATTR_NOT_SHAPESHIFT)
|
||||
if (m_spellInfo->Attributes & (SPELL_ATTR0_CASTABLE_WHILE_SITTING | SPELL_ATTR0_CASTABLE_WHILE_MOUNTED | SPELL_ATTR0_UNK18 | SPELL_ATTR0_NOT_SHAPESHIFT) || m_spellInfo->Attributes == SPELL_ATTR0_NOT_SHAPESHIFT)
|
||||
SelectEffectTargets(i, TARGET_UNIT_PARTY_TARGET);
|
||||
break;
|
||||
case SPELL_EFFECT_SKIN_PLAYER_CORPSE:
|
||||
@@ -857,7 +857,7 @@ void Spell::prepareDataForTriggerSystem(AuraEffect const * /*triggeredByAura*/)
|
||||
break;
|
||||
case SPELL_DAMAGE_CLASS_RANGED:
|
||||
// Auto attack
|
||||
if (m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG)
|
||||
if (m_spellInfo->AttributesEx2 & SPELL_ATTR2_AUTOREPEAT_FLAG)
|
||||
{
|
||||
m_procAttacker = PROC_FLAG_DONE_RANGED_AUTO_ATTACK;
|
||||
m_procVictim = PROC_FLAG_TAKEN_RANGED_AUTO_ATTACK;
|
||||
@@ -871,7 +871,7 @@ void Spell::prepareDataForTriggerSystem(AuraEffect const * /*triggeredByAura*/)
|
||||
default:
|
||||
if (m_spellInfo->EquippedItemClass == ITEM_CLASS_WEAPON &&
|
||||
m_spellInfo->EquippedItemSubClassMask & (1<<ITEM_SUBCLASS_WEAPON_WAND)
|
||||
&& m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG) // Wands auto attack
|
||||
&& m_spellInfo->AttributesEx2 & SPELL_ATTR2_AUTOREPEAT_FLAG) // Wands auto attack
|
||||
{
|
||||
m_procAttacker = PROC_FLAG_DONE_RANGED_AUTO_ATTACK;
|
||||
m_procVictim = PROC_FLAG_TAKEN_RANGED_AUTO_ATTACK;
|
||||
@@ -905,8 +905,8 @@ void Spell::prepareDataForTriggerSystem(AuraEffect const * /*triggeredByAura*/)
|
||||
if (!(m_procAttacker & PROC_FLAG_DONE_RANGED_AUTO_ATTACK))
|
||||
{
|
||||
if (m_IsTriggeredSpell &&
|
||||
(m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_TRIGGERED_CAN_TRIGGER ||
|
||||
m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_TRIGGERED_CAN_TRIGGER_2))
|
||||
(m_spellInfo->AttributesEx2 & SPELL_ATTR2_TRIGGERED_CAN_TRIGGER ||
|
||||
m_spellInfo->AttributesEx3 & SPELL_ATTR3_TRIGGERED_CAN_TRIGGER_2))
|
||||
m_procEx |= PROC_EX_INTERNAL_CANT_PROC;
|
||||
else if (m_IsTriggeredSpell)
|
||||
m_procEx |= PROC_EX_INTERNAL_TRIGGERED;
|
||||
@@ -1168,7 +1168,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
||||
|
||||
//Spells with this flag cannot trigger if effect is casted on self
|
||||
// Slice and Dice, relentless strikes, eviscerate
|
||||
bool canEffectTrigger = unitTarget->CanProc() && (m_spellInfo->AttributesEx4 & (SPELL_ATTR_EX4_CANT_PROC_FROM_SELFCAST) ? m_caster != unitTarget : true);
|
||||
bool canEffectTrigger = unitTarget->CanProc() && (m_spellInfo->AttributesEx4 & (SPELL_ATTR4_CANT_PROC_FROM_SELFCAST) ? m_caster != unitTarget : true);
|
||||
Unit * spellHitTarget = NULL;
|
||||
|
||||
if (missInfo == SPELL_MISS_NONE) // In case spell hit target, do all effect on that target
|
||||
@@ -1296,7 +1296,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
||||
if (canEffectTrigger && missInfo != SPELL_MISS_REFLECT)
|
||||
{
|
||||
caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo, m_triggeredByAuraSpell);
|
||||
if (caster->GetTypeId() == TYPEID_PLAYER && (m_spellInfo->Attributes & SPELL_ATTR_STOP_ATTACK_TARGET) == 0 &&
|
||||
if (caster->GetTypeId() == TYPEID_PLAYER && (m_spellInfo->Attributes & SPELL_ATTR0_STOP_ATTACK_TARGET) == 0 &&
|
||||
(m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MELEE || m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_RANGED))
|
||||
caster->ToPlayer()->CastItemCombatSpell(unitTarget, m_attackType, procVictim, procEx);
|
||||
}
|
||||
@@ -1322,7 +1322,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
||||
|
||||
// Failed Pickpocket, reveal rogue
|
||||
if (missInfo == SPELL_MISS_RESIST
|
||||
&& m_customAttr & SPELL_ATTR_CU_PICKPOCKET
|
||||
&& m_customAttr & SPELL_ATTR0_CU_PICKPOCKET
|
||||
&& unitTarget->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
m_caster->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK);
|
||||
@@ -1333,9 +1333,9 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
||||
|
||||
if (missInfo != SPELL_MISS_EVADE && m_caster && !m_caster->IsFriendlyTo(unit) && !IsPositiveSpell(m_spellInfo->Id))
|
||||
{
|
||||
m_caster->CombatStart(unit, !(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_NO_INITIAL_AGGRO));
|
||||
m_caster->CombatStart(unit, !(m_spellInfo->AttributesEx3 & SPELL_ATTR3_NO_INITIAL_AGGRO));
|
||||
|
||||
if (m_customAttr & SPELL_ATTR_CU_AURA_CC)
|
||||
if (m_customAttr & SPELL_ATTR0_CU_AURA_CC)
|
||||
if (!unit->IsStandState())
|
||||
unit->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
}
|
||||
@@ -1411,7 +1411,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool
|
||||
{
|
||||
unit->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_HITBYSPELL);
|
||||
//TODO: This is a hack. But we do not know what types of stealth should be interrupted by CC
|
||||
if ((m_customAttr & SPELL_ATTR_CU_AURA_CC) && unit->IsControlledByPlayer())
|
||||
if ((m_customAttr & SPELL_ATTR0_CU_AURA_CC) && unit->IsControlledByPlayer())
|
||||
unit->RemoveAurasByType(SPELL_AURA_MOD_STEALTH);
|
||||
}
|
||||
else
|
||||
@@ -1430,7 +1430,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
m_caster->ToPlayer()->UpdatePvP(true);
|
||||
}
|
||||
if (unit->isInCombat() && !(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_NO_INITIAL_AGGRO))
|
||||
if (unit->isInCombat() && !(m_spellInfo->AttributesEx3 & SPELL_ATTR3_NO_INITIAL_AGGRO))
|
||||
{
|
||||
m_caster->SetInCombatState(unit->GetCombatTimer() > 0, unit);
|
||||
unit->getHostileRefManager().threatAssist(m_caster, 0.0f);
|
||||
@@ -1554,7 +1554,7 @@ void Spell::DoTriggersOnSpellHit(Unit *unit)
|
||||
}
|
||||
|
||||
// spells with this flag can trigger only if not selfcast (eviscerate for example)
|
||||
if (m_ChanceTriggerSpells.size() && (!((m_spellInfo->AttributesEx4 & SPELL_ATTR_EX4_CANT_PROC_FROM_SELFCAST) && unit == m_caster)))
|
||||
if (m_ChanceTriggerSpells.size() && (!((m_spellInfo->AttributesEx4 & SPELL_ATTR4_CANT_PROC_FROM_SELFCAST) && unit == m_caster)))
|
||||
{
|
||||
int _duration=0;
|
||||
for (ChanceTriggerSpells::const_iterator i = m_ChanceTriggerSpells.begin(); i != m_ChanceTriggerSpells.end(); ++i)
|
||||
@@ -1582,7 +1582,7 @@ void Spell::DoTriggersOnSpellHit(Unit *unit)
|
||||
}
|
||||
}
|
||||
|
||||
if (m_customAttr & SPELL_ATTR_CU_LINK_HIT)
|
||||
if (m_customAttr & SPELL_ATTR0_CU_LINK_HIT)
|
||||
{
|
||||
if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(m_spellInfo->Id + SPELL_LINK_HIT))
|
||||
for (std::vector<int32>::const_iterator i = spell_triggered->begin(); i != spell_triggered->end(); ++i)
|
||||
@@ -1840,15 +1840,15 @@ void Spell::SearchAreaTarget(std::list<Unit*> &TagUnitMap, float radius, SpellNo
|
||||
break;
|
||||
}
|
||||
|
||||
bool requireDeadTarget = bool(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_REQUIRE_DEAD_TARGET);
|
||||
bool requireDeadTarget = bool(m_spellInfo->AttributesEx3 & SPELL_ATTR3_REQUIRE_DEAD_TARGET);
|
||||
Trinity::SpellNotifierCreatureAndPlayer notifier(m_caster, TagUnitMap, radius, type, TargetType, pos, entry, requireDeadTarget);
|
||||
if ((m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_PLAYERS_ONLY)
|
||||
if ((m_spellInfo->AttributesEx3 & SPELL_ATTR3_PLAYERS_ONLY)
|
||||
|| (TargetType == SPELL_TARGETS_ENTRY && !entry))
|
||||
m_caster->GetMap()->VisitWorld(pos->m_positionX, pos->m_positionY, radius, notifier);
|
||||
else
|
||||
m_caster->GetMap()->VisitAll(pos->m_positionX, pos->m_positionY, radius, notifier);
|
||||
|
||||
if (m_customAttr & SPELL_ATTR_CU_EXCLUDE_SELF)
|
||||
if (m_customAttr & SPELL_ATTR0_CU_EXCLUDE_SELF)
|
||||
TagUnitMap.remove(m_caster);
|
||||
}
|
||||
|
||||
@@ -2131,9 +2131,9 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
|
||||
break;
|
||||
|
||||
case TARGET_TYPE_AREA_CONE:
|
||||
if (m_customAttr & SPELL_ATTR_CU_CONE_BACK)
|
||||
if (m_customAttr & SPELL_ATTR0_CU_CONE_BACK)
|
||||
pushType = PUSH_IN_BACK;
|
||||
else if (m_customAttr & SPELL_ATTR_CU_CONE_LINE)
|
||||
else if (m_customAttr & SPELL_ATTR0_CU_CONE_LINE)
|
||||
pushType = PUSH_IN_LINE;
|
||||
else
|
||||
pushType = PUSH_IN_FRONT;
|
||||
@@ -2155,7 +2155,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
|
||||
float angle, dist;
|
||||
|
||||
float objSize = m_caster->GetObjectSize();
|
||||
if (m_spellInfo->AttributesEx & SPELL_ATTR_EX_USE_RADIUS_AS_MAX_DISTANCE)
|
||||
if (m_spellInfo->AttributesEx & SPELL_ATTR1_USE_RADIUS_AS_MAX_DISTANCE)
|
||||
dist = 0.0f;
|
||||
else
|
||||
dist = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
|
||||
@@ -3327,7 +3327,7 @@ void Spell::cast(bool skipCheck)
|
||||
}
|
||||
}
|
||||
|
||||
if (m_customAttr & SPELL_ATTR_CU_DIRECT_DAMAGE)
|
||||
if (m_customAttr & SPELL_ATTR0_CU_DIRECT_DAMAGE)
|
||||
CalculateDamageDoneForAllTargets();
|
||||
|
||||
// CAST SPELL
|
||||
@@ -3375,7 +3375,7 @@ void Spell::cast(bool skipCheck)
|
||||
handle_immediate();
|
||||
}
|
||||
|
||||
if (m_customAttr & SPELL_ATTR_CU_LINK_CAST)
|
||||
if (m_customAttr & SPELL_ATTR0_CU_LINK_CAST)
|
||||
{
|
||||
if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(m_spellInfo->Id))
|
||||
{
|
||||
@@ -3621,7 +3621,7 @@ void Spell::SendSpellCooldown()
|
||||
}
|
||||
|
||||
// have infinity cooldown but set at aura apply // do not set cooldown for triggered spells (needed by reincarnation)
|
||||
if (m_spellInfo->Attributes & (SPELL_ATTR_DISABLED_WHILE_ACTIVE | SPELL_ATTR_PASSIVE) || m_IsTriggeredSpell)
|
||||
if (m_spellInfo->Attributes & (SPELL_ATTR0_DISABLED_WHILE_ACTIVE | SPELL_ATTR0_PASSIVE) || m_IsTriggeredSpell)
|
||||
return;
|
||||
|
||||
_player->AddSpellAndCategoryCooldowns(m_spellInfo,m_CastItem ? m_CastItem->GetEntry() : 0, this);
|
||||
@@ -3781,7 +3781,7 @@ void Spell::finish(bool ok)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found && !(m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_RESET_AUTO_ACTIONS))
|
||||
if (!found && !(m_spellInfo->AttributesEx2 & SPELL_ATTR2_NOT_RESET_AUTO_ACTIONS))
|
||||
{
|
||||
m_caster->resetAttackTimer(BASE_ATTACK);
|
||||
if (m_caster->haveOffhandWeapon())
|
||||
@@ -3810,7 +3810,7 @@ void Spell::finish(bool ok)
|
||||
}
|
||||
|
||||
// Stop Attack for some spells
|
||||
if (m_spellInfo->Attributes & SPELL_ATTR_STOP_ATTACK_TARGET)
|
||||
if (m_spellInfo->Attributes & SPELL_ATTR0_STOP_ATTACK_TARGET)
|
||||
m_caster->AttackStop();
|
||||
}
|
||||
|
||||
@@ -3904,7 +3904,7 @@ void Spell::SendSpellStart()
|
||||
//sLog.outDebug("Sending SMSG_SPELL_START id=%u", m_spellInfo->Id);
|
||||
|
||||
uint32 castFlags = CAST_FLAG_UNKNOWN_2;
|
||||
if (m_spellInfo->Attributes & SPELL_ATTR_REQ_AMMO)
|
||||
if (m_spellInfo->Attributes & SPELL_ATTR0_REQ_AMMO)
|
||||
castFlags |= CAST_FLAG_AMMO;
|
||||
if ((m_caster->GetTypeId() == TYPEID_PLAYER ||
|
||||
(m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->isPet()))
|
||||
@@ -3957,7 +3957,7 @@ void Spell::SendSpellGo()
|
||||
if ((m_IsTriggeredSpell && !IsAutoRepeatRangedSpell(m_spellInfo)) || m_triggeredByAuraSpell)
|
||||
castFlags |= CAST_FLAG_PENDING;
|
||||
|
||||
if (m_spellInfo->Attributes & SPELL_ATTR_REQ_AMMO)
|
||||
if (m_spellInfo->Attributes & SPELL_ATTR0_REQ_AMMO)
|
||||
castFlags |= CAST_FLAG_AMMO; // arrows/bullets visual
|
||||
if ((m_caster->GetTypeId() == TYPEID_PLAYER ||
|
||||
(m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->isPet()))
|
||||
@@ -4743,11 +4743,11 @@ void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTar
|
||||
SpellCastResult Spell::CheckCast(bool strict)
|
||||
{
|
||||
// check death state
|
||||
if (!m_IsTriggeredSpell && !m_caster->isAlive() && !(m_spellInfo->Attributes & SPELL_ATTR_PASSIVE) && !(m_spellInfo->Attributes & SPELL_ATTR_CASTABLE_WHILE_DEAD))
|
||||
if (!m_IsTriggeredSpell && !m_caster->isAlive() && !(m_spellInfo->Attributes & SPELL_ATTR0_PASSIVE) && !(m_spellInfo->Attributes & SPELL_ATTR0_CASTABLE_WHILE_DEAD))
|
||||
return SPELL_FAILED_CASTER_DEAD;
|
||||
|
||||
// check cooldowns to prevent cheating
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && !(m_spellInfo->Attributes & SPELL_ATTR_PASSIVE))
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && !(m_spellInfo->Attributes & SPELL_ATTR0_PASSIVE))
|
||||
{
|
||||
//can cast triggered (by aura only?) spells while have this flag
|
||||
if (!m_IsTriggeredSpell && m_caster->ToPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_ALLOW_ONLY_ABILITY))
|
||||
@@ -4771,11 +4771,11 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
|
||||
if(m_caster->GetTypeId() == TYPEID_PLAYER && VMAP::VMapFactory::createOrGetVMapManager()->isLineOfSightCalcEnabled())
|
||||
{
|
||||
if(m_spellInfo->Attributes & SPELL_ATTR_OUTDOORS_ONLY &&
|
||||
if(m_spellInfo->Attributes & SPELL_ATTR0_OUTDOORS_ONLY &&
|
||||
!m_caster->GetMap()->IsOutdoors(m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ()))
|
||||
return SPELL_FAILED_ONLY_OUTDOORS;
|
||||
|
||||
if(m_spellInfo->Attributes & SPELL_ATTR_INDOORS_ONLY &&
|
||||
if(m_spellInfo->Attributes & SPELL_ATTR0_INDOORS_ONLY &&
|
||||
m_caster->GetMap()->IsOutdoors(m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ()))
|
||||
return SPELL_FAILED_ONLY_INDOORS;
|
||||
}
|
||||
@@ -4801,7 +4801,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
if (shapeError != SPELL_CAST_OK)
|
||||
return shapeError;
|
||||
|
||||
if ((m_spellInfo->Attributes & SPELL_ATTR_ONLY_STEALTHED) && !(m_caster->HasStealthAura()))
|
||||
if ((m_spellInfo->Attributes & SPELL_ATTR0_ONLY_STEALTHED) && !(m_caster->HasStealthAura()))
|
||||
return SPELL_FAILED_ONLY_STEALTHED;
|
||||
}
|
||||
}
|
||||
@@ -4868,7 +4868,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
if (m_spellInfo->excludeTargetAuraSpell && target->HasAura(m_spellInfo->excludeTargetAuraSpell))
|
||||
return SPELL_FAILED_TARGET_AURASTATE;
|
||||
|
||||
if (!m_IsTriggeredSpell && target == m_caster && m_spellInfo->AttributesEx & SPELL_ATTR_EX_CANT_TARGET_SELF)
|
||||
if (!m_IsTriggeredSpell && target == m_caster && m_spellInfo->AttributesEx & SPELL_ATTR1_CANT_TARGET_SELF)
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
bool non_caster_target = target != m_caster && !sSpellMgr.IsSpellWithCasterSourceTargetsOnly(m_spellInfo);
|
||||
@@ -4894,7 +4894,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
if (targetCreature->hasLootRecipient() && !targetCreature->isTappedBy(m_caster->ToPlayer()))
|
||||
return SPELL_FAILED_CANT_CAST_ON_TAPPED;
|
||||
|
||||
if (m_customAttr & SPELL_ATTR_CU_PICKPOCKET)
|
||||
if (m_customAttr & SPELL_ATTR0_CU_PICKPOCKET)
|
||||
{
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
@@ -5001,7 +5001,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
return SPELL_FAILED_TARGET_AURASTATE;
|
||||
|
||||
//Must be behind the target.
|
||||
if (m_spellInfo->AttributesEx2 == SPELL_ATTR_EX2_UNK20 && m_spellInfo->AttributesEx & SPELL_ATTR_EX_UNK9 && target->HasInArc(static_cast<float>(M_PI), m_caster)
|
||||
if (m_spellInfo->AttributesEx2 == SPELL_ATTR2_UNK20 && m_spellInfo->AttributesEx & SPELL_ATTR1_UNK9 && target->HasInArc(static_cast<float>(M_PI), m_caster)
|
||||
//Exclusion for Pounce: Facing Limitation was removed in 2.0.1, but it still uses the same, old Ex-Flags
|
||||
&& (!(m_spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellFamilyFlags.IsEqual(0x20000,0,0)))
|
||||
//Mutilate no longer requires you be behind the target as of patch 3.0.3
|
||||
@@ -5014,27 +5014,27 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
}
|
||||
|
||||
//Target must be facing you.
|
||||
if ((m_spellInfo->Attributes == (SPELL_ATTR_UNK4 | SPELL_ATTR_NOT_SHAPESHIFT | SPELL_ATTR_UNK18 | SPELL_ATTR_STOP_ATTACK_TARGET)) && !target->HasInArc(static_cast<float>(M_PI), m_caster))
|
||||
if ((m_spellInfo->Attributes == (SPELL_ATTR0_UNK4 | SPELL_ATTR0_NOT_SHAPESHIFT | SPELL_ATTR0_UNK18 | SPELL_ATTR0_STOP_ATTACK_TARGET)) && !target->HasInArc(static_cast<float>(M_PI), m_caster))
|
||||
{
|
||||
SendInterrupted(2);
|
||||
return SPELL_FAILED_NOT_INFRONT;
|
||||
}
|
||||
|
||||
// check if target is in combat
|
||||
if (non_caster_target && (m_spellInfo->AttributesEx & SPELL_ATTR_EX_NOT_IN_COMBAT_TARGET) && target->isInCombat())
|
||||
if (non_caster_target && (m_spellInfo->AttributesEx & SPELL_ATTR1_NOT_IN_COMBAT_TARGET) && target->isInCombat())
|
||||
return SPELL_FAILED_TARGET_AFFECTING_COMBAT;
|
||||
}
|
||||
|
||||
// Spell casted only on battleground
|
||||
if ((m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_BATTLEGROUND) && m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
if ((m_spellInfo->AttributesEx3 & SPELL_ATTR3_BATTLEGROUND) && m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
if (!m_caster->ToPlayer()->InBattleground())
|
||||
return SPELL_FAILED_ONLY_BATTLEGROUNDS;
|
||||
|
||||
// do not allow spells to be cast in arenas
|
||||
// - with greater than 10 min CD without SPELL_ATTR_EX4_USABLE_IN_ARENA flag
|
||||
// - with SPELL_ATTR_EX4_NOT_USABLE_IN_ARENA flag
|
||||
if ((m_spellInfo->AttributesEx4 & SPELL_ATTR_EX4_NOT_USABLE_IN_ARENA) ||
|
||||
(GetSpellRecoveryTime(m_spellInfo) > 10 * MINUTE * IN_MILLISECONDS && !(m_spellInfo->AttributesEx4 & SPELL_ATTR_EX4_USABLE_IN_ARENA)))
|
||||
// - with greater than 10 min CD without SPELL_ATTR4_USABLE_IN_ARENA flag
|
||||
// - with SPELL_ATTR4_NOT_USABLE_IN_ARENA flag
|
||||
if ((m_spellInfo->AttributesEx4 & SPELL_ATTR4_NOT_USABLE_IN_ARENA) ||
|
||||
(GetSpellRecoveryTime(m_spellInfo) > 10 * MINUTE * IN_MILLISECONDS && !(m_spellInfo->AttributesEx4 & SPELL_ATTR4_USABLE_IN_ARENA)))
|
||||
if (MapEntry const* mapEntry = sMapStore.LookupEntry(m_caster->GetMapId()))
|
||||
if (mapEntry->IsBattleArena())
|
||||
return SPELL_FAILED_NOT_IN_ARENA;
|
||||
@@ -5053,7 +5053,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
|
||||
// not let players cast spells at mount (and let do it to creatures)
|
||||
if (m_caster->IsMounted() && m_caster->GetTypeId() == TYPEID_PLAYER && !m_IsTriggeredSpell &&
|
||||
!IsPassiveSpell(m_spellInfo->Id) && !(m_spellInfo->Attributes & SPELL_ATTR_CASTABLE_WHILE_MOUNTED))
|
||||
!IsPassiveSpell(m_spellInfo->Id) && !(m_spellInfo->Attributes & SPELL_ATTR0_CASTABLE_WHILE_MOUNTED))
|
||||
{
|
||||
if (m_caster->isInFlight())
|
||||
return SPELL_FAILED_NOT_ON_TAXI;
|
||||
@@ -5658,7 +5658,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
|
||||
SpellCastResult Spell::CheckPetCast(Unit* target)
|
||||
{
|
||||
if (!m_caster->isAlive() && !(m_spellInfo->Attributes & SPELL_ATTR_CASTABLE_WHILE_DEAD))
|
||||
if (!m_caster->isAlive() && !(m_spellInfo->Attributes & SPELL_ATTR0_CASTABLE_WHILE_DEAD))
|
||||
return SPELL_FAILED_CASTER_DEAD;
|
||||
|
||||
if (m_caster->HasUnitState(UNIT_STAT_CASTING) && !m_IsTriggeredSpell) //prevent spellcast interruption by another spellcast
|
||||
@@ -5706,7 +5706,7 @@ SpellCastResult Spell::CheckPetCast(Unit* target)
|
||||
SpellCastResult Spell::CheckCasterAuras() const
|
||||
{
|
||||
// spells totally immuned to caster auras (wsg flag drop, give marks etc)
|
||||
if (m_spellInfo->AttributesEx6& SPELL_ATTR_EX6_IGNORE_CASTER_AURAS)
|
||||
if (m_spellInfo->AttributesEx6& SPELL_ATTR6_IGNORE_CASTER_AURAS)
|
||||
return SPELL_CAST_OK;
|
||||
|
||||
uint8 school_immune = 0;
|
||||
@@ -5715,7 +5715,7 @@ SpellCastResult Spell::CheckCasterAuras() const
|
||||
|
||||
// Check if the spell grants school or mechanic immunity.
|
||||
// We use bitmasks so the loop is done only once and not on every aura check below.
|
||||
if (m_spellInfo->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY)
|
||||
if (m_spellInfo->AttributesEx & SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY)
|
||||
{
|
||||
for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
@@ -5735,11 +5735,11 @@ SpellCastResult Spell::CheckCasterAuras() const
|
||||
SpellCastResult prevented_reason = SPELL_CAST_OK;
|
||||
// Have to check if there is a stun aura. Otherwise will have problems with ghost aura apply while logging out
|
||||
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))
|
||||
if (unitflag & UNIT_FLAG_STUNNED && !(m_spellInfo->AttributesEx5 & SPELL_ATTR5_USABLE_WHILE_STUNNED))
|
||||
prevented_reason = SPELL_FAILED_STUNNED;
|
||||
else if (unitflag & UNIT_FLAG_CONFUSED && !(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_CONFUSED))
|
||||
else if (unitflag & UNIT_FLAG_CONFUSED && !(m_spellInfo->AttributesEx5 & SPELL_ATTR5_USABLE_WHILE_CONFUSED))
|
||||
prevented_reason = SPELL_FAILED_CONFUSED;
|
||||
else if (unitflag & UNIT_FLAG_FLEEING && !(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_FEARED))
|
||||
else if (unitflag & UNIT_FLAG_FLEEING && !(m_spellInfo->AttributesEx5 & SPELL_ATTR5_USABLE_WHILE_FEARED))
|
||||
prevented_reason = SPELL_FAILED_FLEEING;
|
||||
else if (unitflag & UNIT_FLAG_SILENCED && m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE)
|
||||
prevented_reason = SPELL_FAILED_SILENCED;
|
||||
@@ -5772,15 +5772,15 @@ SpellCastResult Spell::CheckCasterAuras() const
|
||||
switch(part->GetAuraType())
|
||||
{
|
||||
case SPELL_AURA_MOD_STUN:
|
||||
if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_STUNNED))
|
||||
if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR5_USABLE_WHILE_STUNNED))
|
||||
return SPELL_FAILED_STUNNED;
|
||||
break;
|
||||
case SPELL_AURA_MOD_CONFUSE:
|
||||
if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_CONFUSED))
|
||||
if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR5_USABLE_WHILE_CONFUSED))
|
||||
return SPELL_FAILED_CONFUSED;
|
||||
break;
|
||||
case SPELL_AURA_MOD_FEAR:
|
||||
if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_FEARED))
|
||||
if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR5_USABLE_WHILE_FEARED))
|
||||
return SPELL_FAILED_FLEEING;
|
||||
break;
|
||||
case SPELL_AURA_MOD_SILENCE:
|
||||
@@ -6405,7 +6405,7 @@ SpellCastResult Spell::CheckItems()
|
||||
if (m_spellInfo->EquippedItemClass >=0)
|
||||
{
|
||||
// main hand weapon required
|
||||
if (m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_MAIN_HAND)
|
||||
if (m_spellInfo->AttributesEx3 & SPELL_ATTR3_MAIN_HAND)
|
||||
{
|
||||
Item* item = m_caster->ToPlayer()->GetWeaponForAttack(BASE_ATTACK);
|
||||
|
||||
@@ -6419,7 +6419,7 @@ SpellCastResult Spell::CheckItems()
|
||||
}
|
||||
|
||||
// offhand hand weapon required
|
||||
if (m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_REQ_OFFHAND)
|
||||
if (m_spellInfo->AttributesEx3 & SPELL_ATTR3_REQ_OFFHAND)
|
||||
{
|
||||
Item* item = m_caster->ToPlayer()->GetWeaponForAttack(OFF_ATTACK);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user