Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
SpellMethods.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 "
SpellMethods.h
"
8
#include "
Includes.h
"
9
10
namespace
LuaSpell
11
{
12
int
GetCaster
(lua_State* L,
Spell
* spell)
13
{
14
sEluna
->Push(L, spell->
GetCaster
());
15
return
1;
16
}
17
18
int
GetCastTime
(lua_State* L,
Spell
* spell)
19
{
20
sEluna
->Push(L, spell->
GetCastTime
());
21
return
1;
22
}
23
24
int
GetId
(lua_State* L,
Spell
* spell)
25
{
26
sEluna
->Push(L, spell->
m_spellInfo
->
Id
);
27
return
1;
28
}
29
30
int
GetPowerCost
(lua_State* L,
Spell
* spell)
31
{
32
sEluna
->Push(L, spell->
GetPowerCost
());
33
return
1;
34
}
35
36
int
GetDuration
(lua_State* L,
Spell
* spell)
37
{
38
sEluna
->Push(L, spell->
GetSpellInfo
()->
GetDuration
());
39
return
1;
40
}
41
42
int
Cast
(lua_State* L,
Spell
* spell)
43
{
44
bool
skipCheck = lua_toboolean(L, 1);
45
spell->
cast
(skipCheck);
46
return
0;
47
}
48
49
int
IsAutoRepeat
(lua_State* L,
Spell
* spell)
50
{
51
sEluna
->Push(L, spell->
IsAutoRepeat
());
52
return
1;
53
}
54
55
int
SetAutoRepeat
(lua_State* L,
Spell
* spell)
56
{
57
bool
repeat = luaL_checkbool(L, 1);
58
spell->
SetAutoRepeat
(repeat);
59
return
0;
60
}
61
62
int
cancel
(lua_State* L,
Spell
* spell)
63
{
64
spell->
cancel
();
65
return
0;
66
}
67
68
// Finish()
69
int
Finish
(lua_State* L,
Spell
* spell)
70
{
71
spell->
finish
();
72
return
0;
73
}
74
75
int
GetTargetDest
(lua_State* L,
Spell
* spell)
76
{
77
if
(!spell->
m_targets
.
HasDst
())
78
return
0;
79
80
float
x, y, z;
81
spell->
m_targets
.
GetDstPos
()->
GetPosition
(x, y, z);
82
sEluna
->Push(L, x);
83
sEluna
->Push(L, y);
84
sEluna
->Push(L, z);
85
return
3;
86
}
87
};
Includes.h
sEluna
#define sEluna
Definition
LuaEngine.h:710
SpellMethods.h
SpellCastTargets::HasDst
bool HasDst() const
Definition
Spell.h:217
SpellCastTargets::GetDstPos
WorldLocation const * GetDstPos() const
Definition
Spell.cpp:383
Spell
Definition
Spell.h:289
Spell::GetSpellInfo
SpellInfo const * GetSpellInfo() const
Definition
Spell.h:565
Spell::cast
void cast(bool skipCheck=false)
Definition
Spell.cpp:3266
Spell::m_targets
SpellCastTargets m_targets
Definition
Spell.h:535
Spell::GetCaster
Unit * GetCaster() const
Definition
Spell.h:563
Spell::IsAutoRepeat
bool IsAutoRepeat() const
Definition
Spell.h:543
Spell::GetCastTime
int32 GetCastTime() const
Definition
Spell.h:542
Spell::cancel
void cancel()
Definition
Spell.cpp:3210
Spell::SetAutoRepeat
void SetAutoRepeat(bool rep)
Definition
Spell.h:544
Spell::GetPowerCost
int32 GetPowerCost() const
Definition
Spell.h:566
Spell::finish
void finish(bool ok=true)
Definition
Spell.cpp:3762
Spell::m_spellInfo
SpellInfo const *const m_spellInfo
Definition
Spell.h:530
SpellInfo::Id
uint32 Id
Definition
SpellInfo.h:160
SpellInfo::GetDuration
int32 GetDuration() const
Definition
SpellInfo.cpp:1967
LuaSpell
Definition
SpellMethods.cpp:11
LuaSpell::GetDuration
int GetDuration(lua_State *L, Spell *spell)
Definition
SpellMethods.cpp:36
LuaSpell::SetAutoRepeat
int SetAutoRepeat(lua_State *L, Spell *spell)
Definition
SpellMethods.cpp:55
LuaSpell::GetPowerCost
int GetPowerCost(lua_State *L, Spell *spell)
Definition
SpellMethods.cpp:30
LuaSpell::Cast
int Cast(lua_State *L, Spell *spell)
Definition
SpellMethods.cpp:42
LuaSpell::cancel
int cancel(lua_State *L, Spell *spell)
Definition
SpellMethods.cpp:62
LuaSpell::GetCastTime
int GetCastTime(lua_State *L, Spell *spell)
Definition
SpellMethods.cpp:18
LuaSpell::GetId
int GetId(lua_State *L, Spell *spell)
Definition
SpellMethods.cpp:24
LuaSpell::GetTargetDest
int GetTargetDest(lua_State *L, Spell *spell)
Definition
SpellMethods.cpp:75
LuaSpell::GetCaster
int GetCaster(lua_State *L, Spell *spell)
Definition
SpellMethods.cpp:12
LuaSpell::Finish
int Finish(lua_State *L, Spell *spell)
Definition
SpellMethods.cpp:69
LuaSpell::IsAutoRepeat
int IsAutoRepeat(lua_State *L, Spell *spell)
Definition
SpellMethods.cpp:49
Position::GetPosition
void GetPosition(float &x, float &y) const
Definition
Object.h:333
src
server
game
LuaEngine
SpellMethods.cpp
Generated on
for Project SkyFire Core by
1.17.0