diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 10f491b64..66b9b3133 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -1826,22 +1826,23 @@ void Creature::GetRespawnCoord( float &x, float &y, float &z, float* ori, float* x = data->posX; y = data->posY; z = data->posZ; - if(ori) + if (ori) *ori = data->orientation; - if(dist) + if (dist) *dist = data->spawndist; return; } } - x = GetPositionX(); - y = GetPositionY(); - z = GetPositionZ(); - if(ori) - *ori = GetOrientation(); - if(dist) - *dist = 0; + float orient; + + GetSummonPoint(x, y, z, orient); + + if (ori) + *ori = orient; + if (dist) + *dist = GetRespawnRadius(); } void Creature::AllLootRemovedFromCorpse() diff --git a/src/game/Creature.h b/src/game/Creature.h index e9031c251..9cabccd59 100644 --- a/src/game/Creature.h +++ b/src/game/Creature.h @@ -576,6 +576,9 @@ class MANGOS_DLL_SPEC Creature : public Unit void SetCombatStartPosition(float x, float y, float z) { CombatStartX = x; CombatStartY = y; CombatStartZ = z; } void GetCombatStartPosition(float &x, float &y, float &z) { x = CombatStartX; y = CombatStartY; z = CombatStartZ; } + void SetSummonPoint(float fX, float fY, float fZ, float fOrient) { m_summonXpoint = fX; m_summonYpoint = fY; m_summonZpoint = fZ; m_summonOrientation = fOrient; } + void GetSummonPoint(float &fX, float &fY, float &fZ, float &fOrient) const { fX = m_summonXpoint; fY = m_summonYpoint; fZ = m_summonZpoint; fOrient = m_summonOrientation; } + uint32 GetGlobalCooldown() const { return m_GlobalCooldown; } void SetDeadByDefault (bool death_state) { m_isDeadByDefault = death_state; } @@ -629,6 +632,12 @@ class MANGOS_DLL_SPEC Creature : public Unit float CombatStartX; float CombatStartY; float CombatStartZ; + + float m_summonXpoint; + float m_summonYpoint; + float m_summonZpoint; + float m_summonOrientation; + private: GridReference m_gridRef; CreatureInfo const* m_creatureInfo; // in difficulty mode > 0 can different from ObjMgr::GetCreatureTemplate(GetEntry()) diff --git a/src/game/Object.cpp b/src/game/Object.cpp index cc59980f7..83b2ae917 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1687,6 +1687,7 @@ Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, floa GetClosePoint(x, y, z, pCreature->GetObjectSize()); pCreature->Relocate(x, y, z, ang); + pCreature->SetSummonPoint(x, y, z, ang); if(!pCreature->IsPositionValid()) { diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index d349ac1ae..670632930 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9112" + #define REVISION_NR "9113" #endif // __REVISION_NR_H__