feat(LuaEngine/GameObjectMethods): ddd SetRespawnDelay (#239)

This commit is contained in:
iThorgrim
2025-01-26 15:17:59 +01:00
committed by GitHub
parent 0d35a87b3d
commit 2ae77b6441
2 changed files with 16 additions and 0 deletions

View File

@@ -855,6 +855,7 @@ ElunaRegister<GameObject> GameObjectMethods[] =
{ "SetGoState", &LuaGameObject::SetGoState },
{ "SetLootState", &LuaGameObject::SetLootState },
{ "SetRespawnTime", &LuaGameObject::SetRespawnTime },
{ "SetRespawnDelay", &LuaGameObject::SetRespawnDelay },
// Boolean
{ "IsTransport", &LuaGameObject::IsTransport },

View File

@@ -353,5 +353,20 @@ namespace LuaGameObject
go->SetRespawnTime(respawn);
return 0;
}
/**
* Sets the respawn or despawn time for the gameobject.
*
* Respawn time is also used as despawn time depending on gameobject settings
*
* @param int32 delay = 0 : cooldown time in seconds to respawn or despawn the object. 0 means never
*/
int SetRespawnDelay(lua_State* L, GameObject* go)
{
int32 respawn = Eluna::CHECKVAL<int32>(L, 2);
go->SetRespawnDelay(respawn);
return 0;
}
};
#endif