From 355d41eac6877ed5a5a099710a2d362eac3e2df7 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Sat, 16 Jun 2018 18:59:07 +0200 Subject: [PATCH] Core/Spells: re-fixed orientation of summoned gameobjects and wild gameobject summons --- src/server/game/Spells/SpellEffects.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 52167fc1c9a..7c553de8eb6 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3188,16 +3188,19 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex) if (!target) target = m_caster; - float x, y, z; + float x, y, z, o; if (m_targets.HasDst()) destTarget->GetPosition(x, y, z); else m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE); + o = frand(0, float(M_PI * 2)); + QuaternionData rot = QuaternionData::fromEulerAnglesZYX(o, 0.f, 0.f); + Map* map = target->GetMap(); if (!pGameObj->Create(map->GenerateLowGuid(), gameobject_id, map, - m_caster->GetPhaseMask(), Position(x, y, z, target->GetOrientation()), QuaternionData(), 255, GO_STATE_READY)) + m_caster->GetPhaseMask(), Position(x, y, z, target->GetOrientation()), rot, 255, GO_STATE_READY)) { delete pGameObj; return; @@ -4881,9 +4884,11 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex) if (goinfo->type == GAMEOBJECT_TYPE_SUMMONING_RITUAL) m_caster->GetPosition(fx, fy, fz); + QuaternionData rot = QuaternionData::fromEulerAnglesZYX(fo, 0.f, 0.f); + GameObject* pGameObj = new GameObject; - if (!pGameObj->Create(cMap->GenerateLowGuid(), name_id, cMap, 0, Position(fx, fy, fz, m_caster->GetOrientation()), QuaternionData(), 255, GO_STATE_READY)) + if (!pGameObj->Create(cMap->GenerateLowGuid(), name_id, cMap, 0, Position(fx, fy, fz, m_caster->GetOrientation()), rot, 255, GO_STATE_READY)) { delete pGameObj; return;