Moderator
M
Moderator
|
Moderator: Pharaoh_ Date: 20:44, 5th Jul 2012
|
SR Setup

Events


Map initialization

Conditions

Actions


-------- 1st unit --------


Set SR_SpawnUnit[1] = Paladin


Set SR_SpawnLimit[1] = 4


Set SR_SpawnRegion[1] = PaladinRegion <gen>


Set SR_RespawnDuration[1] = 2.00


-------- 2nd unit --------


Set SR_SpawnUnit[2] = Archmage


Set SR_SpawnLimit[2] = 3


Set SR_SpawnRegion[2] = ArchmageRegion <gen>


Set SR_RespawnDuration[2] = 6.00


-------- 3rd unit --------


Set SR_SpawnUnit[3] = Mountain King


Set SR_SpawnLimit[3] = 5


Set SR_SpawnRegion[3] = MountainKingRegion <gen>


Set SR_RespawnDuration[3] = 1.00


-------- 4th unit --------


Set SR_SpawnUnit[4] = Blood Mage


Set SR_SpawnLimit[4] = 1


Set SR_SpawnRegion[4] = BloodMageRegion <gen>


Set SR_RespawnDuration[4] = 4.00


-------- 5th unit --------


Set SR_SpawnUnit[5] = Footman


Set SR_SpawnLimit[5] = 2


Set SR_SpawnRegion[5] = Player 5 Army <gen>


Set SR_RespawnDuration[5] = 10.00


-------- 6th unit --------


Set SR_SpawnUnit[6] = Knight


Set SR_SpawnLimit[6] = 1


Set SR_SpawnRegion[6] = Player 6 Army <gen>


Set SR_RespawnDuration[6] = 15.00


-------- 7th unit --------


Set SR_SpawnUnit[7] = Rifleman


Set SR_SpawnLimit[7] = 3


Set SR_SpawnRegion[7] = Player 7 Army <gen>


Set SR_RespawnDuration[7] = 7.00


-------- 8th unit --------


Set SR_SpawnUnit[8] = Mortar Team


Set SR_SpawnLimit[8] = 3


Set SR_SpawnRegion[8] = Player 8 Army <gen>


Set SR_RespawnDuration[8] = 8.00


-------- This is Player Color to match the Timer Color --------


Set SR_PlayerColor[1] = |CFFFF0303


Set SR_PlayerColor[2] = |CFF0042FF


Set SR_PlayerColor[3] = |CFF1CB619


Set SR_PlayerColor[4] = |CFF540081


Set SR_PlayerColor[5] = |CFFFFFF01


Set SR_PlayerColor[6] = |CFFFE8A0E


Set SR_PlayerColor[7] = |CFF20C000


Set SR_PlayerColor[8] = |CFFE55BB0


Set SR_PlayerColor[9] = |CFF959697


Set SR_PlayerColor[10] = |CFF7EBFF1


Set SR_PlayerColor[11] = |CFF106246


Set SR_PlayerColor[12] = |CFF4E2A04


-------- Maximum units that you have set --------


Set SR_MaxSpawnUnitType = 8


-------- DO NOT TOUCH IF YOU DON'T UNDERSTAND --------


-------- The creations of these units is optional, it's up to you how the units enter the map --------


-------- Hashtable creating for future saving data --------


Custom script: set udg_SR_Hashtable = InitHashtable()


-------- How often your timer moves per interval (to be realistic, the lower the value, the realistic it is) --------


Set SR_Interval = 0.03


Trigger - Add to SR Respawn Time <gen> the event (Time - Every SR_Interval seconds of game time)
SR Death

Events


Unit - A unit Dies

Conditions


((Triggering unit) is A structure) Equal to False

Actions


Set TempUnit = (Triggering unit)


For each (Integer LoopingInteger) from 1 to SR_MaxSpawnUnitType, do (Actions)



Loop - Actions




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






(Unit-type of TempUnit) Equal to SR_SpawnUnit[LoopingInteger]





Then - Actions






Unit Group - Add TempUnit to SR_DeadGroup






Custom script: set udg_SR_Key = GetHandleId(udg_TempUnit)






Trigger - Turn on SR Respawn Time <gen>






Hashtable - Save SR_RespawnDuration[LoopingInteger] as 0 of SR_Key in SR_Hashtable






Hashtable - Save LoopingInteger as 1 of SR_Key in SR_Hashtable






Skip remaining actions





Else - Actions
SR Respawn Time

Events

Conditions

Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(SR_DeadGroup is empty) Equal to True



Then - Actions




Trigger - Turn off (This trigger)



Else - Actions




Unit Group - Pick every unit in SR_DeadGroup and do (Actions)





Loop - Actions






Set TempUnit = (Picked unit)






Custom script: set udg_SR_Key = GetHandleId(udg_TempUnit)






Set SR_RespawnDuration[(SR_MaxSpawnUnitType + 1)] = (Load 0 of SR_Key from SR_Hashtable)






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








SR_RespawnDuration[(SR_MaxSpawnUnitType + 1)] Greater than 0.00







Then - Actions








Floating Text - Create floating text that reads (SR_PlayerColor[(Player number of (Owner of TempUnit))] + ((String(SR_RespawnDuration[(SR_MaxSpawnUnitType + 1)])) + |r)) above TempUnit with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency








Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees








Floating Text - Change (Last created floating text): Disable permanence








Floating Text - Change the lifespan of (Last created floating text) to SR_Interval seconds








Floating Text - Change the fading age of (Last created floating text) to SR_Interval seconds








Hashtable - Save (SR_RespawnDuration[(SR_MaxSpawnUnitType + 1)] - SR_Interval) as 0 of SR_Key in SR_Hashtable







Else - Actions








Set TempLoc = (Center of SR_SpawnRegion[(Load 1 of SR_Key from SR_Hashtable)])








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










(TempUnit is A Hero) Equal to True









Then - Actions










Hero - Instantly revive TempUnit at TempLoc, Show revival graphics









Else - Actions










Unit - Create 1 (Unit-type of TempUnit) for (Owner of TempUnit) at TempLoc facing Default building facing degrees








Custom script: call RemoveLocation(udg_TempLoc)








Hashtable - Clear all child hashtables of child SR_Key in SR_Hashtable








Unit Group - Remove TempUnit from SR_DeadGroup