- Joined
- Apr 16, 2010
- Messages
- 584
Hello, lately I've been working on a spell called Bouncing Ball. So when one instance of spell is finished all other stop running too, i've done almost everythin and couldn't find the solution. So if some can help, i'b be thankful.
I also attached the the test map if someone would like to test it in-game.
-
Bouncing Ball Cast
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Bouncing Ball [|c0020c000B|r]
-
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
BB_Index Equal to 0
-
-
Then - Actions
-
Trigger - Turn on Bouncing Ball Loop <gen>
-
-
Else - Actions
-
-
Set BB_Index = (BB_Index + 1)
-
Set BB_Index2 = (BB_Index2 + 1)
-
-------- Setting caster --------
-
Set BB_Caster[BB_Index2] = (Triggering unit)
-
-------- Setting Angle --------
-
Set BB_Angle[BB_Index2] = (Random real number between 0.00 and 360.00)
-
-------- Setting Distance --------
-
Set BB_Distance[BB_Index2] = (Random real number between 150.00 and 300.00)
-
-------- Setting distance when ball will change the heigh down --------
-
Set BB_Expire[BB_Index2] = BB_Distance[BB_Index2]
-
-------- Settings number of jumps --------
-
Set BB_Jumps[BB_Index2] = ((Level of Bouncing Ball [|c0020c000B|r] for BB_Caster[BB_Index2]) x 2)
-
-------- Creating ball --------
-
Unit - Create 1 Dummy for (Owner of BB_Caster[BB_Index2]) at (Position of BB_Caster[BB_Index2]) facing Default building facing degrees
-
Set BB_Dummy[BB_Index2] = (Last created unit)
-
Animation - Change BB_Dummy[BB_Index2]'s size to (300.00%, 300.00%, 300.00%) of its original size
-
Unit - Add Crow Form to BB_Dummy[BB_Index2]
-
-
-
Bouncing Ball Loop
-
Events
-
Time - Every 0.03 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer BB_Index3) from 1 to BB_Index2, do (Actions)
-
Loop - Actions
-
-------- Subtracting 5 distance from current distance to calculate when ball will fly half of all distance --------
-
Set BB_Expire[BB_Index3] = (BB_Expire[BB_Index3] - 5.00)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
BB_Expire[BB_Index3] Greater than or equal to (BB_Distance[BB_Index3] / 2.00)
-
-
Then - Actions
-
-------- Adding height till ball reaches half distance --------
-
Animation - Change BB_Dummy[BB_Index3] flying height to ((Current flying height of BB_Dummy[BB_Index3]) + 10.00) at 0.00
-
-
Else - Actions
-
-------- Subtracting height when ball reaches half distance --------
-
Animation - Change BB_Dummy[BB_Index3] flying height to ((Current flying height of BB_Dummy[BB_Index3]) - 10.00) at 0.00
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
BB_Expire[BB_Index3] Less than or equal to 0.00
-
-
Then - Actions
-
-------- Setting all settings again for next jump --------
-
Set BB_Jumps[BB_Index3] = (BB_Jumps[BB_Index3] - 1)
-
Set BB_Angle[BB_Index3] = (Random real number between 0.00 and 360.00)
-
Set BB_Distance[BB_Index3] = (Random real number between 150.00 and 300.00)
-
Set BB_Expire[BB_Index3] = BB_Distance[BB_Index3]
-
-------- Creating dummy to cast a Thunder Clap at point where ball reaches ground --------
-
Special Effect - Create a special effect at (Position of BB_Dummy[BB_Index3]) using Objects\Spawnmodels\Undead\UDeathSmall\UDeathSmall.mdl
-
Special Effect - Destroy (Last created special effect)
-
Set BB_Point[BB_Index3] = (Position of BB_Dummy[BB_Index3])
-
Unit - Create 1 Dummy 2 for (Owner of BB_Caster[BB_Index3]) at BB_Point[BB_Index3] facing Default building facing degrees
-
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
-
Unit - Add Bouncing Ball Dummy to (Last created unit)
-
Unit - Set level of Bouncing Ball Dummy for (Last created unit) to (Level of Bouncing Ball [|c0020c000B|r] for BB_Caster[BB_Index3])
-
Unit - Order (Last created unit) to Human Mountain King - Thunder Clap
-
Custom script: call RemoveLocation(udg_BB_Point[udg_BB_Index3])
-
-
Else - Actions
-
-
-------- Moving ball to next point --------
-
Set BB_Point2[BB_Index3] = ((Position of BB_Dummy[BB_Index3]) offset by 10.00 towards BB_Angle[BB_Index3] degrees)
-
Unit - Move BB_Dummy[BB_Index3] instantly to BB_Point2[BB_Index3]
-
-------- Removing leaks --------
-
Custom script: call RemoveLocation(udg_BB_Point2[udg_BB_Index3])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
BB_Jumps[BB_Index3] Equal to 0
-
-
Then - Actions
-
Unit - Remove Crow Form from BB_Dummy[BB_Index3]
-
Unit - Kill BB_Dummy[BB_Index3]
-
Set BB_Index = (BB_Index - 1)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
BB_Index Equal to 0
-
-
Then - Actions
-
Set BB_Index2 = 0
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
-
-
-
-