Moderator
M
Bouncing Ball Settings

Events


Map initialization

Conditions

Actions


-------- Setting ability --------


Set BB_Ability = Bouncing Ball [|c0020c000B|r]


-------- Setting effect when ball strikes the ground --------


Set BB_SpecialEffect = Objects\Spawnmodels\Undead\UDeathSmall\UDeathSmall.mdl
Bouncing Ball Cast

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to BB_Ability

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 Speed of ball --------


Set BB_Speed[BB_Index2] = 10.00


-------- Setting Distance --------


Set BB_Distance[BB_Index2] = (Random real number between 150.00 and 300.00)


-------- Setting Maximum Height --------


Set BB_MaxHeight[BB_Index2] = (Random real number between 150.00 and 300.00)


-------- Setting next value as counter to count when ball will finish flying --------


Set BB_Expire[BB_Index2] = BB_Distance[BB_Index2]


-------- Settings number of jumps --------


Set BB_Jumps[BB_Index2] = ((Level of BB_Ability for BB_Caster[BB_Index2]) x 2)


-------- Creating ball --------


Set BB_Point = (Position of BB_Caster[BB_Index2])


Unit - Create 1 Dummy for (Owner of BB_Caster[BB_Index2]) at BB_Point 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]


Custom script: call RemoveLocation(udg_BB_Point)
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




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





If - Conditions






BB_Index3 Not equal to 0





Then - Actions






Set BB_Expire[BB_Index3] = (BB_Expire[BB_Index3] - BB_Speed[BB_Index3])






Set BB_CurrentDistance[BB_Index3] = (BB_CurrentDistance[BB_Index3] + BB_Speed[BB_Index3])






-------- Crearing another variables for parabola --------






Set BB_Real[1] = BB_MaxHeight[BB_Index3]






Set BB_Real[2] = BB_Distance[BB_Index3]






Set BB_Real[3] = BB_CurrentDistance[BB_Index3]






-------- Parabola --------






Custom script: set udg_BB_Real[4] = ( 4 * udg_BB_Real[1] / udg_BB_Real[2]) * ( udg_BB_Real[2] - udg_BB_Real[3]) * ( udg_BB_Real[3] / udg_BB_Real[2] )






-------- Changing Height --------






Animation - Change BB_Dummy[BB_Index3] flying height to BB_Real[4] at 0.00





Else - Actions




Set BB_Point3 = (Position of BB_Dummy[BB_Index3])




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]






Set BB_CurrentDistance[BB_Index3] = 0.00






-------- Creating dummy to cast a Thunder Clap at point where ball reaches ground --------






Special Effect - Create a special effect at BB_Point3 using BB_SpecialEffect






Special Effect - Destroy (Last created special effect)






Unit - Create 1 Dummy 2 for (Owner of BB_Caster[BB_Index3]) at BB_Point3 facing Default building facing degrees






Unit - Add a 0.50 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 BB_Ability for BB_Caster[BB_Index3])






Unit - Order (Last created unit) to Human Mountain King - Thunder Clap






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 BB_Dummy[BB_Index3] from the game








Set BB_Dummy[BB_Index3] = No unit








Set BB_Index = (BB_Index - 1)








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







Else - Actions





Else - Actions






-------- Moving ball to next point --------






Set BB_Point2 = (BB_Point3 offset by BB_Speed[BB_Index3] towards BB_Angle[BB_Index3] degrees)






Unit - Move BB_Dummy[BB_Index3] instantly to BB_Point2






-------- Removing leaks --------






Custom script: call RemoveLocation(udg_BB_Point2)






Custom script: call RemoveLocation(udg_BB_Point3)