mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Getter added & Extra Code Cleanup
This commit is contained in:
@@ -14,6 +14,24 @@
|
||||
*/
|
||||
namespace LuaCreature
|
||||
{
|
||||
/**
|
||||
* Returns `true` if the [Creature] can regenerate health,
|
||||
* and returns `false` otherwise.
|
||||
*
|
||||
* @return bool isRegenerating
|
||||
*/
|
||||
int IsRegeneratingHealth(lua_State* L, Creature* creature)
|
||||
{
|
||||
#if defined(AZEROTHCORE)
|
||||
Eluna::Push(L, creature->isRegeneratingHealth());
|
||||
#elif defined(TRINITY)
|
||||
Eluna::Push(L, creature->CanRegenerateHealth());
|
||||
#else
|
||||
Eluna::Push(L, creature->IsRegeneratingHealth());
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether the [Creature] can regenerate health or not.
|
||||
*
|
||||
@@ -963,6 +981,7 @@ namespace LuaCreature
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Makes the [Creature] able to fly if enabled.
|
||||
*
|
||||
|
||||
@@ -811,6 +811,7 @@ ElunaRegister<Creature> CreatureMethods[] =
|
||||
{ "SetEquipmentSlots", &LuaCreature::SetEquipmentSlots },
|
||||
|
||||
// Boolean
|
||||
{ "IsRegeneratingHealth", &LuaCreature::IsRegeneratingHealth },
|
||||
#if defined(TRINITY) || defined(AZEROTHCORE)
|
||||
{ "IsDungeonBoss", &LuaCreature::IsDungeonBoss },
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user