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); } }}
Trigger that spawns monsters based on PC level and has a cooldown timer
Débuté par
scalyjake
, févr. 09 2013 10:57
#1
Posté 09 février 2013 - 10:57
#2
Posté 10 février 2013 - 12:03
Bioware standard encounter triggers already work exactly like this, so long as you keep your creatures in the CR 1-40 range roughly aligned with player level. Unless you're making higher cr critters, I would just use those.
Funky
Funky
#3
Posté 10 février 2013 - 12:13
I want the creatures to spawn in specific places around the dungeon when this encounter is triggered. How exactly do I utilize the timer on there because I put the script on the OnEnter handle and it will still spawn all the monsters over and over again if a PC keeps stepping on it. So basically how do I utilize that timer on the encounter in this way?
#4
Posté 10 février 2013 - 03:26
many folks out there uses NESS (spawn system) that should allow you to do it...scalyjake wrote...
I want the creatures to spawn in specific places around the dungeon when this encounter is triggered. How exactly do I utilize the timer on there because I put the script on the OnEnter handle and it will still spawn all the monsters over and over again if a PC keeps stepping on it. So basically how do I utilize that timer on the encounter in this way?
btw if you break your encounter into more same encounters that spawns only 1 creature it will be possible to do it with default encounter too, at least if you dont want spawn count randomization
#5
Posté 10 février 2013 - 04:19
Ok thanks a lot I'll definitely look into this.
#6
Posté 10 février 2013 - 05:05
if NESS doesnt satisfy you lmk, I have my own trigger-based spawn system that allows what you wantscalyjake wrote...
Ok thanks a lot I'll definitely look into this.
Modifié par ShaDoOoW, 10 février 2013 - 05:05 .





Retour en haut






