diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index ef496f6..6d21bf3 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -335,6 +335,7 @@ ElunaRegister UnitMethods[] = #endif { "SetWaterWalk", &LuaUnit::SetWaterWalk }, { "SetStandState", &LuaUnit::SetStandState }, + { "SetInCombatWith", &LuaUnit::SetInCombatWith }, { "ModifyPower", &LuaUnit::ModifyPower }, // Boolean diff --git a/UnitMethods.h b/UnitMethods.h index 44f776f..2e9a673 100644 --- a/UnitMethods.h +++ b/UnitMethods.h @@ -1842,6 +1842,18 @@ namespace LuaUnit return 0; } + /** + * Sets the [Unit] in combat with the `enemy` [Unit]. + * + * @param [Unit] enemy : the [Unit] to start combat with + */ + int SetInCombatWith(lua_State* L, Unit* unit) + { + Unit* enemy = Eluna::CHECKOBJ(L, 2); + unit->SetInCombatWith(enemy); + return 0; + } + #if (!defined(TBC) && !defined(CLASSIC)) /** * Sets the [Unit]'s FFA flag on or off.