Eluna implement changes from new_mthread to master ~ Does not add multithread support

This commit is contained in:
Rochet2
2014-11-30 01:37:45 +02:00
parent a7f4954fbe
commit 6268216a64
27 changed files with 3331 additions and 3000 deletions

View File

@@ -14,9 +14,9 @@ namespace LuaSpell
*
* @return bool isAutoRepeating
*/
int IsAutoRepeat(lua_State* L, Spell* spell)
int IsAutoRepeat(Eluna* E, Spell* spell)
{
Eluna::Push(L, spell->IsAutoRepeat());
Eluna::Push(E->L, spell->IsAutoRepeat());
return 1;
}
@@ -25,9 +25,9 @@ namespace LuaSpell
*
* @return [Unit] caster
*/
int GetCaster(lua_State* L, Spell* spell)
int GetCaster(Eluna* E, Spell* spell)
{
Eluna::Push(L, spell->GetCaster());
Eluna::Push(E->L, spell->GetCaster());
return 1;
}
@@ -36,9 +36,9 @@ namespace LuaSpell
*
* @return int32 castTime
*/
int GetCastTime(lua_State* L, Spell* spell)
int GetCastTime(Eluna* E, Spell* spell)
{
Eluna::Push(L, spell->GetCastTime());
Eluna::Push(E->L, spell->GetCastTime());
return 1;
}
@@ -47,9 +47,9 @@ namespace LuaSpell
*
* @return uint32 entryId
*/
int GetEntry(lua_State* L, Spell* spell)
int GetEntry(Eluna* E, Spell* spell)
{
Eluna::Push(L, spell->m_spellInfo->Id);
Eluna::Push(E->L, spell->m_spellInfo->Id);
return 1;
}
@@ -58,9 +58,9 @@ namespace LuaSpell
*
* @return uint32 powerCost
*/
int GetPowerCost(lua_State* L, Spell* spell)
int GetPowerCost(Eluna* E, Spell* spell)
{
Eluna::Push(L, spell->GetPowerCost());
Eluna::Push(E->L, spell->GetPowerCost());
return 1;
}
@@ -69,12 +69,12 @@ namespace LuaSpell
*
* @return int32 duration
*/
int GetDuration(lua_State* L, Spell* spell)
int GetDuration(Eluna* E, Spell* spell)
{
#ifndef TRINITY
Eluna::Push(L, GetSpellDuration(spell->m_spellInfo));
Eluna::Push(E->L, GetSpellDuration(spell->m_spellInfo));
#else
Eluna::Push(L, spell->GetSpellInfo()->GetDuration());
Eluna::Push(E->L, spell->GetSpellInfo()->GetDuration());
#endif
return 1;
}
@@ -86,7 +86,7 @@ namespace LuaSpell
* @return float y : y coordinate of the [Spell]
* @return float z : z coordinate of the [Spell]
*/
int GetTargetDest(lua_State* L, Spell* spell)
int GetTargetDest(Eluna* E, Spell* spell)
{
#ifndef TRINITY
if (!(spell->m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION))
@@ -99,9 +99,9 @@ namespace LuaSpell
float x, y, z;
spell->m_targets.GetDstPos()->GetPosition(x, y, z);
#endif
Eluna::Push(L, x);
Eluna::Push(L, y);
Eluna::Push(L, z);
Eluna::Push(E->L, x);
Eluna::Push(E->L, y);
Eluna::Push(E->L, z);
return 3;
}
@@ -111,28 +111,28 @@ namespace LuaSpell
*
* @return [Object] target
*/
int GetTarget(lua_State* L, Spell* spell)
int GetTarget(Eluna* E, Spell* spell)
{
#ifndef TRINITY
if (GameObject* target = spell->m_targets.getGOTarget())
Eluna::Push(L, target);
Eluna::Push(E->L, target);
else if (Item* target = spell->m_targets.getItemTarget())
Eluna::Push(L, target);
Eluna::Push(E->L, target);
else if (Corpse* target = spell->GetCaster()->GetMap()->GetCorpse(spell->m_targets.getCorpseTargetGuid()))
Eluna::Push(L, target);
Eluna::Push(E->L, target);
else if (Unit* target = spell->m_targets.getUnitTarget())
Eluna::Push(L, target);
Eluna::Push(E->L, target);
#else
if (GameObject* target = spell->m_targets.GetGOTarget())
Eluna::Push(L, target);
Eluna::Push(E->L, target);
else if (Item* target = spell->m_targets.GetItemTarget())
Eluna::Push(L, target);
Eluna::Push(E->L, target);
else if (Corpse* target = spell->m_targets.GetCorpseTarget())
Eluna::Push(L, target);
Eluna::Push(E->L, target);
else if (Unit* target = spell->m_targets.GetUnitTarget())
Eluna::Push(L, target);
Eluna::Push(E->L, target);
else if (WorldObject* target = spell->m_targets.GetObjectTarget())
Eluna::Push(L, target);
Eluna::Push(E->L, target);
#endif
return 1;
}
@@ -142,9 +142,9 @@ namespace LuaSpell
*
* @param bool repeat : set variable to 'true' for spell to automatically repeat
*/
int SetAutoRepeat(lua_State* L, Spell* spell)
int SetAutoRepeat(Eluna* E, Spell* spell)
{
bool repeat = Eluna::CHECKVAL<bool>(L, 2);
bool repeat = Eluna::CHECKVAL<bool>(E->L, 2);
spell->SetAutoRepeat(repeat);
return 0;
}
@@ -154,9 +154,9 @@ namespace LuaSpell
*
* @param bool skipCheck = false : skips initial checks to see if the [Spell] can be casted or not, this is optional
*/
int Cast(lua_State* L, Spell* spell)
int Cast(Eluna* E, Spell* spell)
{
bool skipCheck = Eluna::CHECKVAL<bool>(L, 2, false);
bool skipCheck = Eluna::CHECKVAL<bool>(E->L, 2, false);
spell->cast(skipCheck);
return 0;
}
@@ -165,7 +165,7 @@ namespace LuaSpell
* Cancels the [Spell].
*
*/
int Cancel(lua_State* /*L*/, Spell* spell)
int Cancel(Eluna* /*E*/, Spell* spell)
{
spell->cancel();
return 0;
@@ -175,7 +175,7 @@ namespace LuaSpell
* Finishes the [Spell].
*
*/
int Finish(lua_State* /*L*/, Spell* spell)
int Finish(Eluna* /*E*/, Spell* spell)
{
spell->finish();
return 0;