mirror of
https://github.com/azerothcore/mod-ale
synced 2025-12-01 21:15:19 +08:00
Implement: Creature:SetRegeneratingHealth
This commit is contained in:
@@ -14,6 +14,19 @@
|
|||||||
*/
|
*/
|
||||||
namespace LuaCreature
|
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,
|
* Returns `true` if the [Creature] is set to not give reputation when killed,
|
||||||
* and returns `false` otherwise.
|
* and returns `false` otherwise.
|
||||||
@@ -946,7 +959,6 @@ auto const& threatlist = creature->getThreatManager().getThreatList();
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Makes the [Creature] able to fly if enabled.
|
* Makes the [Creature] able to fly if enabled.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -790,6 +790,7 @@ ElunaRegister<Creature> CreatureMethods[] =
|
|||||||
{ "GetCreatureFamily", &LuaCreature::GetCreatureFamily },
|
{ "GetCreatureFamily", &LuaCreature::GetCreatureFamily },
|
||||||
|
|
||||||
// Setters
|
// Setters
|
||||||
|
{ "SetRegeneratingHealth", &LuaCreature::SetRegeneratingHealth },
|
||||||
{ "SetHover", &LuaCreature::SetHover },
|
{ "SetHover", &LuaCreature::SetHover },
|
||||||
{ "SetDisableGravity", &LuaCreature::SetDisableGravity },
|
{ "SetDisableGravity", &LuaCreature::SetDisableGravity },
|
||||||
{ "SetAggroEnabled", &LuaCreature::SetAggroEnabled },
|
{ "SetAggroEnabled", &LuaCreature::SetAggroEnabled },
|
||||||
|
|||||||
Reference in New Issue
Block a user