Creating spawns that are automatically removed after some time by setting the Duration property
Setting the Duration property allows spawned objects to be automatically deleted after some period of time.
By default, spawners have duration set to zero, which means infinite duration (the standard case).
The duration timer begins immediately after a spawn, and when the timer expires, all spawns on the spawner will be removed.
Creating spawns with limited lifetime using the DespawnTime property
The DespawnTime property specifies the maximum time in hours that a spawn can exist before being automatically deleted. By default this is set to zero which means the spawn will never be automatically deleted. Setting this to 24 hours will lead to spawns that get automatically refreshed every 24 hours. Note, this will work on both item and mobile spawns, but mobiles will not be deleted while players are around (an active zone).
It can also be used to create limited duration spawns, much like using the Duration property, except that Duration must be less than the min/max delay period and allows very precise timing control (because it is run on a separate timer), while DespawnTime is only checked during Defrag (every min/max delay period), does not have a separate timer, and would therefore be used for longer time window despawning.
When used with items that spawn in containers it would allow them to decay just as items on the ground normally would.
This could be used with triggered container spawns that you only wanted to last for a limited period of time before being removed so that the spawner could be triggered again.
For example, you could set up a triggered spawner that filled a container with loot that was a function of the triggering players luck or fame, and then even if the player didnt take the loot it would only last a limited period of time and the spawner would be ready for triggering by another player.
Example:
Description of lootpack.xml from xmlextras:
This spawns a container containing a lootpack triggered by a player coming into range. This is an example that demonstrates how the LOOTPACK keyword and the DespawnTime property can be combined to set up time-limited, luck-dependent spawns.
The spawner spawns a metal chest, ADDs an ultrarich lootpack that will depend on the luck of the triggering mob, makes it immovable, and hues the chest. It sets the DespawnTime property to 30 seconds, which means that after 30 seconds, the chest will disappear. The Min/MaxRefract properties are set for 2 mins, which means the spawner cannot be triggered again for 2 mins. ProximityMessage is also set announcing the appearance of the chest.
spawner (Lootpack#1)
0 metalchest/ADD/LOOTPACK,ultrarich/hue/1150/movable/false
mindelay=0secs
maxdelay=0secs
proximity triggering enabled (range=5)
Vytváření spawnu s časovým limitem použitím Duration
Nastavením Duration vám umožňuje vytvořit objekt, jenž je po určité časové době, smazán.
Standartně mají spawnery nastavenu Duration na 0, což znamená, že tato vlastnost je neaktivní.
Když máte nastavenou Duration > 0, čas začíná ubíhat okamžitě po spawnutí a když čas vyprší, všechno, co spawner vytvořil, zmizí.
Vytváření spawnu s omezenou životností použitím DespawnTime
DespawnTime určuje maximální čas, po kterém tento spawn (rozumějme spawnu jako "výtvoru" spawneru) existuje před automatickým smazáním. Standartně je tato vlastnost nastavena na 0, což znamená, že spawn nebude nikdy automaticky smazán. Nastavením 24 hodin povede k tomu, že spawn bude automaticky obnoven po 24 hodinách. Poznámka, tato vlastnost se aplikuje jak na předměty tak na moby, ale mobové nebudou smazání, pokud se hráči nachází v aktvní zóně spawneru.
Může to být také použito pro spawner stejně jako Duration, až na to, že Duration musí být menší než min/max delay a nabízí velmi přesnou časovou kontrolu (je to způsobeno nezávislým časováním), zatímco DespawnTime je kontrolován pouze v průběhu odstraňování (každá min/max delay perioda), nemá nezávislé časování, a může být tedy použit v delších časových intervalech.
Když toto aplikujete na veci vytvořené v kontejnerech, umožní vám to nasimulovat decay, jako kdyby byl item na zemi.
Toto můžete využít ve spojitosti se spawnerem spawnujícím do nějakého kontejneru, ve kterém chcete veci pouze po určitou časovou dobu.
For example, you could set up a triggered spawner that filled a container with loot that was a function of the triggering players luck or fame, and then even if the player didnt take the loot it would only last a limited period of time and the spawner would be ready for triggering by another player.
Například:
Popis lootpack.xml:
Tento spawner vytváří po spuštění (hráčem, proximita) bednu obsahující lootpack. Tento příklad ukazuje demonstruje, jak lze použít LOOTPACK s DespawnTime pro nastavení časově omezeného spawnu se závislostí na výši lucku.
Spawner vytvoří bednu obsahující ultrarich loot, který závisí práve na lucku hráče, který spawner spustil, zamkne bednu na zemi, a nakonec jí nastaví barvu. Poté musíte nastavit DespawnTime na 30s (to se totiž autovovi v examplu nějak vytratilo), což znamená, že bedna po 30s zmizí. Min/MaxRefract jsou nastaveny na 2 min, což znamená, že se spawner bude moci aktivovat minimálně za 2 minuty. ProximityMessage je jako doplněk nastaveno pro oznámení objevení truhly.
spawner (Lootpack#1)
0 metalchest/ADD/LOOTPACK,ultrarich/hue/1150/movable/false
mindelay=0secs
maxdelay=0secs
proximity triggering enabled (range=5)