From cd36035891025d526db81c22bd898df62bb6846f Mon Sep 17 00:00:00 2001 From: MowFord <131182600+MowFord@users.noreply.github.com> Date: Wed, 8 May 2024 18:49:38 -0500 Subject: [PATCH 1/2] Set mob positions to spawn location on init --- src/map/instance_loader.cpp | 1 + src/map/utils/zoneutils.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/map/instance_loader.cpp b/src/map/instance_loader.cpp index 95cf28b2f42..da8eccc6d15 100644 --- a/src/map/instance_loader.cpp +++ b/src/map/instance_loader.cpp @@ -102,6 +102,7 @@ CInstance* CInstanceLoader::LoadInstance() PMob->m_SpawnPoint.x = _sql->GetFloatData(3); PMob->m_SpawnPoint.y = _sql->GetFloatData(4); PMob->m_SpawnPoint.z = _sql->GetFloatData(5); + PMob->loc.p = PMob->m_SpawnPoint; PMob->m_RespawnTime = _sql->GetUIntData(6) * 1000; PMob->m_SpawnType = (SPAWNTYPE)_sql->GetUIntData(7); diff --git a/src/map/utils/zoneutils.cpp b/src/map/utils/zoneutils.cpp index aa95ff9090c..8db037ec0c4 100644 --- a/src/map/utils/zoneutils.cpp +++ b/src/map/utils/zoneutils.cpp @@ -440,6 +440,7 @@ namespace zoneutils PMob->m_SpawnPoint.x = sql->GetFloatData(4); PMob->m_SpawnPoint.y = sql->GetFloatData(5); PMob->m_SpawnPoint.z = sql->GetFloatData(6); + PMob->loc.p = PMob->m_SpawnPoint; PMob->m_RespawnTime = sql->GetUIntData(7) * 1000; PMob->m_SpawnType = (SPAWNTYPE)sql->GetUIntData(8); From ae24137c44461d887b261ae406b40e04955780c9 Mon Sep 17 00:00:00 2001 From: MowFord <131182600+MowFord@users.noreply.github.com> Date: Wed, 8 May 2024 18:54:42 -0500 Subject: [PATCH 2/2] Improve wording of gotoid and gotoname --- scripts/commands/gotoid.lua | 4 ++-- scripts/commands/gotoname.lua | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/commands/gotoid.lua b/scripts/commands/gotoid.lua index bc7d9945749..8ac43092a80 100644 --- a/scripts/commands/gotoid.lua +++ b/scripts/commands/gotoid.lua @@ -57,9 +57,9 @@ commandObj.onTrigger = function(player, target) -- display message if isUp then - player:printToPlayer(string.format('Going to %s (%i).', targ:getName(), targ:getID())) + player:printToPlayer(string.format('Going to %s (%i) in %s.', targ:getName(), targ:getID(), targ:getZoneName())) else - player:printToPlayer(string.format('%s (%i) is not currently up. Going to last known coordinates.', targ:getName(), targ:getID())) + player:printToPlayer(string.format('%s (%i) is not currently up in %s. Going to last known coordinates.', targ:getName(), targ:getID(), targ:getZoneName())) end -- half a second later, go. this delay gives time for previous message to appear diff --git a/scripts/commands/gotoname.lua b/scripts/commands/gotoname.lua index 6a71baa8f0b..dbd8417ff85 100644 --- a/scripts/commands/gotoname.lua +++ b/scripts/commands/gotoname.lua @@ -46,7 +46,11 @@ local goToEntity = function(player, entity) end -- display message - player:printToPlayer(string.format('Going to %s %s (%i).', entity:getName(), entity:getZoneName(), entity:getID())) + if entity:isSpawned() then + player:printToPlayer(string.format('Going to %s (%i).', entity:getName(), entity:getID())) + else + player:printToPlayer(string.format('%s (%i) is not currently up. Going to last known coordinates.', entity:getName(), entity:getID())) + end -- half a second later, go. this delay gives time for previous message to appear player:timer(500, function(playerArg)