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:
Easelm
2014-04-26 15:09:09 -04:00
committed by Foereaper
parent c998575221
commit 89dc95a746
2 changed files with 12 additions and 0 deletions

View File

@@ -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)
{