mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-25 11:21:58 +01:00
Core/Entities: debloat SummonGameObject parameter list using proper wrappers and enable GO rotation in scripts
- There's still an overload allowing for x, y, z, o to be passed directly - Fixed default animstate for GameObject creation in many places, it should be 255, not 100 (checked in sniffs)
This commit is contained in:
@@ -3507,7 +3507,7 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex)
|
||||
Map* map = target->GetMap();
|
||||
|
||||
if (!pGameObj->Create(map->GenerateLowGuid<HighGuid::GameObject>(), gameobject_id, map,
|
||||
m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), G3D::Quat(), 100, GO_STATE_READY))
|
||||
m_caster->GetPhaseMask(), Position(x, y, z, target->GetOrientation()), G3D::Quat(), 255, GO_STATE_READY))
|
||||
{
|
||||
delete pGameObj;
|
||||
return;
|
||||
@@ -3532,7 +3532,7 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex)
|
||||
{
|
||||
GameObject* linkedGO = new GameObject;
|
||||
if (linkedGO->Create(map->GenerateLowGuid<HighGuid::GameObject>(), linkedEntry, map,
|
||||
m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), G3D::Quat(), 100, GO_STATE_READY))
|
||||
m_caster->GetPhaseMask(), Position(x, y, z, target->GetOrientation()), G3D::Quat(), 255, GO_STATE_READY))
|
||||
{
|
||||
linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0);
|
||||
linkedGO->SetSpellId(m_spellInfo->Id);
|
||||
@@ -4121,13 +4121,16 @@ void Spell::EffectDuel(SpellEffIndex effIndex)
|
||||
|
||||
uint32 gameobject_id = m_spellInfo->Effects[effIndex].MiscValue;
|
||||
|
||||
Map* map = m_caster->GetMap();
|
||||
if (!pGameObj->Create(map->GenerateLowGuid<HighGuid::GameObject>(), gameobject_id,
|
||||
map, m_caster->GetPhaseMask(),
|
||||
m_caster->GetPositionX()+(unitTarget->GetPositionX()-m_caster->GetPositionX())/2,
|
||||
m_caster->GetPositionY()+(unitTarget->GetPositionY()-m_caster->GetPositionY())/2,
|
||||
Position const pos =
|
||||
{
|
||||
m_caster->GetPositionX() + (unitTarget->GetPositionX() - m_caster->GetPositionX()) / 2,
|
||||
m_caster->GetPositionY() + (unitTarget->GetPositionY() - m_caster->GetPositionY()) / 2,
|
||||
m_caster->GetPositionZ(),
|
||||
m_caster->GetOrientation(), G3D::Quat(), 0, GO_STATE_READY))
|
||||
m_caster->GetOrientation()
|
||||
};
|
||||
|
||||
Map* map = m_caster->GetMap();
|
||||
if (!pGameObj->Create(map->GenerateLowGuid<HighGuid::GameObject>(), gameobject_id, map, m_caster->GetPhaseMask(), pos, G3D::Quat(), 0, GO_STATE_READY))
|
||||
{
|
||||
delete pGameObj;
|
||||
return;
|
||||
@@ -4460,7 +4463,7 @@ void Spell::EffectSummonObject(SpellEffIndex effIndex)
|
||||
|
||||
Map* map = m_caster->GetMap();
|
||||
if (!go->Create(map->GenerateLowGuid<HighGuid::GameObject>(), go_id, map,
|
||||
m_caster->GetPhaseMask(), x, y, z, m_caster->GetOrientation(), G3D::Quat(), 0, GO_STATE_READY))
|
||||
m_caster->GetPhaseMask(), Position(x, y, z, m_caster->GetOrientation()), G3D::Quat(), 255, GO_STATE_READY))
|
||||
{
|
||||
delete go;
|
||||
return;
|
||||
@@ -5089,7 +5092,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
|
||||
GameObject* pGameObj = new GameObject;
|
||||
|
||||
if (!pGameObj->Create(cMap->GenerateLowGuid<HighGuid::GameObject>(), name_id, cMap,
|
||||
m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), G3D::Quat(), 100, GO_STATE_READY))
|
||||
m_caster->GetPhaseMask(), Position(fx, fy, fz, m_caster->GetOrientation()), G3D::Quat(), 255, GO_STATE_READY))
|
||||
{
|
||||
delete pGameObj;
|
||||
return;
|
||||
@@ -5155,7 +5158,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
|
||||
{
|
||||
GameObject* linkedGO = new GameObject;
|
||||
if (linkedGO->Create(cMap->GenerateLowGuid<HighGuid::GameObject>(), linkedEntry, cMap,
|
||||
m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), G3D::Quat(), 100, GO_STATE_READY))
|
||||
m_caster->GetPhaseMask(), Position(fx, fy, fz, m_caster->GetOrientation()), G3D::Quat(), 255, GO_STATE_READY))
|
||||
{
|
||||
linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0);
|
||||
//linkedGO->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel());
|
||||
|
||||
Reference in New Issue
Block a user