aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/DynamicObject
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2016-06-29 19:49:23 +0200
committerShauren <shauren.trinity@gmail.com>2016-06-29 19:49:23 +0200
commit7ed1c47f6b336cc7953373de60e964ba0a076b36 (patch)
tree3c8d9d89f79724162cc1323043dd3f1e50067d91 /src/server/game/Entities/DynamicObject
parentaa006b490cd0c2d49eeb624533bcbb8430908cd4 (diff)
Core/Auras: Implemented SPELL_AURA_OVERRIDE_SPELL_VISUAL
Diffstat (limited to 'src/server/game/Entities/DynamicObject')
-rw-r--r--src/server/game/Entities/DynamicObject/DynamicObject.cpp11
-rw-r--r--src/server/game/Entities/DynamicObject/DynamicObject.h3
2 files changed, 10 insertions, 4 deletions
diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.cpp b/src/server/game/Entities/DynamicObject/DynamicObject.cpp
index ea925148084..25684b44db6 100644
--- a/src/server/game/Entities/DynamicObject/DynamicObject.cpp
+++ b/src/server/game/Entities/DynamicObject/DynamicObject.cpp
@@ -28,7 +28,7 @@
#include "Transport.h"
DynamicObject::DynamicObject(bool isWorldObject) : WorldObject(isWorldObject),
- _aura(NULL), _removedAura(NULL), _caster(NULL), _duration(0), _isViewpoint(false)
+ _aura(NULL), _removedAura(NULL), _caster(NULL), _duration(0), _spellXSpellVisualId(0), _isViewpoint(false)
{
m_objectType |= TYPEMASK_DYNAMICOBJECT;
m_objectTypeId = TYPEID_DYNAMICOBJECT;
@@ -80,8 +80,9 @@ void DynamicObject::RemoveFromWorld()
}
}
-bool DynamicObject::CreateDynamicObject(ObjectGuid::LowType guidlow, Unit* caster, SpellInfo const* spell, Position const& pos, float radius, DynamicObjectType type)
+bool DynamicObject::CreateDynamicObject(ObjectGuid::LowType guidlow, Unit* caster, SpellInfo const* spell, Position const& pos, float radius, DynamicObjectType type, uint32 spellXSpellVisualId)
{
+ _spellXSpellVisualId = spellXSpellVisualId;
SetMap(caster->GetMap());
Relocate(pos);
if (!IsPositionValid())
@@ -93,10 +94,14 @@ bool DynamicObject::CreateDynamicObject(ObjectGuid::LowType guidlow, Unit* caste
WorldObject::_Create(ObjectGuid::Create<HighGuid::DynamicObject>(GetMapId(), spell->Id, guidlow));
SetPhaseMask(caster->GetPhaseMask(), false);
+ uint32 spellVisual = 0;
+ if (SpellXSpellVisualEntry const* visual = sSpellXSpellVisualStore.LookupEntry(spellXSpellVisualId))
+ spellVisual = visual->SpellVisualID[0];
+
SetEntry(spell->Id);
SetObjectScale(1.0f);
SetGuidValue(DYNAMICOBJECT_CASTER, caster->GetGUID());
- SetUInt32Value(DYNAMICOBJECT_BYTES, spell->GetSpellVisual(GetMap()->GetDifficultyID()) | (type << 28));
+ SetUInt32Value(DYNAMICOBJECT_BYTES, spellVisual | (type << 28));
SetUInt32Value(DYNAMICOBJECT_SPELLID, spell->Id);
SetFloatValue(DYNAMICOBJECT_RADIUS, radius);
SetUInt32Value(DYNAMICOBJECT_CASTTIME, getMSTime());
diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.h b/src/server/game/Entities/DynamicObject/DynamicObject.h
index 09426a3c044..4d1cdefdd48 100644
--- a/src/server/game/Entities/DynamicObject/DynamicObject.h
+++ b/src/server/game/Entities/DynamicObject/DynamicObject.h
@@ -41,7 +41,7 @@ class TC_GAME_API DynamicObject : public WorldObject, public GridObject<DynamicO
void AddToWorld() override;
void RemoveFromWorld() override;
- bool CreateDynamicObject(ObjectGuid::LowType guidlow, Unit* caster, SpellInfo const* spell, Position const& pos, float radius, DynamicObjectType type);
+ bool CreateDynamicObject(ObjectGuid::LowType guidlow, Unit* caster, SpellInfo const* spell, Position const& pos, float radius, DynamicObjectType type, uint32 spellXSpellVisualId);
void Update(uint32 p_time) override;
void Remove();
void SetDuration(int32 newDuration);
@@ -63,6 +63,7 @@ class TC_GAME_API DynamicObject : public WorldObject, public GridObject<DynamicO
Aura* _removedAura;
Unit* _caster;
int32 _duration; // for non-aura dynobjects
+ uint32 _spellXSpellVisualId;
bool _isViewpoint;
};
#endif