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;
|
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)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user