L
l2ankor
Guest
I havnt been able to figure out a good way to consistantly respawn creeps. The best that ive been able to come up with only respawns the creeps once. PLZ HELP ME
Events - A Unit Dies
Conditions : (Unit-type of (Dying Unit)) Equal To (The units you want to revive)
Actions : Create 1 (Unit-type of (Dying Unit)) for (Owner of (Dying Unit)) at (Location of (Dying Unit)) Facing default building facing degrees.
Events:
[Unit - Player-owned unit event]
A unit owned by neutral hostile dies
Conditions:
Actions:
Wait 120 seconds
If
[Boolean Comparison]
((dying unit) is fogged to (owner of (dying unit)) equal to true
Then
[Unit - Create unit facing angle]
Create 1 (unit-type of (dying unit)) at (position of (dying unit)) facing (random angle)
Else
[Trigger - Run trigger (checking conditions)]
Run (this trigger) (checking conditions)
Init
Events
Time - Elapsed game time is 1.00 seconds
Conditions
Actions
Set RespawnRegions[1] = Respawn 1 <gen>
Set RespawnRegions[2] = Respawn 2 <gen>
Set RespawnRegions[3] = Respawn 3 <gen>
Set RespawnRegions[4] = Respawn 4 <gen>
Set Counter = 1
For each (Integer A) from 1 to 4, do (Actions)
Loop - Actions
Set GroupStart[(Integer A)] = Counter
Unit Group - Pick every unit in (Units in RespawnRegions[(Integer A)]) and do (Actions)
Loop - Actions
Unit - Set the custom value of (Picked unit) to (Integer A)
Unit Group - Add (Picked unit) to SpawnGroups[(Integer A)]
Set Graveyard[Counter] = (Unit-type of (Picked unit))
Set Counter = (Counter + 1)
Set GroupEnd[(Integer A)] = (Counter - 1)
Death
Events
Unit - A unit owned by Neutral Hostile Dies
Conditions
((Triggering unit) is in SpawnGroups[(Custom value of (Triggering unit))]) Equal to True
Actions
Unit Group - Remove (Triggering unit) from SpawnGroups[(Custom value of (Triggering unit))]
If ((SpawnGroups[(Custom value of (Triggering unit))] is empty) Equal to False) then do (Skip remaining actions) else do (Do nothing)
Countdown Timer - Start RespawnTimers[(Custom value of (Triggering unit))] as a One-shot timer that will expire in (Random real number between 20.00 and 50.00) seconds
Respawn1
Events
Time - RespawnTimers[1] expires
Conditions
Actions
Wait until (RespawnInProgress Equal to False), checking every 2.00 seconds
Set RespawnIndex = 1
Trigger - Run Respawn <gen> (ignoring conditions)
Respawn2
Events
Time - RespawnTimers[2] expires
Conditions
Actions
Wait until (RespawnInProgress Equal to False), checking every 2.00 seconds
Set RespawnIndex = 2
Trigger - Run Respawn <gen> (ignoring conditions)
Respawn3
Events
Time - RespawnTimers[3] expires
Conditions
Actions
Wait until (RespawnInProgress Equal to False), checking every 2.00 seconds
Set RespawnIndex = 3
Trigger - Run Respawn <gen> (ignoring conditions)
Respawn4
Events
Time - RespawnTimers[4] expires
Conditions
Actions
Wait until (RespawnInProgress Equal to False), checking every 2.00 seconds
Set RespawnIndex = 4
Trigger - Run Respawn <gen> (ignoring conditions)
Respawn
Events
Conditions
Actions
Set RespawnInProgress = True
Set RespawnRegion = RespawnRegions[RespawnIndex]
Wait until (((Center of RespawnRegion) is visible to Player 1 (Red)) Equal to False), checking every 3.00 seconds
For each (Integer A) from GroupStart[RespawnIndex] to GroupEnd[RespawnIndex], do (Actions)
Loop - Actions
Unit - Create 1 Graveyard[(Integer A)] for Neutral Hostile at (Random point in RespawnRegion) facing (Center of RespawnRegion)
Unit - Set the custom value of (Last created unit) to RespawnIndex
Unit Group - Add (Last created unit) to SpawnGroups[RespawnIndex]
Set RespawnInProgress = False
RespawnInProgress Boolean
Counter Integer
RespawnIndex Integer
GroupEnd Integer Array[4]
GroupStart Integer Array[4]
RespawnRegion Region
RespawnRegions Region Array[4]
RespawnTimers Timer Array[4]
SpawnGroups Unit Group Array[4]
Graveyard Unit-Type Array[100] (must be large enough to hold every Creep within the wanted regions)