Hey there! I've been desperately trying to figure out how to spawn monsters in an area based on the PC's level with a trigger. Everything works great except I cannot figure out how to set a cooldown timer on the trigger. I'm a little new at this so I'm not even sure if this is possible and I looked in to either putting a cooldown timer on the OnDeath handle of a monster but that doesn't fit what I want to do because I'm trying to save space by only having monsters spawn when someone is actually there. I also looked into an encounter but that does not really do what I want either unless I'm missing something. Thanks for the help and here's the code so far!
//Trigger for spawns in well: spawn_well//by scalyjake last modified 2/8/13void main(){object oPC=GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR,PLAYER_CHAR_IS_PC);int nPCLevel=GetLevelByPosition(1, oPC);int nSpiIndex;int nCenIndex;object oSpawnTimer=GetObjectByTag("SPWNTMR");if (nPCLevel==1) { for (nSpiIndex=1; nSpiIndex<=15; nSpiIndex++) { location lSpawnSpi=GetLocation(GetWaypointByTag("SPIDER"+IntToString(nSpiIndex))); CreateObject(OBJECT_TYPE_CREATURE, "SPIDERLVL1", lSpawnSpi); } for (nCenIndex=1; nCenIndex<=6; nCenIndex++) { location lSpawnCen=GetLocation(GetWaypointByTag("CENT"+IntToString(nCenIndex))); CreateObject(OBJECT_TYPE_CREATURE, "CENTLVL1", lSpawnCen); } }if (nPCLevel==2) { for (nSpiIndex=1; nSpiIndex<=15; nSpiIndex++) { location lSpawnSpi=GetLocation(GetWaypointByTag("SPIDER"+IntToString(nSpiIndex))); CreateObject(OBJECT_TYPE_CREATURE, "SPIDERLVL2", lSpawnSpi); } for (nCenIndex=1; nCenIndex<=6; nCenIndex++) { location lSpawnCen=GetLocation(GetWaypointByTag("CENT"+IntToString(nCenIndex))); CreateObject(OBJECT_TYPE_CREATURE, "CENTLVL2", lSpawnCen); } }if (nPCLevel==3) { for (nSpiIndex=1; nSpiIndex<=15; nSpiIndex++) { location lSpawnSpi=GetLocation(GetWaypointByTag("SPIDER"+IntToString(nSpiIndex))); CreateObject(OBJECT_TYPE_CREATURE, "SPIDERLVL3", lSpawnSpi); } for (nCenIndex=1; nCenIndex<=6; nCenIndex++) { location lSpawnCen=GetLocation(GetWaypointByTag("CENT"+IntToString(nCenIndex))); CreateObject(OBJECT_TYPE_CREATURE, "CENTLVL3", lSpawnCen); } }if (nPCLevel==4) { for (nSpiIndex=1; nSpiIndex<=15; nSpiIndex++) { location lSpawnSpi=GetLocation(GetWaypointByTag("SPIDER"+IntToString(nSpiIndex))); CreateObject(OBJECT_TYPE_CREATURE, "SPIDERLVL4", lSpawnSpi); } for (nCenIndex=1; nCenIndex<=6; nCenIndex++) { location lSpawnCen=GetLocation(GetWaypointByTag("CENT"+IntToString(nCenIndex))); CreateObject(OBJECT_TYPE_CREATURE, "CENTLVL4", lSpawnCen); } }if (nPCLevel>=5) { for (nSpiIndex=1; nSpiIndex<=15; nSpiIndex++) { location lSpawnSpi=GetLocation(GetWaypointByTag("SPIDER"+IntToString(nSpiIndex))); CreateObject(OBJECT_TYPE_CREATURE, "SPIDERLVL5", lSpawnSpi); } for (nCenIndex=1; nCenIndex<=6; nCenIndex++) { location lSpawnCen=GetLocation(GetWaypointByTag("CENT"+IntToString(nCenIndex))); CreateObject(OBJECT_TYPE_CREATURE, "CENTLVL5", lSpawnCen); } }}