[DiscordArchive] One question, sorry to bother, is that I need to get the name of the zone and the area of the charac
[DiscordArchive] One question, sorry to bother, is that I need to get the name of the zone and the area of the charac
![[Image: image.png?ex=690c259d&is=690ad41d&hm=e6c...ba95b5935&]](https://cdn.discordapp.com/attachments/448835144564867094/1105171174251581490/image.png?ex=690c259d&is=690ad41d&hm=e6c3d9a6b167cf5000afddd4638035763e5c3381b43a2cf19a8ccceba95b5935&)
Archived author: Racknar0 • Posted: 2023-05-08T16:35:41.103000+00:00
Original source
One question, sorry to bother, is that I need to get the name of the zone and the area of the character, is there any method to query it with lua? as well as in getname of the map? or how could I do it?
![[Image: image.png?ex=690c259d&is=690ad41d&hm=e6c...ba95b5935&]](https://cdn.discordapp.com/attachments/448835144564867094/1105171174251581490/image.png?ex=690c259d&is=690ad41d&hm=e6c3d9a6b167cf5000afddd4638035763e5c3381b43a2cf19a8ccceba95b5935&)
Archived author: Roboto • Posted: 2023-05-08T17:30:02.147000+00:00
Original source
Not possible currently, you can get the names from AreaTable.dbc and store them in a Lua table
Archived author: Shadownet-Cuba • Posted: 2023-05-08T17:40:44.133000+00:00
Original source
Can you use this SQL that contains the data from AreaTable.dbc and create a function in your script that returns the name of the map from the database
AreaTable.sql
Archived author: Racknar0 • Posted: 2023-05-08T17:42:47.356000+00:00
Original source
thanks
Archived author: Shadownet-Cuba • Posted: 2023-05-08T17:42:52.082000+00:00
Original source
```Lua
local function GetMapName(mapID)
local query = "SELECT `name` FROM `areatable` WHERE `id` = " .. mapID
local result = WorldDBQuery(query)
if result then
return result:GetString(0)
end
return nil
end
-- Ejemplo de uso
local mapID = 12345 -- ID del mapa que deseas obtener
local mapName = GetMapName(mapID)
if mapName then
print("El nombre del mapa con ID " .. mapID .. " es: " .. mapName)
else
print("No se encontró un mapa con ID " .. mapID)
end
```
modify it and adapt it to your needs
Archived author: Racknar0 • Posted: 2023-05-08T17:43:10.171000+00:00
Original source
oky doky thanks
Archived author: Honey • Posted: 2023-05-08T17:48:10.743000+00:00
Original source
I'd rather store them in a container at start-up if it's world data.
Or for player data, load them with an async query (yes, ACs mod-Eluna can do that. Thanks Roboto!) at login and dump the data at logout.