diff --git a/src/game/DynamicObject.cpp b/src/game/DynamicObject.cpp index 5e235746f..ecbe56e0e 100644 --- a/src/game/DynamicObject.cpp +++ b/src/game/DynamicObject.cpp @@ -58,7 +58,7 @@ void DynamicObject::RemoveFromWorld() Object::RemoveFromWorld(); } -bool DynamicObject::Create( uint32 guidlow, Unit *caster, uint32 spellId, SpellEffectIndex effIndex, float x, float y, float z, int32 duration, float radius ) +bool DynamicObject::Create(uint32 guidlow, Unit *caster, uint32 spellId, SpellEffectIndex effIndex, float x, float y, float z, int32 duration, float radius, DynamicObjectType type) { WorldObject::_Create(guidlow, HIGHGUID_DYNAMICOBJECT, caster->GetPhaseMask()); SetMap(caster->GetMap()); @@ -86,7 +86,7 @@ bool DynamicObject::Create( uint32 guidlow, Unit *caster, uint32 spellId, SpellE bytes |= 0x00 << 16; bytes |= 0x00 << 24; */ - SetUInt32Value(DYNAMICOBJECT_BYTES, 0x00000001); + SetByteValue(DYNAMICOBJECT_BYTES, 0, type); SetUInt32Value(DYNAMICOBJECT_SPELLID, spellId); SetFloatValue(DYNAMICOBJECT_RADIUS, radius); diff --git a/src/game/DynamicObject.h b/src/game/DynamicObject.h index 292354379..e9b127ac4 100644 --- a/src/game/DynamicObject.h +++ b/src/game/DynamicObject.h @@ -23,6 +23,13 @@ #include "DBCEnums.h" #include "Unit.h" +enum DynamicObjectType +{ + DYNAMIC_OBJECT_PORTAL = 0x0, // unused + DYNAMIC_OBJECT_AREA_SPELL = 0x1, + DYNAMIC_OBJECT_FARSIGHT_FOCUS = 0x2, +}; + struct SpellEntry; class DynamicObject : public WorldObject @@ -34,7 +41,7 @@ class DynamicObject : public WorldObject void AddToWorld(); void RemoveFromWorld(); - bool Create(uint32 guidlow, Unit *caster, uint32 spellId, SpellEffectIndex effIndex, float x, float y, float z, int32 duration, float radius); + bool Create(uint32 guidlow, Unit *caster, uint32 spellId, SpellEffectIndex effIndex, float x, float y, float z, int32 duration, float radius, DynamicObjectType type); void Update(uint32 update_diff, uint32 p_time); void Delete(); uint32 GetSpellId() const { return m_spellId; } @@ -43,6 +50,7 @@ class DynamicObject : public WorldObject ObjectGuid const& GetCasterGuid() const { return GetGuidValue(DYNAMICOBJECT_CASTER); } Unit* GetCaster() const; float GetRadius() const { return m_radius; } + DynamicObjectType GetType() const { return (DynamicObjectType)GetByteValue(DYNAMICOBJECT_BYTES,0); } bool IsAffecting(Unit *unit) const { return m_affected.find(unit->GetObjectGuid()) != m_affected.end(); } void AddAffected(Unit *unit) { m_affected.insert(unit->GetObjectGuid()); } void RemoveAffected(Unit *unit) { m_affected.erase(unit->GetObjectGuid()); } diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 685449623..6a8c59087 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -4010,7 +4010,8 @@ void Spell::EffectPersistentAA(SpellEffectIndex eff_idx) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, radius); DynamicObject* dynObj = new DynamicObject; - if (!dynObj->Create(pCaster->GetMap()->GenerateLocalLowGuid(HIGHGUID_DYNAMICOBJECT), pCaster, m_spellInfo->Id, eff_idx, m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, m_duration, radius)) + if (!dynObj->Create(pCaster->GetMap()->GenerateLocalLowGuid(HIGHGUID_DYNAMICOBJECT), pCaster, m_spellInfo->Id, + eff_idx, m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, m_duration, radius, DYNAMIC_OBJECT_AREA_SPELL)) { delete dynObj; return; @@ -4834,15 +4835,13 @@ void Spell::EffectAddFarsight(SpellEffectIndex eff_idx) DynamicObject* dynObj = new DynamicObject; // set radius to 0: spell not expected to work as persistent aura - if(!dynObj->Create(m_caster->GetMap()->GenerateLocalLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, eff_idx, m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, duration, 0)) + if(!dynObj->Create(m_caster->GetMap()->GenerateLocalLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, + m_spellInfo->Id, eff_idx, m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, duration, 0, DYNAMIC_OBJECT_FARSIGHT_FOCUS)) { delete dynObj; return; } - // DYNAMICOBJECT_BYTES is apparently different from the default bytes set in ::Create - dynObj->SetUInt32Value(DYNAMICOBJECT_BYTES, 0x80000002); - m_caster->AddDynObject(dynObj); m_caster->GetMap()->Add(dynObj); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 8d4edc91a..090373a72 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11379" + #define REVISION_NR "11380" #endif // __REVISION_NR_H__