diff options
| author | SilverIce <slifeleaf@gmail.com> | 2011-04-19 15:14:50 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2011-04-19 15:14:50 +0200 |
| commit | 18112df4fe4a124713b65c2b0964802050d8dcf8 (patch) | |
| tree | cb242b87d5e46e032653cea2810d48570fe33140 /src/server/game/Spells/SpellEffects.cpp | |
| parent | 0ef149d3574ed1a8580bcfaac56e696a4e42da13 (diff) | |
Core/DynamicObject: Research dynamicobject types, added DynamicObjectType enum
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
| -rwxr-xr-x | src/server/game/Spells/SpellEffects.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 507f974e2c8..a5fac405021 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -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 |
