@@ -301,7 +301,22 @@ namespace LuaGameObject
301301 go->SetRespawnTime (respawn);
302302 return 0 ;
303303 }
304-
304+
305+ /* *
306+ * Sets whether or not the [GameObject] will be spawned by default
307+ *
308+ * Primarily used for temporary spawns.
309+ *
310+ * @param bool spawn = true : if false, it will prevent the [GameObject] from respawning by default
311+ */
312+ int SetSpawnedByDefault (Eluna* E, GameObject* go)
313+ {
314+ bool spawn = E->CHECKVAL <bool >(2 , true );
315+
316+ go->SetSpawnedByDefault (spawn);
317+ return 0 ;
318+ }
319+
305320 ElunaRegister<GameObject> GameObjectMethods[] =
306321 {
307322 // Getters
@@ -316,6 +331,7 @@ namespace LuaGameObject
316331 { " SetGoState" , &LuaGameObject::SetGoState },
317332 { " SetLootState" , &LuaGameObject::SetLootState },
318333 { " SetRespawnTime" , &LuaGameObject::SetRespawnTime },
334+ { " SetSpawnedByDefault" , &LuaGameObject::SetSpawnedByDefault },
319335
320336 // Boolean
321337 { " IsTransport" , &LuaGameObject::IsTransport },
@@ -331,8 +347,7 @@ namespace LuaGameObject
331347 { " SaveToDB" , &LuaGameObject::SaveToDB },
332348
333349 // Not implemented methods
334- { " IsDestructible" , METHOD_REG_NONE }, // Not implemented
335- { " SetSpawnedByDefault" , METHOD_REG_NONE } // Not implemented
350+ { " IsDestructible" , METHOD_REG_NONE } // Not implemented
336351 };
337352};
338353#endif
0 commit comments