- Joined
- Sep 10, 2006
- Messages
- 185
I'm making it so when a unit is attacked by a lightning rod, it has around 8% chance to be stunned for 1 second. The position the unit is being sent to is just for testing atm. The FX are destroyed, but nothing is displayed and the unit does not move.
help appreciated
help appreciated
-
Lightning Rod
-
Events
- Unit - A unit Is attacked
-
Conditions
- (Unit-type of (Attacking unit)) Equal to |c00ffff00Lightning Rod (1)
-
Actions
- -------- Locals --------
- Custom script: local unit udg_LightningRodUnit
- Custom script: local effect udg_LightningRodEffect
- Custom script: local location udg_LightningRodPos
- -------- --------
- Set LightningRodUnit = (Attacked unit)
- Set LightningRodInt = (Random integer number between 1 and 12)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- LightningRodInt Equal to 1
-
Then - Actions
- Unit - Pause LightningRodUnit
- Special Effect - Create a special effect attached to the overhead of LightningRodUnit using Abilities\Spells\Human\Thunderclap\ThunderclapTarget.mdl
- Set LightningRodEffect = (Last created special effect)
- Wait 1.00 seconds
- Unit - Unpause LightningRodUnit
- Unit - Order LightningRodUnit to Move To (Center of (Playable map area))
- Game - Display to (All players) the text: (Name of LightningRodUnit)
- Special Effect - Destroy LightningRodEffect
- Custom script: call RemoveLocation(udg_LightningRodPos)
- Else - Actions
-
If - Conditions
- Custom script: set udg_LightningRodUnit = null
-
Events