- Joined
- Jul 28, 2009
- Messages
- 14
So I have been trying to make an MUI Chain Spell that causes a small Thunder Clap on each unit hit, and it'll work everytime after the first 2 casts, but I want to get it to work on every cast.
The very first cast absolutely nothing happens
The second cast it hits one target and doesn't jump
My triggers are:
Concussive Thunder (Init)
The very first cast absolutely nothing happens
The second cast it hits one target and doesn't jump
My triggers are:
Concussive Thunder (Init)
-
Concussive Thunder
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Concussive Thunder
-
-
Actions
-
If (CTCastNumber Equal to 0) then do (Trigger - Turn on Concussive Thunder Loop <gen>) else do (Do nothing)
-
Set CTCastNumber = (CTCastNumber + 1)
-
Set CTSwitch = (CTSwitch + 1)
-
Set CTJumps[CTCastNumber] = 3
-
Set TempUnit = (Casting unit)
-
Set CTTargTest[TempInteger] = (Target unit of ability being cast)
-
Set TempTarget = (Target unit of ability being cast)
-
Set CTPlayer[CTCastNumber] = (Owner of TempUnit)
-
Set CTDamage[CTCastNumber] = (40.00 + (45.00 x (Real((Level of (Ability being cast) for TempUnit)))))
-
Custom script: set udg_TempUnit = null
-
-
-
Concussive Thunder Loop
-
Events
-
Time - Every 0.10 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer TempInteger) from 1 to CTCastNumber, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
CTJumps[TempInteger] Greater than 0
-
(CTTargTest[TempInteger] has buff Concussive Thunder ) Equal to True
-
-
Then - Actions
-
Set TempPoint = (Position of CTTargTest[TempInteger])
-
Unit - Create 1 Dummy for CTPlayer[TempInteger] at TempPoint facing Default building facing degrees
-
Set Dummy = (Last created unit)
-
Unit - Add Concussive Thunder (Dummy Buff Spell) to Dummy
-
Unit - Order Dummy to Human Mountain King - Thunder Clap
-
Unit - Add a 1.00 second Generic expiration timer to Dummy
-
Unit - Cause Dummy to damage CTTargTest[TempInteger], dealing CTDamage[TempInteger] damage of attack type Spells and damage type Unknown
-
Floating Text - Create floating text that reads (- + (String((Integer(CTDamage[TempInteger]))))) above CTTargTest[TempInteger] with Z offset 0.00, using font size 9.00, color (49.41%, 75.94%, 94.51%), and 0.00% transparency
-
Set TempText = (Last created floating text)
-
Floating Text - Change TempText: Disable permanence
-
Floating Text - Set the velocity of TempText to 50.00 towards 60.00 degrees
-
Floating Text - Change the lifespan of TempText to 5.00 seconds
-
Floating Text - Change the fading age of TempText to 4.00 seconds
-
Custom script: set udg_TempText = null
-
Custom script: set udg_Dummy = null
-
Special Effect - Create a special effect at TempPoint using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
-
Special Effect - Destroy (Last created special effect)
-
Set TempGroup = (Units within 312.00 of TempPoint matching (((Matching unit) belongs to an ally of CTPlayer[TempInteger]) Equal to False))
-
Unit Group - Pick every unit in TempGroup and do (Actions)
-
Loop - Actions
-
Set TempUnit = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(TempUnit is A structure) Equal to True
-
(TempUnit is dead) Equal to True
-
(TempUnit is Mechanical) Equal to True
-
(TempUnit has buff Concussive Thunder ) Equal to True
-
-
-
-
Then - Actions
-
Unit Group - Remove TempUnit from TempGroup
-
-
Else - Actions
-
-
Custom script: set udg_TempUnit = null
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in TempGroup) Greater than 0
-
-
Then - Actions
-
Set CTDamage[TempInteger] = (CTDamage[TempInteger] - (CTDamage[TempInteger] x 0.10))
-
Set TempTarget = (Random unit from TempGroup)
-
Unit - Create 1 Dummy for CTPlayer[TempInteger] at TempPoint facing Default building facing degrees
-
Set Dummy = (Last created unit)
-
Unit - Add Concussive Thunder (Dummy Ability) to Dummy
-
Unit - Order Dummy to Neutral - Firebolt TempTarget
-
Unit - Add a 1.00 second Generic expiration timer to Dummy
-
Custom script: set udg_Dummy = null
-
Custom script: set udg_CTTargTest[udg_TempInteger] = null
-
Set CTTargTest[TempInteger] = TempTarget
-
Custom script: set udg_TempTarget = null
-
Custom script: set udg_Dummy = null
-
Set CTJumps[TempInteger] = (CTJumps[TempInteger] - 1)
-
-
Else - Actions
-
Set CTJumps[TempInteger] = 0
-
Custom script: set udg_CTTargTest[udg_TempInteger] = null
-
-
-
Unit Group - Remove all units from TempGroup
-
Custom script: call RemoveLocation(udg_TempPoint)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
CTJumps[TempInteger] Less than or equal to 0
-
-
Then - Actions
-
Wait until ((CTTargTest[TempInteger] has buff Concussive Thunder ) Equal to True), checking every 0.10 seconds
-
Unit - Create 1 Dummy for CTPlayer[TempInteger] at TempPoint facing Default building facing degrees
-
Set Dummy = (Last created unit)
-
Unit - Add Concussive Thunder (Dummy Buff Spell) to Dummy
-
Unit - Order Dummy to Human Mountain King - Thunder Clap
-
Unit - Add a 1.00 second Generic expiration timer to Dummy
-
Unit - Cause Dummy to damage CTTargTest[TempInteger], dealing CTDamage[TempInteger] damage of attack type Spells and damage type Unknown
-
Floating Text - Create floating text that reads (- + (String((Integer(CTDamage[TempInteger]))))) above CTTargTest[TempInteger] with Z offset 0.00, using font size 9.00, color (49.41%, 75.94%, 94.51%), and 0.00% transparency
-
Set TempText = (Last created floating text)
-
Floating Text - Change TempText: Disable permanence
-
Floating Text - Set the velocity of TempText to 50.00 towards 60.00 degrees
-
Floating Text - Change the fading age of TempText to 4.00 seconds
-
Custom script: set udg_Dummy = null
-
Custom script: set udg_TempText = null
-
Custom script: set udg_CTPlayer[udg_TempInteger] = null
-
Custom script: set udg_CTTargTest[udg_TempInteger] = null
-
Floating Text - Change the lifespan of TempText to 5.00 seconds
-
Set CTSwitch = (CTSwitch - 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
CTSwitch Less than or equal to 0
-
-
Then - Actions
-
Set CTCastNumber = 0
-
Set CTSwitch = 0
-
-
Else - Actions
-
-
-
Else - Actions
-
-
-
Else - Actions
-
-
-
-
-