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; 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 */ /* OTHER */
int RegisterPacketEvent(lua_State* L) int RegisterPacketEvent(lua_State* L)
{ {

View File

@@ -64,6 +64,7 @@ void RegisterGlobals(lua_State* L)
lua_register(L, "GetGUIDLow", &LuaGlobalFunctions::GetGUIDLow); // GetGUIDLow(guid) - Returns GUIDLow (uint32) from guid (uint64 as string) UNDOCUMENTED lua_register(L, "GetGUIDLow", &LuaGlobalFunctions::GetGUIDLow); // GetGUIDLow(guid) - Returns GUIDLow (uint32) from guid (uint64 as string) UNDOCUMENTED
lua_register(L, "GetGUIDType", &LuaGlobalFunctions::GetGUIDType); // GetGUIDType(guid) - Returns Type (uint32) from guid (uint64 as string) UNDOCUMENTED lua_register(L, "GetGUIDType", &LuaGlobalFunctions::GetGUIDType); // GetGUIDType(guid) - Returns Type (uint32) from guid (uint64 as string) UNDOCUMENTED
lua_register(L, "GetGUIDEntry", &LuaGlobalFunctions::GetGUIDEntry); // GetGUIDEntry(guid) - Returns Entry (uint32) from guid (uint64 as string), may be always 0 UNDOCUMENTED lua_register(L, "GetGUIDEntry", &LuaGlobalFunctions::GetGUIDEntry); // GetGUIDEntry(guid) - Returns Entry (uint32) from guid (uint64 as string), may be always 0 UNDOCUMENTED
lua_register(L, "GetAreaName", &LuaGlobalFunctions::GetAreaName); // GetAreaName(area or zone ID) - Returns area or zone (string) name by area or zone ID
lua_register(L, "bit_not", &LuaGlobalFunctions::bit_not); // bit_not(a) - Returns ~a UNDOCUMENTED lua_register(L, "bit_not", &LuaGlobalFunctions::bit_not); // bit_not(a) - Returns ~a UNDOCUMENTED
lua_register(L, "bit_xor", &LuaGlobalFunctions::bit_xor); // bit_xor(a, b) - Returns a ^ b UNDOCUMENTED lua_register(L, "bit_xor", &LuaGlobalFunctions::bit_xor); // bit_xor(a, b) - Returns a ^ b UNDOCUMENTED
lua_register(L, "bit_rshift", &LuaGlobalFunctions::bit_rshift); // bit_rshift(a, b) - Returns a >> b UNDOCUMENTED lua_register(L, "bit_rshift", &LuaGlobalFunctions::bit_rshift); // bit_rshift(a, b) - Returns a >> b UNDOCUMENTED