mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[11380] Research dynamicobject types, added DynamicObjectType enum
This commit is contained in:
parent
3bf9a5c35b
commit
820a3c0eff
4 changed files with 16 additions and 9 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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()); }
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "11379"
|
||||
#define REVISION_NR "11380"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue