mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
feat(CreatureMethods): Add GetCreatureSpawnId and SetCorpseDelay methods (#300)
This commit is contained in:
@@ -776,6 +776,7 @@ ElunaRegister<Creature> CreatureMethods[] =
|
||||
{ "GetRespawnDelay", &LuaCreature::GetRespawnDelay },
|
||||
{ "GetWanderRadius", &LuaCreature::GetWanderRadius },
|
||||
{ "GetCurrentWaypointId", &LuaCreature::GetCurrentWaypointId },
|
||||
{ "GetSpawnId", &LuaCreature::GetSpawnId },
|
||||
{ "GetWaypointPath", &LuaCreature::GetWaypointPath },
|
||||
{ "GetLootMode", &LuaCreature::GetLootMode },
|
||||
{ "GetLootRecipient", &LuaCreature::GetLootRecipient },
|
||||
@@ -795,6 +796,7 @@ ElunaRegister<Creature> CreatureMethods[] =
|
||||
{ "SetHover", &LuaCreature::SetHover },
|
||||
{ "SetDisableGravity", &LuaCreature::SetDisableGravity },
|
||||
{ "SetAggroEnabled", &LuaCreature::SetAggroEnabled },
|
||||
{ "SetCorpseDelay", &LuaCreature::SetCorpseDelay },
|
||||
{ "SetNoCallAssistance", &LuaCreature::SetNoCallAssistance },
|
||||
{ "SetNoSearchAssistance", &LuaCreature::SetNoSearchAssistance },
|
||||
{ "SetDefaultMovementType", &LuaCreature::SetDefaultMovementType },
|
||||
|
||||
@@ -434,6 +434,17 @@ namespace LuaCreature
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the spawn ID for this [Creature].
|
||||
*
|
||||
* @return uint32 spawnId
|
||||
*/
|
||||
int GetSpawnId(lua_State* L, Creature* creature)
|
||||
{
|
||||
Eluna::Push(L, creature->GetSpawnId());
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the default movement type for this [Creature].
|
||||
*
|
||||
@@ -1134,6 +1145,18 @@ namespace LuaCreature
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the time it takes for the [Creature]'s corpse to despawn when killed.
|
||||
*
|
||||
* @param uint32 delay : the delay, in seconds
|
||||
*/
|
||||
int SetCorpseDelay(lua_State* L, Creature* creature)
|
||||
{
|
||||
uint32 delay = Eluna::CHECKVAL<uint32>(L, 2);
|
||||
creature->SetCorpseDelay(delay);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make the [Creature] start following its waypoint path.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user