Standardize location reporting across modules

This commit is contained in:
2025-01-09 12:52:47 +01:00
parent 58e071e77b
commit dee5053345
3 changed files with 27 additions and 3 deletions

View File

@@ -79,11 +79,29 @@ function shared.DeathReporter.Init()
ModuleName, source, destination, spellName))
end
local location = Heimdall_Data.config.deathReporter.zoneOverride
if not location or location == "" then
location = string.format("%s (%s)", GetZoneText(), GetSubZoneText())
end
local x, y = GetPlayerMapPosition("player")
if Heimdall_Data.config.deathReporter.debug then
print(string.format("[%s] Player coordinates: %.2f, %.2f", ModuleName, x * 100, y * 100))
end
SetMapToCurrentZone()
SetMapByID(GetCurrentMapAreaID())
---@type Message
local msg = {
channel = "CHANNEL",
data = Heimdall_Data.config.deathReporter.masterChannel,
message = string.format("%s killed %s with %s", source, destination, spellName)
message = string.format("%s killed %s with %s in %s [%s](%2.2f, %2.2f)",
source,
destination,
spellName,
location,
tostring(GetCurrentMapAreaID()),
x * 100, y * 100)
}
if Heimdall_Data.config.deathReporter.debug then
print(string.format("[%s] Adding message to queue: %s", ModuleName, msg.message))