mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Added requested movement method
Todo: Implement TC equivalent Part of #80
This commit is contained in:
@@ -263,6 +263,9 @@ ElunaRegister<Unit> UnitMethods[] =
|
|||||||
{ "GetVehicleKit", &LuaUnit::GetVehicleKit }, // :GetVehicleKit() - Gets unit's Vehicle kit if the unit is a vehicle
|
{ "GetVehicleKit", &LuaUnit::GetVehicleKit }, // :GetVehicleKit() - Gets unit's Vehicle kit if the unit is a vehicle
|
||||||
// {"GetVehicle", &LuaUnit::GetVehicle}, // :GetVehicle() - Gets the Vehicle kit of the vehicle the unit is on
|
// {"GetVehicle", &LuaUnit::GetVehicle}, // :GetVehicle() - Gets the Vehicle kit of the vehicle the unit is on
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef MANGOS
|
||||||
|
{ "GetMovementType", &LuaUnit::GetMovementType },
|
||||||
|
#endif
|
||||||
|
|
||||||
// Setters
|
// Setters
|
||||||
{ "SetFaction", &LuaUnit::SetFaction }, // :SetFaction(factionId) - Sets the unit's faction
|
{ "SetFaction", &LuaUnit::SetFaction }, // :SetFaction(factionId) - Sets the unit's faction
|
||||||
|
|||||||
@@ -880,6 +880,42 @@ namespace LuaUnit
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the current movement type for this [Unit].
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* enum MovementGeneratorType
|
||||||
|
* {
|
||||||
|
* IDLE_MOTION_TYPE = 0,
|
||||||
|
* RANDOM_MOTION_TYPE = 1,
|
||||||
|
* WAYPOINT_MOTION_TYPE = 2,
|
||||||
|
* MAX_DB_MOTION_TYPE = 3,
|
||||||
|
*
|
||||||
|
* CONFUSED_MOTION_TYPE = 4,
|
||||||
|
* CHASE_MOTION_TYPE = 5,
|
||||||
|
* HOME_MOTION_TYPE = 6,
|
||||||
|
* FLIGHT_MOTION_TYPE = 7,
|
||||||
|
* POINT_MOTION_TYPE = 8,
|
||||||
|
* FLEEING_MOTION_TYPE = 9,
|
||||||
|
* DISTRACT_MOTION_TYPE = 10,
|
||||||
|
* ASSISTANCE_MOTION_TYPE = 11,
|
||||||
|
* ASSISTANCE_DISTRACT_MOTION_TYPE = 12,
|
||||||
|
* TIMED_FLEEING_MOTION_TYPE = 13,
|
||||||
|
* FOLLOW_MOTION_TYPE = 14,
|
||||||
|
* EFFECT_MOTION_TYPE = 15,
|
||||||
|
* };
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @return MovementGeneratorType movementType
|
||||||
|
*/
|
||||||
|
#ifdef MANGOS
|
||||||
|
int GetMovementType(Eluna* /*E*/, lua_State* L, Unit* unit)
|
||||||
|
{
|
||||||
|
Eluna::Push(L, unit->GetMotionMaster()->GetCurrentMovementGeneratorType());
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* SETTERS */
|
/* SETTERS */
|
||||||
int SetOwnerGUID(Eluna* /*E*/, lua_State* L, Unit* unit)
|
int SetOwnerGUID(Eluna* /*E*/, lua_State* L, Unit* unit)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user