mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
feat(LuaEngine/GameObjectMethods): ddd SetRespawnDelay (#239)
This commit is contained in:
@@ -855,6 +855,7 @@ ElunaRegister<GameObject> GameObjectMethods[] =
|
||||
{ "SetGoState", &LuaGameObject::SetGoState },
|
||||
{ "SetLootState", &LuaGameObject::SetLootState },
|
||||
{ "SetRespawnTime", &LuaGameObject::SetRespawnTime },
|
||||
{ "SetRespawnDelay", &LuaGameObject::SetRespawnDelay },
|
||||
|
||||
// Boolean
|
||||
{ "IsTransport", &LuaGameObject::IsTransport },
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user