*Let persistant auras affect ally targets in some cases.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-03-12 09:15:30 -06:00
parent a9f77d07ca
commit e6f7a60792
5 changed files with 19 additions and 16 deletions
+12 -6
View File
@@ -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;
+1 -1
View File
@@ -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,
+1 -6
View File
@@ -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;
+4 -3
View File
@@ -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)
+1
View File
@@ -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: