aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/GameObject.cpp2
-rw-r--r--src/game/Spell.cpp27
-rw-r--r--src/game/SpellAuras.cpp2
-rw-r--r--src/game/SpellEffects.cpp20
4 files changed, 31 insertions, 20 deletions
diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp
index 2f1014eb769..1a2ed5fb6db 100644
--- a/src/game/GameObject.cpp
+++ b/src/game/GameObject.cpp
@@ -198,7 +198,7 @@ void GameObject::Update(uint32 /*p_time*/)
{
// Arming Time for GAMEOBJECT_TYPE_TRAP (6)
Unit* owner = GetOwner();
- if (owner && ((Player*)owner)->isInCombat())
+ if (owner && owner->isInCombat())
m_cooldownTime = time(NULL) + GetGOInfo()->trap.startDelay;
m_lootState = GO_READY;
break;
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index d4e2207964b..9f0a5dc0fde 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1597,6 +1597,8 @@ WorldObject* Spell::SearchNearbyTarget(float range, SpellTargets TargetType)
break;
}
case SPELL_TARGET_TYPE_CREATURE:
+ if(m_targets.getUnitTarget() && m_targets.getUnitTarget()->GetEntry() == i_spellST->second.targetEntry)
+ return m_targets.getUnitTarget();
case SPELL_TARGET_TYPE_DEAD:
default:
{
@@ -1925,7 +1927,13 @@ void Spell::SetTargetMap(uint32 i, uint32 cur)
m_targets.setDestination(st->target_X, st->target_Y, st->target_Z);
}
else
- sLog.outError( "SPELL: unknown target coordinates for spell ID %u\n", m_spellInfo->Id );
+ {
+ sLog.outError( "SPELL: unknown target coordinates for spell ID %u", m_spellInfo->Id );
+ Unit *target = NULL;
+ if(uint64 guid = m_caster->GetUInt64Value(UNIT_FIELD_TARGET))
+ target = ObjectAccessor::GetUnit(*m_caster, guid);
+ m_targets.setDestination(target ? target : m_caster);
+ }
break;
case TARGET_DST_HOME:
if(m_caster->GetTypeId() == TYPEID_PLAYER)
@@ -2045,7 +2053,7 @@ void Spell::SetTargetMap(uint32 i, uint32 cur)
else if(pushType)
{
// Dummy, just for client
- if(spellmgr.EffectTargetType[m_spellInfo->Effect[i]] == SPELL_REQUIRE_DEST)
+ if(spellmgr.EffectTargetType[m_spellInfo->Effect[i]] != SPELL_REQUIRE_UNIT)
return;
float radius;
@@ -3971,13 +3979,16 @@ SpellCastResult Spell::CheckCast(bool strict)
return SPELL_FAILED_NOT_IN_ARENA;
// zone check
- uint32 zone, area;
- m_caster->GetZoneAndAreaId(zone,area);
+ if(m_caster->GetTypeId() == TYPEID_UNIT || !((Player*)m_caster)->isGameMaster())
+ {
+ uint32 zone, area;
+ m_caster->GetZoneAndAreaId(zone,area);
- SpellCastResult locRes= spellmgr.GetSpellAllowedInLocationError(m_spellInfo,m_caster->GetMapId(),zone,area,
- m_caster->GetTypeId()==TYPEID_PLAYER ? ((Player*)m_caster) : NULL);
- if(locRes != SPELL_CAST_OK)
- return locRes;
+ SpellCastResult locRes= spellmgr.GetSpellAllowedInLocationError(m_spellInfo,m_caster->GetMapId(),zone,area,
+ m_caster->GetTypeId()==TYPEID_PLAYER ? ((Player*)m_caster) : NULL);
+ if(locRes != SPELL_CAST_OK)
+ return locRes;
+ }
// not let players cast spells at mount (and let do it to creatures)
if( m_caster->IsMounted() && m_caster->GetTypeId()==TYPEID_PLAYER && !m_IsTriggeredSpell &&
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 5b941a0440f..f9bdc6fcd88 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -1000,7 +1000,7 @@ void Aura::_AddAura()
for(std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
{
if(*itr < 0)
- m_target->ApplySpellImmune(id, IMMUNITY_ID, -(*itr), m_target);
+ m_target->ApplySpellImmune(id, IMMUNITY_ID, -(*itr), true);
else if(Unit* caster = GetCaster())
caster->AddAura(*itr, m_target);
}
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index c7119c993ec..d213040ede4 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -4775,17 +4775,17 @@ void Spell::EffectScriptEffect(uint32 effIndex)
unitTarget->CastSpell(unitTarget, 44870, true);
break;
}
- // spell of Brutallus - Stomp
- case 45185:
- {
- if(!unitTarget)
- return;
-
- if(unitTarget->HasAura(46394)) // spell of Brutallus - Burn
- unitTarget->RemoveAurasDueToSpell(46394);
+ // spell of Brutallus - Stomp
+ case 45185:
+ {
+ if(!unitTarget)
+ return;
- break;
- }
+ if(unitTarget->HasAura(46394)) // spell of Brutallus - Burn
+ unitTarget->RemoveAurasDueToSpell(46394);
+
+ break;
+ }
// Negative Energy
case 46289:
{