Core/DynamicObject: Research dynamicobject types, added DynamicObjectType enum

This commit is contained in:
SilverIce
2011-04-19 15:14:50 +02:00
committed by Shauren
parent 0ef149d357
commit 18112df4fe
3 changed files with 71 additions and 65 deletions
+9 -6
View File
@@ -2541,15 +2541,16 @@ void Spell::EffectPersistentAA(SpellEffIndex effIndex)
// Caster not in world, might be spell triggered from aura removal
if (!caster->IsInWorld())
return;
DynamicObject* dynObj = new DynamicObject;
if (!dynObj->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), caster, m_spellInfo->Id, m_targets.m_dstPos, radius, false))
DynamicObject* dynObj = new DynamicObject();
if (!dynObj->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), caster, m_spellInfo->Id, m_targets.m_dstPos, radius, false, DYNAMIC_OBJECT_AREA_SPELL))
{
delete dynObj;
return;
}
dynObj->GetMap()->Add(dynObj);
if (Aura * aura = Aura::TryCreate(m_spellInfo, dynObj, caster, &m_spellValue->EffectBasePoints[0]))
if (Aura* aura = Aura::TryCreate(m_spellInfo, dynObj, caster, &m_spellValue->EffectBasePoints[0]))
{
m_spellAura = aura;
m_spellAura->_RegisterForTargets();
@@ -2557,6 +2558,7 @@ void Spell::EffectPersistentAA(SpellEffIndex effIndex)
else
return;
}
ASSERT(m_spellAura->GetDynobjOwner());
m_spellAura->_ApplyEffectForTargets(effIndex);
}
@@ -3382,14 +3384,15 @@ void Spell::EffectAddFarsight(SpellEffIndex effIndex)
// Caster not in world, might be spell triggered from aura removal
if (!m_caster->IsInWorld())
return;
DynamicObject* dynObj = new DynamicObject;
if (!dynObj->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, m_targets.m_dstPos, radius, true))
DynamicObject* dynObj = new DynamicObject();
if (!dynObj->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, m_targets.m_dstPos, radius, true, DYNAMIC_OBJECT_FARSIGHT_FOCUS))
{
delete dynObj;
return;
}
dynObj->SetDuration(duration);
dynObj->SetUInt32Value(DYNAMICOBJECT_BYTES, 0x80000002);
dynObj->setActive(true); //must before add to map to be put in world container
dynObj->GetMap()->Add(dynObj); //grid will also be loaded