mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Added Global Method
* GetAreaName(area or zone ID) - Returns area or zone (string) name by area or zone ID (WIKI: http://wiki.emudevs.com/doku.php?id=eluna_global_method_getareaname)
This commit is contained in:
@@ -267,6 +267,17 @@ namespace LuaGlobalFunctions
|
||||
return 1;
|
||||
}
|
||||
|
||||
int GetAreaName(lua_State* L)
|
||||
{
|
||||
uint32 areaOrZoneId = sEluna->CHECKVAL<uint32>(L, 1);
|
||||
AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(areaOrZoneId);
|
||||
if (!areaEntry)
|
||||
return luaL_argerror(L, 1, "Invalid Area or Zone ID");
|
||||
|
||||
sEluna->Push(L, areaEntry->area_name[sWorld->GetDefaultDbcLocale()]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* OTHER */
|
||||
int RegisterPacketEvent(lua_State* L)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user