mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Reimplement a few methods
This commit is contained in:
@@ -285,9 +285,9 @@ ElunaRegister<Unit> UnitMethods[] =
|
||||
#endif
|
||||
{ "SetSpeed", &LuaUnit::SetSpeed }, // :SetSpeed(type, speed[, forced]) - Sets speed for the movement type (0 = walk, 1 = run ..)
|
||||
// {"SetStunned", &LuaUnit::SetStunned}, // :SetStunned([enable]) - Stuns or removes stun
|
||||
// {"SetRooted", &LuaUnit::SetRooted}, // :SetRooted([enable]) - Roots or removes root
|
||||
// {"SetConfused", &LuaUnit::SetConfused}, // :SetConfused([enable]) - Sets confused or removes confusion
|
||||
// {"SetFeared", &LuaUnit::SetFeared}, // :SetFeared([enable]) - Fears or removes fear
|
||||
{"SetRooted", &LuaUnit::SetRooted}, // :SetRooted([enable]) - Roots or removes root
|
||||
{"SetConfused", &LuaUnit::SetConfused}, // :SetConfused([enable]) - Sets confused or removes confusion
|
||||
{"SetFeared", &LuaUnit::SetFeared}, // :SetFeared([enable]) - Fears or removes fear
|
||||
{ "SetPvP", &LuaUnit::SetPvP }, // :SetPvP([apply]) - Sets the units PvP on or off
|
||||
#if (!defined(TBC) && !defined(CLASSIC))
|
||||
{ "SetFFA", &LuaUnit::SetFFA }, // :SetFFA([apply]) - Sets the units FFA tag on or off
|
||||
|
||||
@@ -1212,26 +1212,53 @@ namespace LuaUnit
|
||||
return 0;
|
||||
}*/
|
||||
|
||||
/*int SetRooted(Eluna* E, lua_State* L, Unit* unit)
|
||||
/**
|
||||
* Roots the [Unit] to the ground, if 'false' specified, unroots the [Unit].
|
||||
*
|
||||
* @param bool apply = true
|
||||
*/
|
||||
int SetRooted(Eluna* E, lua_State* L, Unit* unit)
|
||||
{
|
||||
bool apply = Eluna::CHECKVAL<bool>(L, 2, true);
|
||||
unit->SetControlled(apply, UNIT_STATE_ROOT);
|
||||
return 0;
|
||||
}*/
|
||||
bool apply = Eluna::CHECKVAL<bool>(L, 2, true);
|
||||
#ifndef TRINITY
|
||||
unit->SetRoot(apply);
|
||||
#else
|
||||
unit->SetControlled(apply, UNIT_STATE_ROOT);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*int SetConfused(Eluna* E, lua_State* L, Unit* unit)
|
||||
/**
|
||||
* Confuses the [Unit], if 'false' specified, the [Unit] is no longer confused.
|
||||
*
|
||||
* @param bool apply = true
|
||||
*/
|
||||
int SetConfused(Eluna* E, lua_State* L, Unit* unit)
|
||||
{
|
||||
bool apply = Eluna::CHECKVAL<bool>(L, 2, true);
|
||||
unit->SetControlled(apply, UNIT_STATE_CONFUSED);
|
||||
bool apply = Eluna::CHECKVAL<bool>(L, 2, true);
|
||||
#ifndef TRINITY
|
||||
unit->SetConfused(apply);
|
||||
#else
|
||||
unit->SetControlled(apply, UNIT_STATE_CONFUSED);
|
||||
#endif
|
||||
return 0;
|
||||
}*/
|
||||
}
|
||||
|
||||
/*int SetFeared(Eluna* E, lua_State* L, Unit* unit)
|
||||
/**
|
||||
* Fears the [Unit], if 'false' specified, the [Unit] is no longer feared.
|
||||
*
|
||||
* @param bool apply = true
|
||||
*/
|
||||
int SetFeared(Eluna* E, lua_State* L, Unit* unit)
|
||||
{
|
||||
bool apply = Eluna::CHECKVAL<bool>(L, 2, true);
|
||||
unit->SetControlled(apply, UNIT_STATE_FLEEING);
|
||||
return 0;
|
||||
}*/
|
||||
bool apply = Eluna::CHECKVAL<bool>(L, 2, true);
|
||||
#ifndef TRINITY
|
||||
unit->SetFeared(apply);
|
||||
#else
|
||||
unit->SetControlled(apply, UNIT_STATE_FLEEING);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*int SetCanFly(Eluna* E, lua_State* L, Unit* unit)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user