Standardize location reporting across modules
This commit is contained in:
@@ -67,13 +67,16 @@ function shared.CombatAlerter.Init()
|
|||||||
y * 100))
|
y * 100))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
SetMapToCurrentZone()
|
||||||
|
SetMapByID(GetCurrentMapAreaID())
|
||||||
---@type Message
|
---@type Message
|
||||||
local msg = {
|
local msg = {
|
||||||
channel = "CHANNEL",
|
channel = "CHANNEL",
|
||||||
data = Heimdall_Data.config.combatAlerter.masterChannel,
|
data = Heimdall_Data.config.combatAlerter.masterChannel,
|
||||||
message = string.format("%s is attacking me in %s(%s) at %2.2f,%2.2f ",
|
message = string.format("I am in combat with %s at %s (%s) at [%s](%2.2f, %2.2f)",
|
||||||
source,
|
source,
|
||||||
zone, subZone,
|
zone, subZone,
|
||||||
|
tostring(GetCurrentMapAreaID()),
|
||||||
x * 100, y * 100
|
x * 100, y * 100
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,11 +79,29 @@ function shared.DeathReporter.Init()
|
|||||||
ModuleName, source, destination, spellName))
|
ModuleName, source, destination, spellName))
|
||||||
end
|
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
|
---@type Message
|
||||||
local msg = {
|
local msg = {
|
||||||
channel = "CHANNEL",
|
channel = "CHANNEL",
|
||||||
data = Heimdall_Data.config.deathReporter.masterChannel,
|
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
|
if Heimdall_Data.config.deathReporter.debug then
|
||||||
print(string.format("[%s] Adding message to queue: %s", ModuleName, msg.message))
|
print(string.format("[%s] Adding message to queue: %s", ModuleName, msg.message))
|
||||||
|
|||||||
@@ -154,7 +154,9 @@ function shared.Spotter.Init()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local stinky = Heimdall_Data.config.stinkies[name] or false
|
local stinky = Heimdall_Data.config.stinkies[name] or false
|
||||||
local text = string.format("I see (%s) %s/%s %s of race %s (%s) with health %s/%s at %s (%2.2f, %2.2f)",
|
SetMapToCurrentZone()
|
||||||
|
SetMapByID(GetCurrentMapAreaID())
|
||||||
|
local text = string.format("I see (%s) %s/%s %s of race %s (%s) with health %s/%s at %s [%s](%2.2f, %2.2f)",
|
||||||
hostile and "Hostile" or "Friendly",
|
hostile and "Hostile" or "Friendly",
|
||||||
name,
|
name,
|
||||||
class,
|
class,
|
||||||
@@ -164,6 +166,7 @@ function shared.Spotter.Init()
|
|||||||
FormatHP(hp),
|
FormatHP(hp),
|
||||||
FormatHP(maxHp),
|
FormatHP(maxHp),
|
||||||
location,
|
location,
|
||||||
|
tostring(GetCurrentMapAreaID()),
|
||||||
x * 100, y * 100)
|
x * 100, y * 100)
|
||||||
|
|
||||||
if Heimdall_Data.config.spotter.debug then
|
if Heimdall_Data.config.spotter.debug then
|
||||||
|
|||||||
Reference in New Issue
Block a user