aboutsummaryrefslogtreecommitdiff
path: root/src/game/Spell.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r--src/game/Spell.cpp80
1 files changed, 40 insertions, 40 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index f1c31d6434c..d0c7c7d549a 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1209,14 +1209,14 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
if (canEffectTrigger && missInfo != SPELL_MISS_REFLECT)
caster->ProcDamageAndSpell(unit, procAttacker, procVictim, procEx, 0, m_attackType, m_spellInfo, m_triggeredByAuraSpell);
- // Failed Pickpocket, reveal rogue
- if (missInfo == SPELL_MISS_RESIST
- && m_customAttr & SPELL_ATTR_CU_PICKPOCKET
- && unitTarget->GetTypeId() == TYPEID_UNIT)
- {
- m_caster->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK);
- if (((Creature*)unitTarget)->IsAIEnabled)
- ((Creature*)unitTarget)->AI()->AttackStart(m_caster);
+ // Failed Pickpocket, reveal rogue
+ if (missInfo == SPELL_MISS_RESIST
+ && m_customAttr & SPELL_ATTR_CU_PICKPOCKET
+ && unitTarget->GetTypeId() == TYPEID_UNIT)
+ {
+ m_caster->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK);
+ if (((Creature*)unitTarget)->IsAIEnabled)
+ ((Creature*)unitTarget)->AI()->AttackStart(m_caster);
}
}
@@ -4129,7 +4129,7 @@ SpellCastResult Spell::CheckRuneCost(uint32 runeCostID)
for (uint32 i = 0; i < RUNE_DEATH; ++i)
{
runeCost[i] = src->RuneCost[i];
- if(Player* modOwner = m_caster->GetSpellModOwner())
+ if(Player* modOwner = m_caster->GetSpellModOwner())
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_COST, runeCost[i], this);
}
@@ -4451,37 +4451,37 @@ SpellCastResult Spell::CheckCast(bool strict)
if (target->hasUnitState(UNIT_STAT_UNATTACKABLE))
return SPELL_FAILED_BAD_TARGETS;
- if(!m_IsTriggeredSpell && (target->HasAuraType(SPELL_AURA_MOD_STEALTH)
- || target->m_invisibilityMask) && !m_caster->canSeeOrDetect(target, true))
- return SPELL_FAILED_BAD_TARGETS;
-
- if (m_caster->GetTypeId() == TYPEID_PLAYER)
- {
- // Not allow banish not self target
- if (m_spellInfo->Mechanic == MECHANIC_BANISH)
- if (target->GetTypeId() == TYPEID_UNIT &&
- !((Player*)m_caster)->isAllowedToLoot((Creature*)target))
- return SPELL_FAILED_CANT_CAST_ON_TAPPED;
-
- if (m_customAttr & SPELL_ATTR_CU_PICKPOCKET)
- {
- if (target->GetTypeId() == TYPEID_PLAYER)
- return SPELL_FAILED_BAD_TARGETS;
- else if ((target->GetCreatureTypeMask() & CREATURE_TYPEMASK_HUMANOID_OR_UNDEAD) == 0)
- return SPELL_FAILED_TARGET_NO_POCKETS;
- }
-
- // Not allow disarm unarmed player
- if (m_spellInfo->Mechanic == MECHANIC_DISARM)
- {
- if (target->GetTypeId() == TYPEID_PLAYER)
- {
- if(!((Player*)target)->GetWeaponForAttack(BASE_ATTACK) || !((Player*)target)->IsUseEquipedWeapon(true))
- return SPELL_FAILED_TARGET_NO_WEAPONS;
- }
- else if (!target->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID))
- return SPELL_FAILED_TARGET_NO_WEAPONS;
- }
+ if(!m_IsTriggeredSpell && (target->HasAuraType(SPELL_AURA_MOD_STEALTH)
+ || target->m_invisibilityMask) && !m_caster->canSeeOrDetect(target, true))
+ return SPELL_FAILED_BAD_TARGETS;
+
+ if (m_caster->GetTypeId() == TYPEID_PLAYER)
+ {
+ // Not allow banish not self target
+ if (m_spellInfo->Mechanic == MECHANIC_BANISH)
+ if (target->GetTypeId() == TYPEID_UNIT &&
+ !((Player*)m_caster)->isAllowedToLoot((Creature*)target))
+ return SPELL_FAILED_CANT_CAST_ON_TAPPED;
+
+ if (m_customAttr & SPELL_ATTR_CU_PICKPOCKET)
+ {
+ if (target->GetTypeId() == TYPEID_PLAYER)
+ return SPELL_FAILED_BAD_TARGETS;
+ else if ((target->GetCreatureTypeMask() & CREATURE_TYPEMASK_HUMANOID_OR_UNDEAD) == 0)
+ return SPELL_FAILED_TARGET_NO_POCKETS;
+ }
+
+ // Not allow disarm unarmed player
+ if (m_spellInfo->Mechanic == MECHANIC_DISARM)
+ {
+ if (target->GetTypeId() == TYPEID_PLAYER)
+ {
+ if(!((Player*)target)->GetWeaponForAttack(BASE_ATTACK) || !((Player*)target)->IsUseEquipedWeapon(true))
+ return SPELL_FAILED_TARGET_NO_WEAPONS;
+ }
+ else if (!target->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID))
+ return SPELL_FAILED_TARGET_NO_WEAPONS;
+ }
}
if(!m_IsTriggeredSpell && VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOSInMap(target))