Core/DynamicObject: Research dynamicobject types, added DynamicObjectType enum
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user