aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-12 09:15:30 -0600
committermegamage <none@none>2009-03-12 09:15:30 -0600
commite6f7a6079298619862c56905dbd7c7b6968e1730 (patch)
tree5698e24a023a40877ea7b736b6d830a7f8eba7dc /src
parenta9f77d07caf00771bebd37e786873f3188bc9af6 (diff)
*Let persistant auras affect ally targets in some cases.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/GridNotifiersImpl.h18
-rw-r--r--src/game/SharedDefines.h2
-rw-r--r--src/game/Spell.cpp7
-rw-r--r--src/game/SpellEffects.cpp7
-rw-r--r--src/game/SpellMgr.cpp1
5 files changed, 19 insertions, 16 deletions
diff --git a/src/game/GridNotifiersImpl.h b/src/game/GridNotifiersImpl.h
index 4fe61076b18..b7660d90c3b 100644
--- a/src/game/GridNotifiersImpl.h
+++ b/src/game/GridNotifiersImpl.h
@@ -175,7 +175,18 @@ inline void Trinity::DynamicObjectUpdater::VisitHelper(Unit* target)
if( target->GetTypeId()==TYPEID_PLAYER && target != i_check && (((Player*)target)->isGameMaster() || ((Player*)target)->GetVisibility()==VISIBILITY_OFF) )
return;
- if( i_check->GetTypeId()==TYPEID_PLAYER )
+ if (i_dynobject.IsAffecting(target))
+ return;
+
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(i_dynobject.GetSpellId());
+ uint32 eff_index = i_dynobject.GetEffIndex();
+ if(spellInfo->EffectImplicitTargetB[eff_index] == TARGET_UNIT_AREA_ALLY_CHANNEL
+ || spellInfo->EffectImplicitTargetB[eff_index] == TARGET_UNIT_AREA_ALLY_GROUND)
+ {
+ if(!i_check->IsFriendlyTo(target))
+ return;
+ }
+ else if( i_check->GetTypeId()==TYPEID_PLAYER )
{
if (i_check->IsFriendlyTo( target ))
return;
@@ -186,11 +197,6 @@ inline void Trinity::DynamicObjectUpdater::VisitHelper(Unit* target)
return;
}
- if (i_dynobject.IsAffecting(target))
- return;
-
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(i_dynobject.GetSpellId());
- uint32 eff_index = i_dynobject.GetEffIndex();
// Check target immune to spell or aura
if (target->IsImmunedToSpell(spellInfo) || target->IsImmunedToSpellEffect(spellInfo->Effect[eff_index], spellInfo->EffectMechanic[eff_index]))
return;
diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h
index dd45d4700fa..61cbcaa35ad 100644
--- a/src/game/SharedDefines.h
+++ b/src/game/SharedDefines.h
@@ -876,7 +876,7 @@ enum Targets
TARGET_UNIT_CLASS_TARGET = 61,
TARGET_TEST = 62, // for a test spell
TARGET_DUELVSPLAYER_COORDINATES = 63,
- TARGET_DEST_TARGET_ENEMY_UNKNOWN = 63,
+ TARGET_DEST_TARGET_ANY = 63,
TARGET_DEST_TARGET_FRONT = 64,
TARGET_DEST_TARGET_BACK = 65, // uses in teleport behind spells
TARGET_DEST_TARGET_RIGHT = 66,
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 378bd06aa95..9f5ed2a4e02 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1917,16 +1917,11 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
break;
}
- if(cur == TARGET_DEST_TARGET_ENEMY)
+ if(cur == TARGET_DEST_TARGET_ENEMY || cur == TARGET_DEST_TARGET_ANY)
{
m_targets.setDestination(target, true);
break;
}
- else if(cur == TARGET_DEST_TARGET_ENEMY_UNKNOWN) // no ground?
- {
- m_targets.setDestination(target, false);
- break;
- }
float x, y, z, angle, dist;
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index a985e1c9fb1..32aeb1a7968 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -2641,9 +2641,10 @@ void Spell::EffectPersistentAA(uint32 i)
if(Player* modOwner = m_originalCaster->GetSpellModOwner())
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, radius);
+ Unit *caster = m_caster->GetEntry() == WORLD_TRIGGER ? m_originalCaster : m_caster;
int32 duration = GetSpellDuration(m_spellInfo);
DynamicObject* dynObj = new DynamicObject;
- if(!dynObj->Create(objmgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_originalCaster, m_spellInfo->Id, i, m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, duration, radius))
+ if(!dynObj->Create(objmgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), caster, m_spellInfo->Id, i, m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, duration, radius))
{
delete dynObj;
return;
@@ -2651,8 +2652,8 @@ void Spell::EffectPersistentAA(uint32 i)
dynObj->SetUInt32Value(OBJECT_FIELD_TYPE, 65);
dynObj->SetUInt32Value(GAMEOBJECT_DISPLAYID, 368003);
dynObj->SetUInt32Value(DYNAMICOBJECT_BYTES, 0x01eeeeee);
- m_originalCaster->AddDynObject(dynObj);
- MapManager::Instance().GetMap(dynObj->GetMapId(), dynObj)->Add(dynObj);
+ caster->AddDynObject(dynObj);
+ dynObj->GetMap()->Add(dynObj);
}
void Spell::EffectEnergize(uint32 i)
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 9320d26d88d..80703c22cef 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -129,6 +129,7 @@ SpellMgr::SpellMgr()
SpellTargetType[i] = TARGET_TYPE_AREA_DEST;
break;
case TARGET_DEST_TARGET_ENEMY:
+ case TARGET_DEST_TARGET_ANY:
case TARGET_DEST_TARGET_FRONT:
case TARGET_DEST_TARGET_BACK:
case TARGET_DEST_TARGET_RIGHT: