Genkora
Frog blast the vent core!
- Reaction score
- 92
This trigger of mine causes a tower to cast a spell when its mana reaches 100. It is passive, and for the most part it works rather well. However, it sometimes does not work, because the unit stored in my unit variable either does not exist or is out of range (Out of range of the 800 in the unit group "Random", the spell itself has a very very long range), but this is a rare occurrence. I know that is sometimes is referencing an incorrect unit because I have it set up to state the name of whatever unit is Runit.
Trigger:
- Activate spells
- Events
- Time - Every 2.00 seconds of game time
- Conditions
- Actions
- Set Sgroup = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Charge Tower))
- Unit Group - Pick every unit in Sgroup and do (Actions)
- Loop - Actions
- Set Cpoint = (Position of (Picked unit))
- Set Random = (Units within 800.00 of Cpoint matching (((Unit-type of (Matching unit)) Not equal to Dummy) and (((Unit-type of (Matching unit)) Not equal to Missile Guy) and (((Unit-type of (Matching unit)) Not equal to Charge Tower) and (((Unit-type of (Matching unit)) No
- Set Runit = (Random unit from Random)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Mana of (Picked unit)) Greater than or equal to 100.00
- (Level of Frenzy Fire (passive) for (Picked unit)) Greater than 0
- (Number of units in Random) Greater than 0
- Then - Actions
- Unit - Create 1 Dummy for Neutral Passive at Cpoint facing Default building facing degrees
- Unit - Add a 6.00 second Generic expiration timer to (Last created unit)
- Unit - Order (Last created unit) to Undead Banshee - Curse Runit
- If ((Level of Frenzy Fire (real) for (Picked unit)) Equal to 1) then do (Unit Group - Add Runit to FFire1) else do (Do nothing)
- If ((Level of Frenzy Fire (real) for (Picked unit)) Equal to 2) then do (Unit Group - Add Runit to FFire2) else do (Do nothing)
- If ((Level of Frenzy Fire (real) for (Picked unit)) Equal to 3) then do (Unit Group - Add Runit to FFire3) else do (Do nothing)
- Game - Display to (All players) the text: (Name of Runit)
- If ((Level of Frenzy Fire (real) for (Picked unit)) Equal to 3) then do (Do nothing) else do (Unit - Increase level of Frenzy Fire (real) for (Picked unit))
- Unit - Increase level of Frenzy Fire (passive) for (Picked unit)
- Unit - Set mana of (Picked unit) to 0.00
- Unit - Create 1 Missile Guy for Neutral Passive at Cpoint facing Default building facing degrees
- Unit - Add a 6.00 second Generic expiration timer to (Last created unit)
- Unit - Order (Last created unit) to Neutral Alchemist - Acid Bomb Runit
- Custom script: call DestroyGroup (udg_Random)
- Game - Display to (All players) the text: (String((Number of units in Random)))
- Else - Actions
- If - Conditions
- Custom script: call RemoveLocation (udg_Cpoint)
- Loop - Actions
- Custom script: call DestroyGroup (udg_Sgroup)
- Events