Final script for the community.
Beta version 0.001
tested
Spawns a monster from a trigger. If the monster is killed and the trigger is used again the monster will respawn. If the monster is not killed and the trigger is used again only one monster will spawn at that location.
The script checks if there is a monster spawned already at that location and if so then don't spawn another. If there is no monster there then spawn the monster.
remember that spawing large amounts of monsters will be CPU intensive.
KB---
/*tells the tool that this dummy is the PC*/
DB_IsPlayer(CHARACTERGUID_S_GLO_CharacterCreationDummy_001_da072fe7-fdd5-42ae-9139-8bd4b9fca406);
/*Registers the PC fo rthe tigger, with out it will not function*/
TriggerRegisterForPlayers(TRIGGERGUID_Monkworks_eventTrigger_001_aa7348aa-423b-4b65-936b-a741fd61245b);
InIt---
/*
Monkworks Spawn Monster Script V0.001.
If the PC runs through the trigger, Fire!
Thanks to Windemere & LarIlya
Spawns one mob and only one no matter how many times the PC runs through the trigger. One Mob will allways spawn at that location. If the mob is killed, and the trigger it used again, One Mob will spawn again.*/
IF
CharacterEnteredTrigger(_Character, TRIGGERGUID_Monkworks_eventTrigger_001_aa7348aa-423b-4b65-936b-a741fd61245b)/*<<<add your Trigger here*/
/*and get the Position of that SpawnPoint trigger that the Mob will spawn to*/
AND
GetPosition(TRIGGERGUID_Monkworks_spawnEventTrigger_000_8b450762-1957-408a-b91d-b6ce4353cf4a /*<<<add your SpawnPoint here*/, _X, _Y, _Z)
/*and the Mob is not in the DB yet*/
AND
NOT DB_MonkWorksZombieDatabase(_)
/*so create the ID at the said Position*/
AND
CharacterCreateAtPosition(_X, _Y, _Z, "CHARACTERGUID_Monkworks_Undead_Zombie000_2f62a479-299e-44e8-9688-8ac78bbce0f0"/*<<add your CHARACTERGUID there*/ , 1, _Zombie)
/*while your at it add to the DB we have been taling about*/
THEN
DB_MonkWorksZombieDatabase(_Zombie);
/*_Zombie is the name of the DB entry*/
/*Hey if the MOb is dead already*/
IF
CharacterDied(_Zombie)
/* and it already in the DB*/
AND
DB_MonkWorksZombieDatabase(_Zombie)
/* Then do not add it to the DB and spawn the monster already*/
THEN
NOT DB_MonkWorksZombieDatabase(_Zombie);