mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Implement: Creature:SetRegeneratingHealth
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
@@ -790,6 +790,7 @@ ElunaRegister<Creature> CreatureMethods[] =
|
||||
{ "GetCreatureFamily", &LuaCreature::GetCreatureFamily },
|
||||
|
||||
// Setters
|
||||
{ "SetRegeneratingHealth", &LuaCreature::SetRegeneratingHealth },
|
||||
{ "SetHover", &LuaCreature::SetHover },
|
||||
{ "SetDisableGravity", &LuaCreature::SetDisableGravity },
|
||||
{ "SetAggroEnabled", &LuaCreature::SetAggroEnabled },
|
||||
|
||||
Reference in New Issue
Block a user