add SetInCombatWith

This commit is contained in:
Axel Cocat
2021-06-01 00:12:27 +02:00
parent 841ddd4db7
commit b87a76bf55
2 changed files with 13 additions and 0 deletions

View File

@@ -335,6 +335,7 @@ ElunaRegister<Unit> UnitMethods[] =
#endif
{ "SetWaterWalk", &LuaUnit::SetWaterWalk },
{ "SetStandState", &LuaUnit::SetStandState },
{ "SetInCombatWith", &LuaUnit::SetInCombatWith },
{ "ModifyPower", &LuaUnit::ModifyPower },
// Boolean

View File

@@ -1842,6 +1842,18 @@ namespace LuaUnit
return 0;
}
/**
* Sets the [Unit] to set in combat with the [Unit] of given GUID.
*
* @param ObjectGuid guid : unit to start combat with
*/
int SetInCombatWith(lua_State* L, Unit* unit)
{
Unit* enemy = Eluna::CHECKOBJ<Unit>(L, 2);
unit->SetInCombatWith(enemy);
return 0;
}
#if (!defined(TBC) && !defined(CLASSIC))
/**
* Sets the [Unit]'s FFA flag on or off.