Core/Misc: Switch to G3D::Quat::fromYPRAngles in QuaternionData::fromEulerAnglesZYX and add QuaternionData::fromOrientation for cases where only orientation is available

Signed-off-by: luis <[email protected]>
This commit is contained in:
Shauren
2026-10-05 11:23:32 -03:00
committed by luis
parent 6ef27ab3c2
commit 9f7b277693
25 changed files with 49 additions and 42 deletions
@@ -1406,7 +1406,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
for (WorldObject* target : targets)
{
Position pos = target->GetPositionWithOffset(Position(e.target.x, e.target.y, e.target.z, e.target.o));
QuaternionData rot = QuaternionData::fromEulerAnglesZYX(pos.GetOrientation(), 0.f, 0.f);
QuaternionData rot = QuaternionData::fromOrientation(pos.GetOrientation());
GameObject* summon = summoner->SummonGameObject(e.action.summonGO.entry, pos, rot, Seconds(e.action.summonGO.despawnTime), GOSummonType(e.action.summonGO.summonType));
if (e.action.summonGO.storedTargetId && summon)
AddToStoredTargetList({ summon }, e.action.summonGO.storedTargetId);
@@ -1415,7 +1415,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (e.GetTargetType() != SMART_TARGET_POSITION)
break;
QuaternionData rot = QuaternionData::fromEulerAnglesZYX(e.target.o, 0.f, 0.f);
QuaternionData rot = QuaternionData::fromOrientation(e.target.o);
GameObject* summon = summoner->SummonGameObject(e.action.summonGO.entry, Position(e.target.x, e.target.y, e.target.z, e.target.o), rot, Seconds(e.action.summonGO.despawnTime), GOSummonType(e.action.summonGO.summonType));
if (e.action.summonGO.storedTargetId && summon)
AddToStoredTargetList({ summon }, e.action.summonGO.storedTargetId);
@@ -81,7 +81,7 @@ GameObject* ArenaScript::CreateObject(uint32 entry, float x, float y, float z, f
TC_LOG_DEBUG("bg.battleground", "Battleground::AddObject: gameoobject [entry: {}] for BG (map: {}) has zeroed rotation fields, "
"orientation used temporally, but please fix the spawn", entry, battlegroundMap->GetId());
rot = QuaternionData::fromEulerAnglesZYX(o, 0.f, 0.f);
rot = QuaternionData::fromOrientation(o);
}
// Must be created this way, adding to godatamap would add it to the base map of the instance
@@ -128,12 +128,18 @@ bool QuaternionData::isUnit() const
void QuaternionData::toEulerAnglesZYX(float& Z, float& Y, float& X) const
{
G3D::Matrix3(G3D::Quat(x, y, z, w)).toEulerAnglesZYX(Z, Y, X);
G3D::Quat(x, y, z, w).toYPRAngles(Z, Y, X);
}
QuaternionData QuaternionData::fromEulerAnglesZYX(float Z, float Y, float X)
{
G3D::Quat quat(G3D::Matrix3::fromEulerAnglesZYX(Z, Y, X));
G3D::Quat quat = G3D::Quat::fromYPRAngles(Z, Y, X);
return QuaternionData(quat.x, quat.y, quat.z, quat.w);
}
QuaternionData QuaternionData::fromOrientation(float orientation)
{
G3D::Quat quat = G3D::Quat::fromAxisAngleRotation(G3D::Vector3::unitZ(), orientation);
return QuaternionData(quat.x, quat.y, quat.z, quat.w);
}
@@ -3930,7 +3936,7 @@ void GameObject::SetParentRotation(QuaternionData const& rotation)
void GameObject::SetLocalRotationAngles(float z_rot, float y_rot, float x_rot)
{
G3D::Quat quat(G3D::Matrix3::fromEulerAnglesZYX(z_rot, y_rot, x_rot));
QuaternionData quat = QuaternionData::fromEulerAnglesZYX(z_rot, y_rot, x_rot);
SetLocalRotation(quat.x, quat.y, quat.z, quat.w);
}
@@ -3946,7 +3952,7 @@ QuaternionData GameObject::GetWorldRotation() const
G3D::Quat resultRotation = localRotationQuat * worldRotationQuat;
return QuaternionData(resultRotation.x, resultRotation.y, resultRotation.z, resultRotation.w);
localRotation = { resultRotation.x, resultRotation.y, resultRotation.z, resultRotation.w };
}
return localRotation;
}
@@ -34,6 +34,7 @@ struct TC_GAME_API QuaternionData
bool isUnit() const;
void toEulerAnglesZYX(float& Z, float& Y, float& X) const;
static QuaternionData fromEulerAnglesZYX(float Z, float Y, float X);
static QuaternionData fromOrientation(float orientation);
friend bool operator==(QuaternionData const& left, QuaternionData const& right) = default;
};
+1 -1
View File
@@ -4331,7 +4331,7 @@ GameObject* Garrison::Plot::CreateGameObject(Map* map, GarrisonFactionIndex fact
if (FinalizeGarrisonPlotGOInfo const* finalizeInfo = sGarrisonMgr.GetPlotFinalizeGOInfo(PacketInfo.GarrPlotInstanceID))
{
Position const& pos2 = finalizeInfo->FactionInfo[faction].Pos;
if (GameObject* finalizer = GameObject::CreateGameObject(finalizeInfo->FactionInfo[faction].GameObjectId, map, pos2, QuaternionData::fromEulerAnglesZYX(pos2.GetOrientation(), 0.0f, 0.0f), 255, GO_STATE_READY))
if (GameObject* finalizer = GameObject::CreateGameObject(finalizeInfo->FactionInfo[faction].GameObjectId, map, pos2, QuaternionData::fromOrientation(pos2.GetOrientation()), 255, GO_STATE_READY))
{
// set some spell id to make the object delete itself after use
finalizer->SetSpellId(finalizer->GetGOInfo()->goober.spell);
+1 -1
View File
@@ -2700,7 +2700,7 @@ void ObjectMgr::LoadGameObjects()
if (!data.rotation.isUnit())
{
TC_LOG_ERROR("sql.sql", "Table `gameobject` has gameobject (GUID: {} Entry: {}) with invalid rotation quaternion (non-unit), defaulting to orientation on Z axis only", guid, data.id);
data.rotation = QuaternionData::fromEulerAnglesZYX(data.spawnPoint.GetOrientation(), 0.0f, 0.0f);
data.rotation = QuaternionData::fromOrientation(data.spawnPoint.GetOrientation());
}
if (sWorld->getBoolConfig(CONFIG_CALCULATE_GAMEOBJECT_ZONE_AREA_DATA))
@@ -6782,7 +6782,7 @@ void AuraEffect::HandleBattlegroundPlayerPosition(AuraApplication const* aurApp,
if (GameObject* gameObjectCaster = target->GetMap()->GetGameObject(GetCasterGUID()))
{
gameObjectCaster->HandleCustomTypeCommand(GameObjectType::SetNewFlagState(FlagState::Dropped, target));
if (GameObject* droppedFlag = gameObjectCaster->SummonGameObject(gameObjectCaster->GetGOInfo()->newflag.FlagDrop, target->GetPosition(), QuaternionData::fromEulerAnglesZYX(target->GetOrientation(), 0.f, 0.f), Seconds(gameObjectCaster->GetGOInfo()->newflag.ExpireDuration / 1000), GO_SUMMON_TIMED_DESPAWN))
if (GameObject* droppedFlag = gameObjectCaster->SummonGameObject(gameObjectCaster->GetGOInfo()->newflag.FlagDrop, target->GetPosition(), QuaternionData::fromOrientation(target->GetOrientation()), Seconds(gameObjectCaster->GetGOInfo()->newflag.ExpireDuration / 1000), GO_SUMMON_TIMED_DESPAWN))
droppedFlag->SetOwnerGUID(gameObjectCaster->GetGUID());
}
}
@@ -6935,7 +6935,7 @@ void AuraEffect::HandleAuraActAsControlZone(AuraApplication const* aurApp, uint8
return;
}
if (GameObject* controlZone = auraOwner->SummonGameObject(gameobjectTemplate->entry, auraOwner->GetPosition(), QuaternionData::fromEulerAnglesZYX(aurApp->GetTarget()->GetOrientation(), 0.f, 0.f), 24h, GO_SUMMON_TIMED_OR_CORPSE_DESPAWN))
if (GameObject* controlZone = auraOwner->SummonGameObject(gameobjectTemplate->entry, auraOwner->GetPosition(), QuaternionData::fromOrientation(aurApp->GetTarget()->GetOrientation()), 24h, GO_SUMMON_TIMED_OR_CORPSE_DESPAWN))
controlZone->SetSpellId(GetSpellInfo()->Id);
}
+5 -5
View File
@@ -3558,7 +3558,7 @@ void Spell::EffectSummonObjectWild()
Map* map = target->GetMap();
Position pos = Position(x, y, z, o);
QuaternionData rot = QuaternionData::fromEulerAnglesZYX(o, 0.f, 0.f);
QuaternionData rot = QuaternionData::fromOrientation(o);
GameObject* go = GameObject::CreateGameObject(effectInfo->MiscValue, map, pos, rot, 255, GO_STATE_READY);
if (!go)
return;
@@ -3802,7 +3802,7 @@ void Spell::EffectDuel()
caster->GetPositionZ(),
caster->GetOrientation()
};
QuaternionData rot = QuaternionData::fromEulerAnglesZYX(pos.GetOrientation(), 0.f, 0.f);
QuaternionData rot = QuaternionData::fromOrientation(pos.GetOrientation());
GameObject* go = GameObject::CreateGameObject(effectInfo->MiscValue, map, pos, rot, 0, GO_STATE_READY);
if (!go)
@@ -4153,7 +4153,7 @@ void Spell::EffectSummonObject()
Map* map = m_caster->GetMap();
Position pos = Position(x, y, z, o);
QuaternionData rot = QuaternionData::fromEulerAnglesZYX(o, 0.f, 0.f);
QuaternionData rot = QuaternionData::fromOrientation(o);
GameObject* go = GameObject::CreateGameObject(effectInfo->MiscValue, map, pos, rot, 255, GO_STATE_READY);
if (!go)
@@ -5070,7 +5070,7 @@ void Spell::EffectTransmitted()
unitCaster->GetPosition(fx, fy, fz, fo);
Position pos = { fx, fy, fz, fo };
QuaternionData rot = QuaternionData::fromEulerAnglesZYX(fo, 0.f, 0.f);
QuaternionData rot = QuaternionData::fromOrientation(fo);
GameObject* go = GameObject::CreateGameObject(name_id, cMap, pos, rot, 255, GO_STATE_READY);
if (!go)
@@ -5955,7 +5955,7 @@ void Spell::EffectSummonPersonalGameObject()
Map* map = m_caster->GetMap();
Position pos = Position(x, y, z, o);
QuaternionData rot = QuaternionData::fromEulerAnglesZYX(o, 0.f, 0.f);
QuaternionData rot = QuaternionData::fromOrientation(o);
GameObject* go = GameObject::CreateGameObject(goId, map, pos, rot, 255, GO_STATE_READY);
if (!go)
@@ -101,7 +101,7 @@ bool BattlefieldTB::SetupBattlefield()
for (uint8 i = 0; i < TB_BASE_COUNT; i++)
{
//Spawn flag pole
if (GameObject* go = SpawnGameObject(TBCapturePoints[i].entryFlagPole[GetDefenderTeam()], TBCapturePoints[i].pos, QuaternionData::fromEulerAnglesZYX(TBCapturePoints[i].pos.GetOrientation(), 0.0f, 0.0f)))
if (GameObject* go = SpawnGameObject(TBCapturePoints[i].entryFlagPole[GetDefenderTeam()], TBCapturePoints[i].pos, QuaternionData::fromOrientation(TBCapturePoints[i].pos.GetOrientation())))
{
std::unique_ptr<TolBaradCapturePoint> controlZone = std::make_unique<TolBaradCapturePoint>(this, TBCapturePoints[i]);
if (GetDefenderTeam() == TEAM_ALLIANCE)
@@ -123,7 +123,7 @@ bool BattlefieldTB::SetupBattlefield()
// Spawn towers
for (uint8 i = 0; i < TB_TOWERS_COUNT; i++)
if (GameObject* go = SpawnGameObject(TBTowers[i].entry, TBTowers[i].pos, QuaternionData::fromEulerAnglesZYX(TBTowers[i].pos.GetOrientation(), 0.0f, 0.0f)))
if (GameObject* go = SpawnGameObject(TBTowers[i].entry, TBTowers[i].pos, QuaternionData::fromOrientation(TBTowers[i].pos.GetOrientation())))
Towers.insert(go->GetGUID());
// Init Graveyards
@@ -394,7 +394,7 @@ void BattlefieldTB::UpdateNPCsAndGameObjects()
// Create capture points
for (uint8 i = 0; i < TB_BASE_COUNT; i++)
{
if (GameObject* go = SpawnGameObject(TBCapturePoints[i].entryFlagPole[GetDefenderTeam()], TBCapturePoints[i].pos, QuaternionData::fromEulerAnglesZYX(TBCapturePoints[i].pos.GetOrientation(), 0.0f, 0.0f)))
if (GameObject* go = SpawnGameObject(TBCapturePoints[i].entryFlagPole[GetDefenderTeam()], TBCapturePoints[i].pos, QuaternionData::fromOrientation(TBCapturePoints[i].pos.GetOrientation())))
{
std::unique_ptr<TolBaradCapturePoint> controlZone = std::make_unique<TolBaradCapturePoint>(this, TBCapturePoints[i]);
if (GetDefenderTeam() == TEAM_ALLIANCE)
@@ -442,7 +442,7 @@ void BattlefieldTB::UpdateNPCsAndGameObjects()
// Spawn portals
for (uint8 i = 0; i < TB_PORTAL_MAX; i++)
if (GameObject* go = SpawnGameObject(TBPortalEntry[GetDefenderTeam()], TBPortals[i], QuaternionData::fromEulerAnglesZYX(TBPortals[i].GetOrientation(), 0.0f, 0.0f)))
if (GameObject* go = SpawnGameObject(TBPortalEntry[GetDefenderTeam()], TBPortals[i], QuaternionData::fromOrientation(TBPortals[i].GetOrientation())))
TemporaryGOs.insert(go->GetGUID());
// Update towers
@@ -469,7 +469,7 @@ void BattlefieldTB::UpdateNPCsAndGameObjects()
// Spawn banners
for (uint8 i = 0; i < TB_BANNER_MAX; i++)
if (GameObject* go = SpawnGameObject(TBBannerEntry[GetDefenderTeam()], TBBanners[i], QuaternionData::fromEulerAnglesZYX(TBBanners[i].GetOrientation(), 0.0f, 0.0f)))
if (GameObject* go = SpawnGameObject(TBBannerEntry[GetDefenderTeam()], TBBanners[i], QuaternionData::fromOrientation(TBBanners[i].GetOrientation())))
TemporaryGOs.insert(go->GetGUID());
// Set graveyard controls
@@ -797,7 +797,7 @@ struct npc_bg_seething_shore_air_supplies_drop : ScriptedAI
if (!groundDummy)
return;
QuaternionData const rot = QuaternionData::fromEulerAnglesZYX(groundDummy->GetOrientation(), 0.f, 0.f);
QuaternionData const rot = QuaternionData::fromOrientation(groundDummy->GetOrientation());
uint8 const action = urand(0, 3);
switch (action)
{
@@ -453,7 +453,7 @@ struct battleground_temple_of_kotmogu final : BattlegroundScript
void SpawnOrb(TempleOfKotmogu::StaticOrbData const* orbData) const
{
if (GameObject* orb = GameObject::CreateGameObject(orbData->Entry, battlegroundMap, orbData->SpawnPosition, QuaternionData::fromEulerAnglesZYX(orbData->SpawnPosition.GetOrientation(), 0.f, 0.f), 255, GO_STATE_READY))
if (GameObject* orb = GameObject::CreateGameObject(orbData->Entry, battlegroundMap, orbData->SpawnPosition, QuaternionData::fromOrientation(orbData->SpawnPosition.GetOrientation()), 255, GO_STATE_READY))
{
orb->SetSpawnedByDefault(false);
orb->SetRespawnTime(7200);
+2 -2
View File
@@ -130,7 +130,7 @@ public:
Player* player = handler->GetSession()->GetPlayer();
Map* map = player->GetMap();
GameObject* object = GameObject::CreateGameObject(objectInfo->entry, map, *player, QuaternionData::fromEulerAnglesZYX(player->GetOrientation(), 0.0f, 0.0f), 255, GO_STATE_READY);
GameObject* object = GameObject::CreateGameObject(objectInfo->entry, map, *player, QuaternionData::fromOrientation(player->GetOrientation()), 255, GO_STATE_READY);
if (!object)
return false;
@@ -172,7 +172,7 @@ public:
return false;
}
player->SummonGameObject(objectId, *player, QuaternionData::fromEulerAnglesZYX(player->GetOrientation(), 0.0f, 0.0f), spawntm);
player->SummonGameObject(objectId, *player, QuaternionData::fromOrientation(player->GetOrientation()), spawntm);
return true;
}
@@ -360,9 +360,9 @@ public:
me->SummonCreature(NPC_CHOMPER, SpawnPosition[16], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30min);
break;
case 9:
me->SummonGameObject(GO_RED_ROCKET, SpawnPosition[17], QuaternionData::fromEulerAnglesZYX(SpawnPosition[17].GetOrientation(), 0.0f, 0.0f), 2h);
me->SummonGameObject(GO_RED_ROCKET, SpawnPosition[18], QuaternionData::fromEulerAnglesZYX(SpawnPosition[18].GetOrientation(), 0.0f, 0.0f), 2h);
me->SummonGameObject(GO_RED_ROCKET, SpawnPosition[19], QuaternionData::fromEulerAnglesZYX(SpawnPosition[19].GetOrientation(), 0.0f, 0.0f), 2h);
me->SummonGameObject(GO_RED_ROCKET, SpawnPosition[17], QuaternionData::fromOrientation(SpawnPosition[17].GetOrientation()), 2h);
me->SummonGameObject(GO_RED_ROCKET, SpawnPosition[18], QuaternionData::fromOrientation(SpawnPosition[18].GetOrientation()), 2h);
me->SummonGameObject(GO_RED_ROCKET, SpawnPosition[19], QuaternionData::fromOrientation(SpawnPosition[19].GetOrientation()), 2h);
break;
}
}
@@ -198,7 +198,7 @@ public:
void UseStatue(GameObject* go)
{
go->SummonGameObject(GO_ATALAI_LIGHT1, *go, QuaternionData::fromEulerAnglesZYX(go->GetOrientation(), 0.0f, 0.0f), 0s);
go->SummonGameObject(GO_ATALAI_LIGHT1, *go, QuaternionData::fromOrientation(go->GetOrientation()), 0s);
go->SetFlag(GO_FLAG_INTERACT_COND);
}
+1 -1
View File
@@ -285,7 +285,7 @@ struct npc_firework : public ScriptedAI
float displacement = 0.7f;
for (uint8 i = 0; i < 4; i++)
me->SummonGameObject(GetFireworkGameObjectId(), me->GetPositionX() + (i % 2 == 0 ? displacement : -displacement), me->GetPositionY() + (i > 1 ? displacement : -displacement), me->GetPositionZ() + 4.0f, me->GetOrientation(), QuaternionData::fromEulerAnglesZYX(me->GetOrientation(), 0.0f, 0.0f), 1s);
me->SummonGameObject(GetFireworkGameObjectId(), me->GetPositionX() + (i % 2 == 0 ? displacement : -displacement), me->GetPositionY() + (i > 1 ? displacement : -displacement), me->GetPositionZ() + 4.0f, me->GetOrientation(), QuaternionData::fromOrientation(me->GetOrientation()), 1s);
}
else
//me->CastSpell(me, GetFireworkSpell(me->GetEntry()), true);
@@ -205,7 +205,7 @@ class boss_ossirian : public CreatureScript
if (Creature* Trigger = me->SummonCreature(NPC_OSSIRIAN_TRIGGER, CrystalCoordinates[CrystalIterator]))
{
TriggerGUID = Trigger->GetGUID();
if (GameObject* Crystal = Trigger->SummonGameObject(GO_OSSIRIAN_CRYSTAL, CrystalCoordinates[CrystalIterator], QuaternionData::fromEulerAnglesZYX(CrystalCoordinates[CrystalIterator].GetOrientation(), 0.0f, 0.0f), Seconds::max(), GO_SUMMON_TIMED_DESPAWN))
if (GameObject* Crystal = Trigger->SummonGameObject(GO_OSSIRIAN_CRYSTAL, CrystalCoordinates[CrystalIterator], QuaternionData::fromOrientation(CrystalCoordinates[CrystalIterator].GetOrientation()), Seconds::max(), GO_SUMMON_TIMED_DESPAWN))
{
CrystalGUID = Crystal->GetGUID();
++CrystalIterator;
@@ -438,7 +438,7 @@ public:
_explosivesGuids.clear();
for (uint8 i = 0; i != MAX_EXPLOSIVES; ++i)
{
if (GameObject* explosive = me->SummonGameObject(GO_DRAENEI_EXPLOSIVES_1, ExplosivesPos[0][i], QuaternionData::fromEulerAnglesZYX(ExplosivesPos[0][i].GetOrientation(), 0.0f, 0.0f), 0s))
if (GameObject* explosive = me->SummonGameObject(GO_DRAENEI_EXPLOSIVES_1, ExplosivesPos[0][i], QuaternionData::fromOrientation(ExplosivesPos[0][i].GetOrientation()), 0s))
_explosivesGuids.push_back(explosive->GetGUID());
}
me->HandleEmoteCommand(EMOTE_ONESHOT_NONE); // reset anim state
@@ -535,7 +535,7 @@ public:
_explosivesGuids.clear();
for (uint8 i = 0; i != MAX_EXPLOSIVES; ++i)
{
if (GameObject* explosive = me->SummonGameObject(GO_DRAENEI_EXPLOSIVES_2, ExplosivesPos[1][i], QuaternionData::fromEulerAnglesZYX(ExplosivesPos[1][i].GetOrientation(), 0.0f, 0.0f), 0s))
if (GameObject* explosive = me->SummonGameObject(GO_DRAENEI_EXPLOSIVES_2, ExplosivesPos[1][i], QuaternionData::fromOrientation(ExplosivesPos[1][i].GetOrientation()), 0s))
_explosivesGuids.push_back(explosive->GetGUID());
}
if (Player* player = GetPlayerForEscort())
@@ -314,7 +314,7 @@ class spell_sc_twilight_documents : public SpellScriptLoader
void SpawnGameObject(SpellEffIndex /*effIndex*/)
{
if (WorldLocation* loc = GetHitDest())
GetCaster()->SummonGameObject(GAMEOBJECT_TWILIGHT_DOCUMENTS, *loc, QuaternionData::fromEulerAnglesZYX(loc->GetOrientation(), 0.0f, 0.0f), 2h);
GetCaster()->SummonGameObject(GAMEOBJECT_TWILIGHT_DOCUMENTS, *loc, QuaternionData::fromOrientation(loc->GetOrientation()), 2h);
}
void Register() override
@@ -162,7 +162,7 @@ public:
{
pAnnouncer->GetMotionMaster()->MovePoint(0, 748.309f, 619.487f, 411.171f);
pAnnouncer->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
pAnnouncer->SummonGameObject(instance->IsHeroic() ? GO_CHAMPIONS_LOOT_H : GO_CHAMPIONS_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, QuaternionData::fromEulerAnglesZYX(1.42f, 0.0f, 0.0f), 25h);
pAnnouncer->SummonGameObject(instance->IsHeroic() ? GO_CHAMPIONS_LOOT_H : GO_CHAMPIONS_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, QuaternionData::fromOrientation(1.42f), 25h);
}
}
}
@@ -1245,7 +1245,7 @@ class spell_sindragosa_ice_tomb_trap : public AuraScript
{
summon->AI()->SetGUID(GetTarget()->GetGUID(), DATA_TRAPPED_PLAYER);
GetTarget()->CastSpell(GetTarget(), SPELL_ICE_TOMB_UNTARGETABLE);
if (GameObject* go = summon->SummonGameObject(GO_ICE_BLOCK, pos, QuaternionData::fromEulerAnglesZYX(pos.GetOrientation(), 0.0f, 0.0f), 0s))
if (GameObject* go = summon->SummonGameObject(GO_ICE_BLOCK, pos, QuaternionData::fromOrientation(pos.GetOrientation()), 0s))
{
go->SetSpellId(SPELL_ICE_TOMB_DAMAGE);
summon->AddGameObject(go);
@@ -2067,9 +2067,9 @@ private:
if (Creature* target = GetTarget()->ToCreature())
{
if (target->GetMap()->GetDifficultyID() == DIFFICULTY_10_N)
_alexstraszaGift = target->SummonGameObject(GO_ALEXSTRASZA_S_GIFT_10, *target, QuaternionData::fromEulerAnglesZYX(target->GetOrientation(), 0.0f, 0.0f), 0s);
_alexstraszaGift = target->SummonGameObject(GO_ALEXSTRASZA_S_GIFT_10, *target, QuaternionData::fromOrientation(target->GetOrientation()), 0s);
else if (target->GetMap()->GetDifficultyID() == DIFFICULTY_25_N)
_alexstraszaGift = target->SummonGameObject(GO_ALEXSTRASZA_S_GIFT_25, *target, QuaternionData::fromEulerAnglesZYX(target->GetOrientation(), 0.0f, 0.0f), 0s);
_alexstraszaGift = target->SummonGameObject(GO_ALEXSTRASZA_S_GIFT_25, *target, QuaternionData::fromOrientation(target->GetOrientation()), 0s);
}
}
@@ -101,7 +101,7 @@ public:
// There is no other way afaik...
void SpawnGameObject(uint32 entry, Position const& pos)
{
if (GameObject* go = GameObject::CreateGameObject(entry, instance, pos, QuaternionData::fromEulerAnglesZYX(pos.GetOrientation(), 0.0f, 0.0f), 255, GO_STATE_READY))
if (GameObject* go = GameObject::CreateGameObject(entry, instance, pos, QuaternionData::fromOrientation(pos.GetOrientation()), 255, GO_STATE_READY))
instance->AddToMap(go);
}
@@ -156,7 +156,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId)
{
// he dropped it further, summon mound
Map* map = player->GetMap();
if (GameObject* go = GameObject::CreateGameObject(SI_SILITHYST_MOUND, map, *player, QuaternionData::fromEulerAnglesZYX(player->GetOrientation(), 0.0f, 0.0f), 255, GO_STATE_READY))
if (GameObject* go = GameObject::CreateGameObject(SI_SILITHYST_MOUND, map, *player, QuaternionData::fromOrientation(player->GetOrientation()), 255, GO_STATE_READY))
{
PhasingHandler::InheritPhaseShift(go, player);
go->SetRespawnTime(0);
@@ -947,7 +947,7 @@ public:
{
// Spell 37392 does not exist in dbc, manually spawning
me->SummonCreature(NPC_OSCILLATING_FREQUENCY_SCANNER_TOP_BUNNY, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 0.5f, me->GetOrientation(), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 50s);
me->SummonGameObject(GO_OSCILLATING_FREQUENCY_SCANNER, *me, QuaternionData::fromEulerAnglesZYX(me->GetOrientation(), 0.0f, 0.0f), 50s);
me->SummonGameObject(GO_OSCILLATING_FREQUENCY_SCANNER, *me, QuaternionData::fromOrientation(me->GetOrientation()), 50s);
me->DespawnOrUnsummon(50s);
}
@@ -1212,7 +1212,7 @@ struct boss_anduin_wrynn : public BossAI
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
DoAction(ACTION_MOVE_NPCS_ON_PLATFORM);
if (GameObject* chest = me->SummonGameObject(GAMEOBJECT_ANDUIN_CHEST_LOOT, ChestLootSpawnPosition, QuaternionData::fromEulerAnglesZYX(-225.0f, 0.0f, 0.0f), 7_days))
if (GameObject* chest = me->SummonGameObject(GAMEOBJECT_ANDUIN_CHEST_LOOT, ChestLootSpawnPosition, QuaternionData::fromOrientation(-225.0f), 7_days))
{
chest->SetGoState(GO_STATE_ACTIVE);
chest->SetSpellVisualId(SPELL_VISUAL_CHEST_LOOT, ObjectGuid::Empty);