code
InitCreepRespawn
Events
Map initialization
Conditions
Actions
Set temp_SecondsPerLevel = 100
-------- Only Gets Non-Building, Non-Hero Units. --------
-------- You Can Easily Change That By Adding/Removing Conditions I Put For Matching Unit --------
-------- just a debug message. Ignore this. --------
Set strDebugMSG = Insufficient space left to store remaining units. Maximum units that can be stored are 8192.
-------- ---- --------
Set temp_UnitGroup = (Units owned by Neutral Hostile matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is A Hero) Equal to False) and (((Matching unit) is alive) Equal to True))))
Unit Group - Pick every unit in temp_UnitGroup and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
ID Greater than or equal to 8192
Then - Actions
Game - Display to (All players) the text: strDebugMSG
Skip remaining actions
Else - Actions
Set ID = (ID + 1)
Set temp_CreepSpawnLoc = (Position of (Picked unit))
Set temp_UnitTypes[ID] = (Unit-type of (Picked unit))
Set X[ID] = (X of temp_CreepSpawnLoc)
Set Y[ID] = (Y of temp_CreepSpawnLoc)
Unit - Set the custom value of (Picked unit) to ID
-------- Checks off that the unit has been stored. --------
Set temp_bHasUnitBeenStored[ID] = True
-------- Customizes The Unit's Time From The AdvancedTimeFeature --------
-------- If You Customized It --------
Set temp_TimeFrequencyMAX[ID] = temp_SecondsPerLevel
Set temp_TimeLeft[ID] = temp_TimeFrequencyMAX[ID]
Custom script: call RemoveLocation(udg_temp_CreepSpawnLoc)
Custom script: set udg_temp_CreepSpawnLoc = null
Custom script: call DestroyGroup(udg_temp_UnitGroup)
Custom script: set udg_temp_UnitGroup = null
AunitDies
Events
Unit - A unit Dies
Conditions
(Owner of (Dying unit)) Equal to Neutral Hostile
((Triggering unit) is A structure) Equal to False
((Triggering unit) is A Hero) Equal to False
Actions
-------- This trigger sets the unit's revival when it dies --------
-------- The condition checks if the unit was previously stored or not --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
temp_bHasUnitBeenStored[(Custom value of (Triggering unit))] Equal to True
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
temp_TimeFrequencyMAX[(Custom value of (Triggering unit))] Equal to 0
Then - Actions
Set temp_TimeLeft[(Custom value of (Triggering unit))] = temp_TimeFrequencyMAX[(Custom value of (Picked unit))]
Unit - Create 1 temp_UnitTypes[(Custom value of (Triggering unit))] for Neutral Hostile at (Point(X[(Custom value of (Triggering unit))], Y[(Custom value of (Triggering unit))])) facing Default building facing degrees
Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
Unit - Remove (Triggering unit) from the game
-------- if you dont like the special effect, just delete the last 2 actions below this comment --------
Else - Actions
Unit Group - Add (Triggering unit) to temp_RevivingCreeps
Else - Actions
ReviveTheUnit
Events
Time - Every 0.10 seconds of game time
Conditions
Actions
-------- This is the core of the system, it does the reviving --------
Unit Group - Pick every unit in temp_RevivingCreeps and do (Actions)
Loop - Actions
Set temp_TimeLeft[(Custom value of (Picked unit))] = (temp_TimeLeft[(Custom value of (Picked unit))] - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
temp_TimeLeft[(Custom value of (Picked unit))] Less than or equal to 0
Then - Actions
Set temp_TimeLeft[(Custom value of (Picked unit))] = temp_TimeFrequencyMAX[(Custom value of (Picked unit))]
Unit - Create 1 temp_UnitTypes[(Custom value of (Picked unit))] for Neutral Hostile at (Point(X[(Custom value of (Picked unit))], Y[(Custom value of (Picked unit))])) facing Default building facing degrees
Unit - Set the custom value of (Last created unit) to (Custom value of (Picked unit))
Unit - Remove (Picked unit) from the game
Else - Actions