Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
MapMethods.cpp
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2010 - 2013 Eluna Lua Engine <http://emudevs.com/>
3
* This program is free software licensed under GPL version 3
4
* Please see the included DOCS/LICENSE.TXT for more information
5
*/
6
7
#include "
MapMethods.h
"
8
#include "
Includes.h
"
9
10
namespace
LuaMap
11
{
12
// :GetName()
13
int
GetName
(lua_State* L,
Map
* map)
14
{
15
sEluna
->Push(L, map->
GetMapName
());
16
return
1;
17
}
18
19
// GetHeight(x, y[, phase])
20
int
GetHeight
(lua_State* L,
Map
* map)
21
{
22
float
x = luaL_checknumber(L, 1);
23
float
y = luaL_checknumber(L, 2);
24
uint32
phasemask = luaL_optunsigned(L, 3, 1);
25
26
float
z = map->
GetHeight
(phasemask, x, y,
MAX_HEIGHT
);
27
if
(z ==
INVALID_HEIGHT
)
28
return
0;
29
sEluna
->Push(L, z);
30
return
1;
31
}
32
33
// :GetDifficulty()
34
int
GetDifficulty
(lua_State* L,
Map
* map)
35
{
36
sEluna
->Push(L, map->
GetDifficulty
());
37
return
1;
38
}
39
40
// :GetInstanceId()
41
int
GetInstanceId
(lua_State* L,
Map
* map)
42
{
43
sEluna
->Push(L, map->
GetInstanceId
());
44
return
1;
45
}
46
47
// :GetPlayerCount()
48
int
GetPlayerCount
(lua_State* L,
Map
* map)
49
{
50
sEluna
->Push(L, map->
GetPlayersCountExceptGMs
());
51
return
1;
52
}
53
54
// :GetMapId()
55
int
GetMapId
(lua_State* L,
Map
* map)
56
{
57
sEluna
->Push(L, map->
GetId
());
58
return
1;
59
}
60
61
// :GetAreaId(x, y, z)
62
int
GetAreaId
(lua_State* L,
Map
* map)
63
{
64
float
x = luaL_checknumber(L, 1);
65
float
y = luaL_checknumber(L, 2);
66
float
z = luaL_checknumber(L, 3);
67
68
sEluna
->Push(L, map->
GetAreaId
(x, y, z));
69
return
1;
70
}
71
72
// :IsArena()
73
int
IsArena
(lua_State* L,
Map
* map)
74
{
75
sEluna
->Push(L, map->
IsBattleArena
());
76
return
1;
77
}
78
79
// :IsBattleground()
80
int
IsBattleground
(lua_State* L,
Map
* map)
81
{
82
sEluna
->Push(L, map->
IsBattleground
());
83
return
1;
84
}
85
86
// :IsDungeon()
87
int
IsDungeon
(lua_State* L,
Map
* map)
88
{
89
sEluna
->Push(L, map->
IsDungeon
());
90
return
1;
91
}
92
93
// :IsEmpty()
94
int
IsEmpty
(lua_State* L,
Map
* map)
95
{
96
sEluna
->Push(L, map->
isEmpty
());
97
return
1;
98
}
99
100
// :IsHeroic()
101
int
IsHeroic
(lua_State* L,
Map
* map)
102
{
103
sEluna
->Push(L, map->
IsHeroic
());
104
return
1;
105
}
106
107
// :IsRaid()
108
int
IsRaid
(lua_State* L,
Map
* map)
109
{
110
sEluna
->Push(L, map->
IsRaid
());
111
return
1;
112
}
113
};
uint32
std::uint32_t uint32
Definition
Define.h:77
Includes.h
sEluna
#define sEluna
Definition
LuaEngine.h:710
MAX_HEIGHT
#define MAX_HEIGHT
Definition
Map.h:141
INVALID_HEIGHT
#define INVALID_HEIGHT
Definition
Map.h:142
MapMethods.h
LinkedListHead::isEmpty
bool isEmpty() const
Definition
LinkedList.h:86
Map
Definition
Map.h:238
Map::IsDungeon
bool IsDungeon() const
Definition
Map.h:369
Map::GetDifficulty
DifficultyID GetDifficulty() const
Definition
Map.h:363
Map::GetHeight
float GetHeight(float x, float y, float z, bool checkVMap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH) const
Definition
Map.cpp:1959
Map::GetAreaId
uint32 GetAreaId(float x, float y, float z) const
Definition
Map.h:330
Map::IsBattleground
bool IsBattleground() const
Definition
Map.h:376
Map::IsRaid
bool IsRaid() const
Definition
Map.h:372
Map::GetPlayersCountExceptGMs
uint32 GetPlayersCountExceptGMs() const
Definition
Map.cpp:2516
Map::GetMapName
const char * GetMapName() const
Definition
Map.cpp:2285
Map::IsHeroic
bool IsHeroic() const
Definition
Map.cpp:3044
Map::GetInstanceId
uint32 GetInstanceId() const
Definition
Map.h:357
Map::GetId
uint32 GetId(void) const
Definition
Map.h:300
Map::IsBattleArena
bool IsBattleArena() const
Definition
Map.h:377
LuaMap
Definition
MapMethods.cpp:11
LuaMap::IsBattleground
int IsBattleground(lua_State *L, Map *map)
Definition
MapMethods.cpp:80
LuaMap::GetMapId
int GetMapId(lua_State *L, Map *map)
Definition
MapMethods.cpp:55
LuaMap::GetHeight
int GetHeight(lua_State *L, Map *map)
Definition
MapMethods.cpp:20
LuaMap::IsHeroic
int IsHeroic(lua_State *L, Map *map)
Definition
MapMethods.cpp:101
LuaMap::IsArena
int IsArena(lua_State *L, Map *map)
Definition
MapMethods.cpp:73
LuaMap::IsDungeon
int IsDungeon(lua_State *L, Map *map)
Definition
MapMethods.cpp:87
LuaMap::GetPlayerCount
int GetPlayerCount(lua_State *L, Map *map)
Definition
MapMethods.cpp:48
LuaMap::GetName
int GetName(lua_State *L, Map *map)
Definition
MapMethods.cpp:13
LuaMap::GetInstanceId
int GetInstanceId(lua_State *L, Map *map)
Definition
MapMethods.cpp:41
LuaMap::IsRaid
int IsRaid(lua_State *L, Map *map)
Definition
MapMethods.cpp:108
LuaMap::GetAreaId
int GetAreaId(lua_State *L, Map *map)
Definition
MapMethods.cpp:62
LuaMap::IsEmpty
int IsEmpty(lua_State *L, Map *map)
Definition
MapMethods.cpp:94
LuaMap::GetDifficulty
int GetDifficulty(lua_State *L, Map *map)
Definition
MapMethods.cpp:34
src
server
game
LuaEngine
MapMethods.cpp
Generated on
for Project SkyFire Core by
1.17.0