Dynamic Creature/Go spawning

Port From (https://github.com/TrinityCore/TrinityCore/commit/03b125e6d1947258316c931499746696a95aded2)
This commit is contained in:
hondacrx
2020-08-23 21:52:32 -04:00
parent 8fc9c45d50
commit 15ae7a7c66
45 changed files with 3925 additions and 1963 deletions
+5 -16
View File
@@ -202,28 +202,17 @@ namespace Game.Chat.Commands
if (!ulong.TryParse(id, out ulong guidLow) || guidLow == 0)
return false;
float x, y, z, o;
uint mapId;
// by DB guid
GameObjectData goData = Global.ObjectMgr.GetGOData(guidLow);
if (goData != null)
{
x = goData.posX;
y = goData.posY;
z = goData.posZ;
o = goData.orientation;
mapId = goData.mapid;
}
else
GameObjectData goData = Global.ObjectMgr.GetGameObjectData(guidLow);
if (goData == null)
{
handler.SendSysMessage(CypherStrings.CommandGoobjnotfound);
return false;
}
if (!GridDefines.IsValidMapCoord(mapId, x, y, z, o) || Global.ObjectMgr.IsTransportMap(mapId))
if (!GridDefines.IsValidMapCoord(goData.spawnPoint) || Global.ObjectMgr.IsTransportMap(goData.spawnPoint.GetMapId()))
{
handler.SendSysMessage(CypherStrings.InvalidTargetCoord, x, y, mapId);
handler.SendSysMessage(CypherStrings.InvalidTargetCoord, goData.spawnPoint.GetPositionX(), goData.spawnPoint.GetPositionY(), goData.spawnPoint.GetMapId());
return false;
}
@@ -237,7 +226,7 @@ namespace Game.Chat.Commands
else
player.SaveRecallPosition();
player.TeleportTo(mapId, x, y, z, o);
player.TeleportTo(goData.spawnPoint);
return true;
}