Jump to content

Need help with fight script


Recommended Posts

Hi,

I have been baffled with this for weeks now and I cannot seem to figure out what is happening. From my what I have done and what I understand is that the initial group which appears, there seems to be 27 units of them (Looking at the GlobalTimer which is set to 4 rounds, it recycles the creatures being created 3x, which results in 27, am I reading this right)? 

Once they all die, the next group should spawn in (which they do), however they seem to keep respawning infinitely. No matter how many times they die they just keep coming back and the I cannot figure out why. The other Global triggers don't activate since there is something which is looping Global 5. 

If I use console and SetGlobal to 5, it will spawn the group and they will keep spawning. If I set to Global 6, nothing happens, but If I do Global 7 then they spawn correctly and only once, they do not multiply.

I have attached a copy of the code and I am at a complete loss. Any help would be very much appreciated.

Kind regards,

BCS fight script.txt

Link to comment

So, this is a variation on the first pocket plane challenge? The vanilla version doesn't spawn a fixed number of enemies, instead respawning foes whenever they're killed up to a fixed number active at any one time. Until the timer for that wave expires, and the new spawns are the next type of enemies. Then the final wave is a set of bosses that only spawns once.

All right, I'll analyze this block by block.

First block (Gavid poofs):

Spoiler
IF
	Global("BeginChallenge1","GLOBAL",3)
THEN
	RESPONSE #100
		SetGlobal("BeginChallenge1","GLOBAL",4)
		Wait(1)
		ActionOverride("chalsp01",DestroyItem("minhp1"))  // No such index
		Wait(1)
		CreateVisualEffectObject("SPDEATH3","chalsp01")  // Gavid
		ActionOverride("chalsp01",Kill(Myself))
		Wait(2)
		SetGlobalTimer("Chal1Wave1","AR4500",FOUR_ROUNDS)  // Pocket Plane
END

 

This one's pretty straightforward. Set the progress variable to 4, start a timer, remove the guy that talked to you. The block doesn't repeat, because the variable used in the condition is immediately changed.

Second block (sahuagin):

Spoiler
IF
	Global("BeginChallenge1","GLOBAL",4)
	GlobalTimerNotExpired("Chal1Wave1","AR4500")  // Pocket Plane
	ActionListEmpty()
	InActiveArea(Myself)
THEN
	RESPONSE #100
		CreateVisualEffect("SPFLESHS",[923.433])
		CreateCreature("CHEVIL04",[923.433],S)  // Sahuagin
		Wait(2)
		CreateVisualEffect("SPFLESHS",[1164.470])
		CreateCreature("CHEVIL04",[1164.470],SE)  // Sahuagin
		CreateVisualEffect("SPFLESHS",[661.849])
		CreateCreature("CHEVIL04",[661.849],SE)  // Sahuagin
		CreateVisualEffect("SPFLESHS",[923.433])
		CreateCreature("CHEVIL04",[923.433],S)  // Sahuagin
		Wait(3)
		CreateVisualEffect("SPFLESHS",[638.505])
		CreateCreature("CHEVIL04",[638.505],S)  // Sahuagin
		CreateVisualEffect("SPFLESHS",[1322.729])
		CreateCreature("CHEVIL04",[1322.729],S)  // Sahuagin
		CreateVisualEffect("SPFLESHS",[561.694])
		CreateCreature("CHEVIL04",[561.694],S)  // Sahuagin
		Wait(3)
		CreateVisualEffect("SPFLESHS",[1121.869])
		CreateCreature("CHEVIL04",[1121.869],S)  // Sahuagin
		Wait(3)
		CreateVisualEffect("SPFLESHS",[561.694])
		CreateCreature("CHEVIL04",[561.694],S)  // Sahuagin
END

 

This spawns nine sahuagin over 11 seconds - just under half of your timer. Or at least, that's what happens if the whole block gets executed. Scripts with waits in them are notoriously prone to getting interrupted and having blocks only partially execute. But I'll assume that part works at least.

What happens when the block's done? Then, the next time the game goes through the script, it finds this block again. The conditions are true, so it goes through and makes another nine sahuagin. Repeat until the timer runs out - maybe three times through, maybe only two because there's something like a second of delay between script cycles and that might be enough to push the total time over the 24 second mark.

Also, ActionListEmpty() and InActiveArea(Myself())? OK, those triggers are in the original version of the challenge script, but they only really make sense in a creature's script. I don't see any downside to deleting them.

On to the third block, intended to finish up the first wave.

Spoiler
IF
	Global("BeginChallenge1","GLOBAL",4)
	Dead("CHEVIL04")  // Sahuagin
	!Exists("CHEVIL04")  // Sahuagin
	NumDeadGT("CHEVIL04",26)  // Sahuagin
THEN
	RESPONSE #100
		SetGlobal("BeginChallenge1","GLOBAL",5)
		Wait(2)
END

 

Redundant conditions there, but this is basically saying that if you've killed at least 27 sahuagin and none are active, it's time to move on to the second wave. If the timing went just a little bit wrong or one of those wait blocks got interrupted and fewer than 27 sahuagin spawned, you're out of luck and this block will never run. I recommend tweaking the spawning logic (use a counter instead of a timer) and conditioning this block only on no sahuagin being present; by the time this even has a chance to run, the spawning is definitely over.

Now the fourth block, getting into the second wave.

Spoiler
IF
	Global("BeginChallenge1","GLOBAL",5)
	ActionListEmpty()
	InActiveArea(Myself)
THEN
	RESPONSE #100
		CreateVisualEffect("SPFLESHS",[923.433])
		CreateCreature("chevil15",[923.433],S)  
		Wait(1)
		CreateVisualEffect("SPFLESHS",[1164.470])
		CreateCreature("chevil17",[1164.470],SE)
		Wait(1)
		CreateVisualEffect("SPFLESHS",[661.849])
		CreateCreature("chevil18",[661.849],SE)  
		Wait(1)
		CreateVisualEffect("SPFLESHS",[638.505])
		CreateCreature("chevil11",[638.505],S)
		Wait(1)
		CreateVisualEffect("SPFLESHS",[1322.729])
		CreateCreature("chevil16",[1322.729],S)  
		Wait(1)
		CreateVisualEffect("SPFLESHS",[561.694])
		CreateCreature("chevil25",[561.694],S)  
		Wait(1)
		CreateVisualEffect("SPFLESHS",[1121.869])
		CreateCreature("chevil13",[1121.869],S)  
END

 

Oh dear. There's no timer this time. No variable that gets changed in the process of running the script. You spawn seven creatures over six seconds, and when you're done the conditions for this block are still true. So the next time we go through the area script, it runs this again. No later blocks in the script ever have a chance to run. It'll just keep spawning instances of those creatures indefinitely.

I'll look at the remaining blocks even though they never run, just to continue the analysis.

Spoiler
IF
	Global("BeginChallenge1","GLOBAL",5)
	Dead("chevil15")  
	Dead("chevil17") 
	Dead("chevil18")  
	Dead("chevil11") 
	Dead("chevil16")  
	Dead("chevil25")  
	Dead("chevil13") 
THEN
	RESPONSE #100
		SetGlobal("BeginChallenge1","GLOBAL",6)
END

 

If you've killed at least one instance of each of the creatures from the second wave, move on. OK, I can now guess your intent - you wanted to spawn them once, and have that fight run until all are dead.

Now the third wave.

Spoiler
IF
	Global("BeginChallenge1","GLOBAL",6)
	GlobalTimerNotExpired("Chal1Wave3","AR4500")  // Pocket Plane
	ActionListEmpty()
	InActiveArea(Myself)
THEN
	RESPONSE #100
		CreateVisualEffect("SPFLESHS",[923.433])
		CreateCreature("hmppdr01",[923.433],S)  // Drow
		CreateVisualEffect("SPFLESHS",[1164.470])
		CreateCreature("hmppdrm",[1164.470],SE)  // Drow Wizard
		CreateVisualEffect("SPFLESHS",[661.849])
		CreateCreature("hmppdr03",[661.849],SE)  // Drow
		IncrementGlobal("EXTRACOUNT3","MYAREA",1)
	RESPONSE #100
		CreateVisualEffect("SPFLESHS",[638.505])
		CreateCreature("hmppdrm",[638.505],S)  // Drow Wizard
		CreateVisualEffect("SPFLESHS",[1322.729])
		CreateCreature("chevil06",[1322.729],S)  // Drow Warrior
		IncrementGlobal("EXTRACOUNT3","MYAREA",1)
	RESPONSE #100
		CreateVisualEffect("SPFLESHS",[561.694])
		CreateCreature("chevil06",[561.694],S)  // Drow Warrior
		CreateVisualEffect("SPFLESHS",[1121.869])
		CreateCreature("hmppdrp",[1121.869],S)  // Drow Priestess
		IncrementGlobal("EXTRACOUNT3","MYAREA",1)
END

 

Another timer-based wave. Spawn two or three drow (chosen randomly from three possible groups) and increment a counter. No wait and nothing in this block to check the counter, so we go right back and do it again every second or so until the timer runs out ... except that the timer hasn't been set in the first place, so this block never runs at all. This definitely needs repair.

Actually, regarding that EXTRACOUNT3 variable, I think there's some sneaky hardcoding going on - that the death of a creature with "gender" EXTRA3 decrements it by one. At least, that's the only way the vanilla scripting for this fight makes sense. So you should probably increment it by the number of creatures (with the EXTRA3 gender) spawned instead of 1, if you intend to do anything with it.

Spoiler
IF
	Global("BeginChallenge1","GLOBAL",6)
	GlobalTimerExpired("Chal1Wave3","AR4500")  // Pocket Plane
THEN
	RESPONSE #100
		SetGlobal("BeginChallenge1","GLOBAL",7)
END

 

Move on to the next wave when the timer expires. Simple and straightforward; this block might even survive unchanged to the final version of whatever you're trying to do.

And now, the final wave.

Spoiler
IF
	Global("BeginChallenge1","GLOBAL",7)
	ActionListEmpty()
	CombatCounter(0)
THEN
	RESPONSE #100
		Wait(2)
		SetGlobal("BeginChallenge1","GLOBAL",12)
		CreateVisualEffect("SPGFLSH1",[638.505])
		CreateVisualEffect("SPPORTAL",[638.505])
		CreateCreature("chevil09",[638.505],SEE)  
		CreateVisualEffect("SPGFLSH1",[923.433])
		CreateVisualEffect("SPPORTAL",[923.433])
		CreateCreature("chevil08",[923.433],S)  
		CreateVisualEffect("SPGFLSH1",[561.694])
		CreateVisualEffect("SPPORTAL",[561.694])
		CreateCreature("chgood09",[561.694],NE) 
END

 

Spawn the bosses, once. Irenicus, Bodhi, and Ellesime, unless you've changed things around. Do you have something against elves? Anyway, this one looks fine. Just need to repair the blocks farther up.

Link to comment
18 hours ago, jmerry said:

So, this is a variation on the first pocket plane challenge? The vanilla version doesn't spawn a fixed number of enemies, instead respawning foes whenever they're killed up to a fixed number active at any one time. Until the timer for that wave expires, and the new spawns are the next type of enemies. Then the final wave is a set of bosses that only spawns once.

All right, I'll analyze this block by block.

First block (Gavid poofs):

  Reveal hidden contents
IF
	Global("BeginChallenge1","GLOBAL",3)
THEN
	RESPONSE #100
		SetGlobal("BeginChallenge1","GLOBAL",4)
		Wait(1)
		ActionOverride("chalsp01",DestroyItem("minhp1"))  // No such index
		Wait(1)
		CreateVisualEffectObject("SPDEATH3","chalsp01")  // Gavid
		ActionOverride("chalsp01",Kill(Myself))
		Wait(2)
		SetGlobalTimer("Chal1Wave1","AR4500",FOUR_ROUNDS)  // Pocket Plane
END

 

This one's pretty straightforward. Set the progress variable to 4, start a timer, remove the guy that talked to you. The block doesn't repeat, because the variable used in the condition is immediately changed.

Second block (sahuagin):

  Reveal hidden contents
IF
	Global("BeginChallenge1","GLOBAL",4)
	GlobalTimerNotExpired("Chal1Wave1","AR4500")  // Pocket Plane
	ActionListEmpty()
	InActiveArea(Myself)
THEN
	RESPONSE #100
		CreateVisualEffect("SPFLESHS",[923.433])
		CreateCreature("CHEVIL04",[923.433],S)  // Sahuagin
		Wait(2)
		CreateVisualEffect("SPFLESHS",[1164.470])
		CreateCreature("CHEVIL04",[1164.470],SE)  // Sahuagin
		CreateVisualEffect("SPFLESHS",[661.849])
		CreateCreature("CHEVIL04",[661.849],SE)  // Sahuagin
		CreateVisualEffect("SPFLESHS",[923.433])
		CreateCreature("CHEVIL04",[923.433],S)  // Sahuagin
		Wait(3)
		CreateVisualEffect("SPFLESHS",[638.505])
		CreateCreature("CHEVIL04",[638.505],S)  // Sahuagin
		CreateVisualEffect("SPFLESHS",[1322.729])
		CreateCreature("CHEVIL04",[1322.729],S)  // Sahuagin
		CreateVisualEffect("SPFLESHS",[561.694])
		CreateCreature("CHEVIL04",[561.694],S)  // Sahuagin
		Wait(3)
		CreateVisualEffect("SPFLESHS",[1121.869])
		CreateCreature("CHEVIL04",[1121.869],S)  // Sahuagin
		Wait(3)
		CreateVisualEffect("SPFLESHS",[561.694])
		CreateCreature("CHEVIL04",[561.694],S)  // Sahuagin
END

 

This spawns nine sahuagin over 11 seconds - just under half of your timer. Or at least, that's what happens if the whole block gets executed. Scripts with waits in them are notoriously prone to getting interrupted and having blocks only partially execute. But I'll assume that part works at least.

What happens when the block's done? Then, the next time the game goes through the script, it finds this block again. The conditions are true, so it goes through and makes another nine sahuagin. Repeat until the timer runs out - maybe three times through, maybe only two because there's something like a second of delay between script cycles and that might be enough to push the total time over the 24 second mark.

Also, ActionListEmpty() and InActiveArea(Myself())? OK, those triggers are in the original version of the challenge script, but they only really make sense in a creature's script. I don't see any downside to deleting them.

On to the third block, intended to finish up the first wave.

  Reveal hidden contents
IF
	Global("BeginChallenge1","GLOBAL",4)
	Dead("CHEVIL04")  // Sahuagin
	!Exists("CHEVIL04")  // Sahuagin
	NumDeadGT("CHEVIL04",26)  // Sahuagin
THEN
	RESPONSE #100
		SetGlobal("BeginChallenge1","GLOBAL",5)
		Wait(2)
END

 

Redundant conditions there, but this is basically saying that if you've killed at least 27 sahuagin and none are active, it's time to move on to the second wave. If the timing went just a little bit wrong or one of those wait blocks got interrupted and fewer than 27 sahuagin spawned, you're out of luck and this block will never run. I recommend tweaking the spawning logic (use a counter instead of a timer) and conditioning this block only on no sahuagin being present; by the time this even has a chance to run, the spawning is definitely over.

Now the fourth block, getting into the second wave.

  Reveal hidden contents
IF
	Global("BeginChallenge1","GLOBAL",5)
	ActionListEmpty()
	InActiveArea(Myself)
THEN
	RESPONSE #100
		CreateVisualEffect("SPFLESHS",[923.433])
		CreateCreature("chevil15",[923.433],S)  
		Wait(1)
		CreateVisualEffect("SPFLESHS",[1164.470])
		CreateCreature("chevil17",[1164.470],SE)
		Wait(1)
		CreateVisualEffect("SPFLESHS",[661.849])
		CreateCreature("chevil18",[661.849],SE)  
		Wait(1)
		CreateVisualEffect("SPFLESHS",[638.505])
		CreateCreature("chevil11",[638.505],S)
		Wait(1)
		CreateVisualEffect("SPFLESHS",[1322.729])
		CreateCreature("chevil16",[1322.729],S)  
		Wait(1)
		CreateVisualEffect("SPFLESHS",[561.694])
		CreateCreature("chevil25",[561.694],S)  
		Wait(1)
		CreateVisualEffect("SPFLESHS",[1121.869])
		CreateCreature("chevil13",[1121.869],S)  
END

 

Oh dear. There's no timer this time. No variable that gets changed in the process of running the script. You spawn seven creatures over six seconds, and when you're done the conditions for this block are still true. So the next time we go through the area script, it runs this again. No later blocks in the script ever have a chance to run. It'll just keep spawning instances of those creatures indefinitely.

I'll look at the remaining blocks even though they never run, just to continue the analysis.

  Reveal hidden contents
IF
	Global("BeginChallenge1","GLOBAL",5)
	Dead("chevil15")  
	Dead("chevil17") 
	Dead("chevil18")  
	Dead("chevil11") 
	Dead("chevil16")  
	Dead("chevil25")  
	Dead("chevil13") 
THEN
	RESPONSE #100
		SetGlobal("BeginChallenge1","GLOBAL",6)
END

 

If you've killed at least one instance of each of the creatures from the second wave, move on. OK, I can now guess your intent - you wanted to spawn them once, and have that fight run until all are dead.

Now the third wave.

  Reveal hidden contents
IF
	Global("BeginChallenge1","GLOBAL",6)
	GlobalTimerNotExpired("Chal1Wave3","AR4500")  // Pocket Plane
	ActionListEmpty()
	InActiveArea(Myself)
THEN
	RESPONSE #100
		CreateVisualEffect("SPFLESHS",[923.433])
		CreateCreature("hmppdr01",[923.433],S)  // Drow
		CreateVisualEffect("SPFLESHS",[1164.470])
		CreateCreature("hmppdrm",[1164.470],SE)  // Drow Wizard
		CreateVisualEffect("SPFLESHS",[661.849])
		CreateCreature("hmppdr03",[661.849],SE)  // Drow
		IncrementGlobal("EXTRACOUNT3","MYAREA",1)
	RESPONSE #100
		CreateVisualEffect("SPFLESHS",[638.505])
		CreateCreature("hmppdrm",[638.505],S)  // Drow Wizard
		CreateVisualEffect("SPFLESHS",[1322.729])
		CreateCreature("chevil06",[1322.729],S)  // Drow Warrior
		IncrementGlobal("EXTRACOUNT3","MYAREA",1)
	RESPONSE #100
		CreateVisualEffect("SPFLESHS",[561.694])
		CreateCreature("chevil06",[561.694],S)  // Drow Warrior
		CreateVisualEffect("SPFLESHS",[1121.869])
		CreateCreature("hmppdrp",[1121.869],S)  // Drow Priestess
		IncrementGlobal("EXTRACOUNT3","MYAREA",1)
END

 

Another timer-based wave. Spawn two or three drow (chosen randomly from three possible groups) and increment a counter. No wait and nothing in this block to check the counter, so we go right back and do it again every second or so until the timer runs out ... except that the timer hasn't been set in the first place, so this block never runs at all. This definitely needs repair.

Actually, regarding that EXTRACOUNT3 variable, I think there's some sneaky hardcoding going on - that the death of a creature with "gender" EXTRA3 decrements it by one. At least, that's the only way the vanilla scripting for this fight makes sense. So you should probably increment it by the number of creatures (with the EXTRA3 gender) spawned instead of 1, if you intend to do anything with it.

  Reveal hidden contents
IF
	Global("BeginChallenge1","GLOBAL",6)
	GlobalTimerExpired("Chal1Wave3","AR4500")  // Pocket Plane
THEN
	RESPONSE #100
		SetGlobal("BeginChallenge1","GLOBAL",7)
END

 

Move on to the next wave when the timer expires. Simple and straightforward; this block might even survive unchanged to the final version of whatever you're trying to do.

And now, the final wave.

  Reveal hidden contents
IF
	Global("BeginChallenge1","GLOBAL",7)
	ActionListEmpty()
	CombatCounter(0)
THEN
	RESPONSE #100
		Wait(2)
		SetGlobal("BeginChallenge1","GLOBAL",12)
		CreateVisualEffect("SPGFLSH1",[638.505])
		CreateVisualEffect("SPPORTAL",[638.505])
		CreateCreature("chevil09",[638.505],SEE)  
		CreateVisualEffect("SPGFLSH1",[923.433])
		CreateVisualEffect("SPPORTAL",[923.433])
		CreateCreature("chevil08",[923.433],S)  
		CreateVisualEffect("SPGFLSH1",[561.694])
		CreateVisualEffect("SPPORTAL",[561.694])
		CreateCreature("chgood09",[561.694],NE) 
END

 

Spawn the bosses, once. Irenicus, Bodhi, and Ellesime, unless you've changed things around. Do you have something against elves? Anyway, this one looks fine. Just need to repair the blocks farther up.

Thank you for getting back to me. Yes, this is suppose to be a variation of the first Challenge room in Pocket Plane, My initial idea was to have a gauntlet of fights from foes from BG1 > BG2 as a sort of remembrance of past battles. I was thinking to have individual battles with a small break in between waves to allow for a quick-save which would be signalled by an NPC showing up and talking to it will trigger the next Global trigger to activate much like when Gavid dies, but I wanted to try and sort out the fights themselves first, but as I am sure you can tell I have been having trouble with it. 

The Sahugain I just left in as they have a bit of HP and it could stall time, I wanted to have random foes appear (I have already created scripts/creature which allow random creatures to be created in its place), but since I could not figure out a way to stop the Sahugain from spawning before the next round started, I thought there was no point in putting it in until I could figure it out. What is it you mean with using a counter instead of a timer, should I create a separate global variable which increments each time a Sahugain is created until a certain number is reached?

For the fourth block, I have made alterations to the Global variables at play and by changing some of them, only once instance of the creatures spawn.

For the third wave, I have added in a GlobalTimer has was previously done for the first wave to try and control the amount of creatures which were spawning, although it seems doing it with this wave causes a huge number of Drow to spawn, which is unintended. I need to take a look at that. 

Final wave seems to be fine so far. I did laugh a little at the at the comment about the elves, It just so happens many of the more powerful creatures in this game are elves. They were originally meant to be the final wave, but since you can possibly fight them again because of SCS, I might replace them with something else. 

 

Link to comment

What do I mean about using a counter instead of a timer? Pretty much what you said. Create a global variable that increments when you create a sahuagin, or simply each time you run the spawning block. Test for this in the block's conditions, so you only run it a certain number of times. This variable shouldn't be any of the EXTRACOUNT variables, as I believe those have hardcoded behavior attached to them to decrement when a creature of the appropriate (EXTRA, EXTRA2, etc. ) gender dies.

Regarding the third-wave drow, your current block spawns two or three drow each script-execution cycle. Which is about once every second. No safety valve to stop spawning them when there are too many out already. If you can't kill them as fast as they spawn - and that's extremely likely to be the case - the area will just flood with an overwhelming number of them.

I'd recommend using something like the original script's EXTRACOUNT3 solution. All those drow have gender EXTRA3, you increment EXTRACOUNT3 by the number of drow spawned each time you spawn any, and you condition on EXTRACOUNT3 not being too high in the spawning block. EXTRACOUNT3 decrements by one every time you kill one of them, so that condition means there aren't too many out at any given time. The original version has this cap at two to six enemies based on a "difficulty" parameter that tests the number of party members and their average levels. Of course, this is also coupled with a timer so they just stop spawning in at a certain point.

Link to comment
28 minutes ago, jmerry said:

What do I mean about using a counter instead of a timer? Pretty much what you said. Create a global variable that increments when you create a sahuagin, or simply each time you run the spawning block. Test for this in the block's conditions, so you only run it a certain number of times. This variable shouldn't be any of the EXTRACOUNT variables, as I believe those have hardcoded behavior attached to them to decrement when a creature of the appropriate (EXTRA, EXTRA2, etc. ) gender dies.

If I was to instead replace the Sahugain (CHEVIL04) with another creature which has the random creature.BCS attached to it, would it be possible to prevent them from over spawning as in the case with the Drow block? My understanding is that because the .BCS calls out a random creature from the list, would it even be possible to tell the script not to progress to the next Global value until all enemies are dead as the creatures called in will all have different .CRE names? 

I do apologies if it sounds like I am asking quite a lot, its just that I am not a really good programmer and I am still currently learning the ropes. 

Link to comment

There's no reason to be checking for "are they dead". The check that matters in that block is "do they exist right now?". And there's no problem extending that to multiple creatures.

Or you could go back to the EXTRA2 technique the original used; track the number of enemies out at any given time with a variable that increments every time one spawns and decrements every time one is killed.

Link to comment

So I have made some changes to my scripting by adding in your suggestions. By incrementing the GlobalVariable I can control the creatures being spawned in which is fine because I do not want to overload the screen with enemies. The issue I am having now is with the "Exist". With what I have now, before the the next wave spawns in it checks to see if CHEVIL04 exist, even when they are still alive, the next block of script activates and still spawns in the enemies even with the Sahugain still alive. I let my PC kill some of them, but before they all get killed the next mob appears which isn't suppose to happen. If I use CombatCounter(0) instead of Exists, the next block doesn't trigger until there is nothing happening on screen, but I have the feeling that this is really not a practical thing to use.

IF
    Global("BeginChallenge1","GLOBAL",4)
    GlobalTimerNotExpired("Chal1Wave1","AR4500")  // Pocket Plane
    GlobalLT("Wave1Spawn","MYAREA",9)
THEN
    RESPONSE #100
        CreateVisualEffect("SPFLESHS",[923.433])
        CreateCreature("CHEVIL04",[923.433],S)  // Sahuagin
        IncrementGlobal("Wave1Spawn","MYAREA",1)
        RESPONSE #100
        Wait(2)
        CreateVisualEffect("SPFLESHS",[1164.470])
        CreateCreature("CHEVIL04",[1164.470],SE)  // Sahuagin
        CreateVisualEffect("SPFLESHS",[661.849])
        CreateCreature("CHEVIL04",[661.849],SE)  // Sahuagin
        CreateVisualEffect("SPFLESHS",[923.433])
        CreateCreature("CHEVIL04",[923.433],S)  // Sahuagin
        IncrementGlobal("Wave1Spawn","MYAREA",1)
        RESPONSE #100
        Wait(3)
        CreateVisualEffect("SPFLESHS",[638.505])
        CreateCreature("CHEVIL04",[638.505],S)  // Sahuagin
        CreateVisualEffect("SPFLESHS",[1322.729])
        CreateCreature("CHEVIL04",[1322.729],S)  // Sahuagin
        CreateVisualEffect("SPFLESHS",[561.694])
        CreateCreature("CHEVIL04",[561.694],S)  // Sahuagin
        IncrementGlobal("Wave1Spawn","MYAREA",1)
        RESPONSE #100
        Wait(3)
        CreateVisualEffect("SPFLESHS",[1121.869])
        CreateCreature("CHEVIL04",[1121.869],S)  // Sahuagin
        IncrementGlobal("Wave1Spawn","MYAREA",1)
        RESPONSE #100
        Wait(3)
        CreateVisualEffect("SPFLESHS",[561.694])
        CreateCreature("CHEVIL04",[561.694],S)  // Sahuagin
        IncrementGlobal("Wave1Spawn","MYAREA",1)
END

IF
    Global("BeginChallenge1","GLOBAL",4)
THEN
    RESPONSE #100
        SetGlobal("BeginChallenge1","GLOBAL",5)
END

IF
    Global("BeginChallenge1","GLOBAL",5)
    !Exists("CHEVIL04")
THEN
    RESPONSE #100
        SetGlobal("BeginChallenge1","GLOBAL",6)
        CreateVisualEffect("SPFLESHS",[923.433])
        CreateCreature("chevil15",[923.433],S) 
        Wait(1)
        CreateVisualEffect("SPFLESHS",[1164.470])
        CreateCreature("chevil17",[1164.470],SE) 
        Wait(1)
        CreateVisualEffect("SPFLESHS",[661.849])
        CreateCreature("chevil18",[661.849],SE) 
        Wait(1)
        CreateVisualEffect("SPFLESHS",[638.505])
        CreateCreature("chevil11",[638.505],S) 
        Wait(1)
        CreateVisualEffect("SPFLESHS",[1322.729])
        CreateCreature("chevil16",[1322.729],S) 
        Wait(1)
        CreateVisualEffect("SPFLESHS",[561.694])
        CreateCreature("chevil25",[561.694],S) 
        Wait(1)
        CreateVisualEffect("SPFLESHS",[1121.869])
        CreateCreature("chevil13",[1121.869],S) 
END
 

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...