Implement: Creature:SetRegeneratingHealth

This commit is contained in:
xIvan0ff
2021-05-19 00:51:50 +03:00
parent b4263aec64
commit 74afaebb49
2 changed files with 154 additions and 141 deletions

View File

@@ -14,6 +14,19 @@
*/
namespace LuaCreature
{
/**
* Sets whether the [Creature] can regenerate health or not.
*
* @param bool enable = true : `true` to enable health regeneration, `false` to disable it
*/
int SetRegeneratingHealth(lua_State* L, Creature* creature)
{
bool enable = Eluna::CHECKVAL<bool>(L, 2, true);
creature->SetRegeneratingHealth(enable);
return 0;
}
/**
* Returns `true` if the [Creature] is set to not give reputation when killed,
* and returns `false` otherwise.
@@ -946,7 +959,6 @@ auto const& threatlist = creature->getThreatManager().getThreatList();
return 0;
}
/**
* Makes the [Creature] able to fly if enabled.
*

View File

@@ -790,6 +790,7 @@ ElunaRegister<Creature> CreatureMethods[] =
{ "GetCreatureFamily", &LuaCreature::GetCreatureFamily },
// Setters
{ "SetRegeneratingHealth", &LuaCreature::SetRegeneratingHealth },
{ "SetHover", &LuaCreature::SetHover },
{ "SetDisableGravity", &LuaCreature::SetDisableGravity },
{ "SetAggroEnabled", &LuaCreature::SetAggroEnabled },