aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/DynamicObject
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2012-10-20 00:02:32 +0200
committerShauren <shauren.trinity@gmail.com>2012-10-20 00:02:32 +0200
commitc40e9e259599273b4317fe7a980c8f487e6f76e2 (patch)
tree78acbe3efe81a391c23ffdeba5cd9f6a6f56f320 /src/server/game/Entities/DynamicObject
parent77a8d6f127b0fd082c2b7072bd512822a6732362 (diff)
Core/Spells: Fixed visuals of area spells that use a dynamic object
Diffstat (limited to 'src/server/game/Entities/DynamicObject')
-rwxr-xr-xsrc/server/game/Entities/DynamicObject/DynamicObject.cpp16
-rwxr-xr-xsrc/server/game/Entities/DynamicObject/DynamicObject.h2
2 files changed, 6 insertions, 12 deletions
diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.cpp b/src/server/game/Entities/DynamicObject/DynamicObject.cpp
index 065333dc9e2..a8f8d54c6d6 100755
--- a/src/server/game/Entities/DynamicObject/DynamicObject.cpp
+++ b/src/server/game/Entities/DynamicObject/DynamicObject.cpp
@@ -79,29 +79,23 @@ void DynamicObject::RemoveFromWorld()
}
}
-bool DynamicObject::CreateDynamicObject(uint32 guidlow, Unit* caster, uint32 spellId, Position const& pos, float radius, DynamicObjectType type)
+bool DynamicObject::CreateDynamicObject(uint32 guidlow, Unit* caster, SpellInfo const* spell, Position const& pos, float radius, DynamicObjectType type)
{
SetMap(caster->GetMap());
Relocate(pos);
if (!IsPositionValid())
{
- sLog->outError(LOG_FILTER_GENERAL, "DynamicObject (spell %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", spellId, GetPositionX(), GetPositionY());
+ sLog->outError(LOG_FILTER_GENERAL, "DynamicObject (spell %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", spell, GetPositionX(), GetPositionY());
return false;
}
WorldObject::_Create(guidlow, HIGHGUID_DYNAMICOBJECT, caster->GetPhaseMask());
- SetEntry(spellId);
+ SetEntry(spell->Id);
SetObjectScale(1);
SetUInt64Value(DYNAMICOBJECT_CASTER, caster->GetGUID());
-
- // The lower word of DYNAMICOBJECT_BYTES must be 0x0001. This value means that the visual radius will be overriden
- // by client for most of the "ground patch" visual effect spells and a few "skyfall" ones like Hurricane.
- // If any other value is used, the client will _always_ use the radius provided in DYNAMICOBJECT_RADIUS, but
- // precompensation is necessary (eg radius *= 2) for many spells. Anyway, blizz sends 0x0001 for all the spells
- // I saw sniffed...
- SetByteValue(DYNAMICOBJECT_BYTES, 0, type);
- SetUInt32Value(DYNAMICOBJECT_SPELLID, spellId);
+ SetUInt32Value(DYNAMICOBJECT_BYTES, spell->SpellVisual[0] | (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 68da99ac668..b988693315f 100755
--- a/src/server/game/Entities/DynamicObject/DynamicObject.h
+++ b/src/server/game/Entities/DynamicObject/DynamicObject.h
@@ -41,7 +41,7 @@ class DynamicObject : public WorldObject, public GridObject<DynamicObject>
void AddToWorld();
void RemoveFromWorld();
- bool CreateDynamicObject(uint32 guidlow, Unit* caster, uint32 spellId, Position const& pos, float radius, DynamicObjectType type);
+ bool CreateDynamicObject(uint32 guidlow, Unit* caster, SpellInfo const* spell, Position const& pos, float radius, DynamicObjectType type);
void Update(uint32 p_time);
void Remove();
void SetDuration(int32 newDuration);