Forums WoW Modding Support Archives Azerothcore Discord Archives [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

[DiscordArchive] One question, sorry to bother, is that I need to get the name of the zone and the area of the charac

rektbyfaith
Administrator
0
05-08-2023, 04:35 PM
#1
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&]
rektbyfaith
05-08-2023, 04:35 PM #1

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&]

rektbyfaith
Administrator
0
05-08-2023, 05:30 PM
#2
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
rektbyfaith
05-08-2023, 05:30 PM #2

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

rektbyfaith
Administrator
0
05-08-2023, 05:40 PM
#3
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
rektbyfaith
05-08-2023, 05:40 PM #3

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

rektbyfaith
Administrator
0
05-08-2023, 05:42 PM
#4
Archived author: Racknar0 • Posted: 2023-05-08T17:42:47.356000+00:00
Original source

thanks
rektbyfaith
05-08-2023, 05:42 PM #4

Archived author: Racknar0 • Posted: 2023-05-08T17:42:47.356000+00:00
Original source

thanks

rektbyfaith
Administrator
0
05-08-2023, 05:42 PM
#5
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
rektbyfaith
05-08-2023, 05:42 PM #5

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

rektbyfaith
Administrator
0
05-08-2023, 05:43 PM
#6
Archived author: Racknar0 • Posted: 2023-05-08T17:43:10.171000+00:00
Original source

oky doky thanks
rektbyfaith
05-08-2023, 05:43 PM #6

Archived author: Racknar0 • Posted: 2023-05-08T17:43:10.171000+00:00
Original source

oky doky thanks

rektbyfaith
Administrator
0
05-08-2023, 05:48 PM
#7
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.
rektbyfaith
05-08-2023, 05:48 PM #7

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.

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)