diff options
Diffstat (limited to 'src/server/game/Entities/DynamicObject')
| -rwxr-xr-x | src/server/game/Entities/DynamicObject/DynamicObject.cpp | 16 | ||||
| -rwxr-xr-x | src/server/game/Entities/DynamicObject/DynamicObject.h | 2 |
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); |
