Moderator
M
Moderator
21:51, 16th Jun 2010
Hanky:
Fine enough.
Hanky:
Fine enough.
Events

Unit - A unit Starts the effect of an ability
Conditions

(Ability being cast) Equal to Sprint
Actions

Set Sprint_Max = (Sprint_Max + 1)

-------- Caster --------

Set Sprint_Unit[Sprint_Max] = (Triggering unit)

-------- Bonus Speed --------

-------- If you want to increase it even more you should consider to change the event of the SprintLoop trigger from 0.03 to 0.02 or even 0.01 cause else it will look choppy --------

Set Sprint_Data[(Sprint_Max x 10)] = 20.00

-------- Current facing angle (don't change this) --------

Set Sprint_Data[((Sprint_Max x 10) + 1)] = (Facing of (Triggering unit))

-------- Damage --------

Set Sprint_Data[((Sprint_Max x 10) + 2)] = (Real((((Level of (Ability being cast) for (Triggering unit)) x 50) + 50)))

-------- Bash Distance --------

Set Sprint_Data[((Sprint_Max x 10) + 3)] = 300.00

-------- Is this unit a caster? (-1 if yes, don't change this) --------

Set Sprint_Data[((Sprint_Max x 10) + 4)] = -1.00

-------- Bash speed --------

Set Sprint_Data[((Sprint_Max x 10) + 5)] = 20.00

-------- Don't change this --------

Set Sprint_Data[((Sprint_Max x 10) + 6)] = 0.00

-------- Don't change this --------

Set Sprint_Data[((Sprint_Max x 10) + 7)] = 0.00

-------- Start sfx count (don't change this) --------

Set Sprint_Data[((Sprint_Max x 10) + 8)] = 0.00

-------- Special effects every x executions of the loop trigger --------

Set Sprint_Data[((Sprint_Max x 10) + 9)] = 4.00

-------- Run the loop trigger (don't change this) --------

Trigger - Turn on SprintLoop <gen>

-------- You may move this to your ini section as well --------

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


If - Conditions



cane Equal to No item


Then - Actions



Set loc = (Point(0.00, 0.00))



Item - Create Cheese at loc



Item - Hide (Last created item)



Set cane = (Last created item)



Item - Create Cheese at loc



Item - Hide (Last created item)



Set cane2 = (Last created item)



Set pathregion = (Region centered at loc with size (64.00, 64.00))



Custom script: call RemoveLocation(udg_loc)


Else - Actions
Events

Time - Every 0.03 seconds of game time
Conditions
Actions

-------- DON'T CHANGE ANYTHING BELOW UNLESS YOU KNOW WHAT YOU ARE DOING! (except the special effect and the angle difference, they are marked with lots of dots) --------

For each (Integer i) from 1 to Sprint_Max, do (Actions)


Loop - Actions



-------- r is used to store the speed --------



Set r = -1.00



-------- u is used to store the unit cause it is faster and easier to use a non-array variable for things --------



Set u = Sprint_Unit[i]



-------- Decide if the unit is a caster or a target --------



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




If - Conditions





Sprint_Data[((i x 10) + 4)] Equal to -1.00




Then - Actions





Set a = (Facing of u)





-------- If the unit has the sprint buff it will be made faster --------





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






If - Conditions







(u has buff Sprint ) Equal to True






Then - Actions







-------- Check order and angle difference --------







-------- If the difference between the last facing angle and the current one is quite small it is save to increase the unit's speed --------







-------- Change the value if you think a different one will fit better --------







-------- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: --------







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








If - Conditions









(Current order of u) Equal to (Order(smart))









(Abs((a - Sprint_Data[((i x 10) + 1)]))) Less than 3.00








Then - Actions









-------- Set r to bash speed --------









Set r = Sprint_Data[(i x 10)]









Set loc = (Position of u)









Custom script: set bj_wantDestroyGroup = true









-------- Smash away all units in range --------









Unit Group - Pick every unit in (Units within 180.00 of loc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is A flying unit) Equal to False) and (((Life of (Matching unit)) Greater than 0.00) and ((((Matching unit) belongs to an enemy of (Owner of u)) Equ and do (Actions)










Loop - Actions











Unit - Cause u to damage (Picked unit), dealing Sprint_Data[((i x 10) + 2)] damage of attack type Spells and damage type Normal











Set loc2 = (Position of (Picked unit))











Set Sprint_Max = (Sprint_Max + 1)











Set Sprint_Unit[Sprint_Max] = (Picked unit)











Set Sprint_Data[((Sprint_Max x 10) + 4)] = (Angle from loc to loc2)











Set Sprint_Data[((Sprint_Max x 10) + 5)] = Sprint_Data[((i x 10) + 5)]











Set Sprint_Data[((Sprint_Max x 10) + 6)] = 0.00











Set Sprint_Data[((Sprint_Max x 10) + 7)] = Sprint_Data[((i x 10) + 3)]











Set Sprint_Data[((Sprint_Max x 10) + 8)] = 0.00











Set Sprint_Data[((Sprint_Max x 10) + 9)] = Sprint_Data[((i x 10) + 9)]











Unit Group - Add (Picked unit) to Sprint_Target_Group











Custom script: call RemoveLocation(udg_loc2)









Custom script: call RemoveLocation(udg_loc)








Else - Actions







-------- Save new old facing angle --------







Set Sprint_Data[((i x 10) + 1)] = a






Else - Actions







-------- Shift data --------







Set Sprint_Unit[i] = Sprint_Unit[Sprint_Max]







For each (Integer i2) from 0 to 9, do (Actions)








Loop - Actions









Set Sprint_Data[((i x 10) + i2)] = Sprint_Data[((Sprint_Max x 10) + i2)]







Set Sprint_Max = (Sprint_Max - 1)







Set i = (i - 1)




Else - Actions





-------- Increase bash distance --------





Set Sprint_Data[((i x 10) + 6)] = (Sprint_Data[((i x 10) + 6)] + Sprint_Data[((i x 10) + 5)])





-------- Check if the bash is not over yet --------





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






If - Conditions







Sprint_Data[((i x 10) + 6)] Less than Sprint_Data[((i x 10) + 7)]






Then - Actions







-------- Set bash angle and speed --------







Set a = Sprint_Data[((i x 10) + 4)]







Set r = Sprint_Data[((i x 10) + 5)]






Else - Actions







-------- Shift data --------







Unit Group - Remove u from Sprint_Target_Group







Set Sprint_Unit[i] = Sprint_Unit[Sprint_Max]







For each (Integer i2) from 0 to 9, do (Actions)








Loop - Actions









Set Sprint_Data[((i x 10) + i2)] = Sprint_Data[((Sprint_Max x 10) + i2)]







Set Sprint_Max = (Sprint_Max - 1)







Set i = (i - 1)



-------- If the unit is either a running caster or a bash target move them --------



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




If - Conditions





r Not equal to -1.00




Then - Actions





-------- Calculate new position based on speed and angle --------





Custom script: set udg_x = GetUnitX(udg_u)





Custom script: set udg_y = GetUnitY(udg_u)





Set x = (x + (r x (Cos(a))))





Set y = (y + (r x (Sin(a))))





-------- Pathchecking --------





-------- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --------





Custom script: call MoveRectTo(udg_pathregion, udg_x, udg_y)





Item - Pick every item in pathregion and do (Actions)






Loop - Actions







Item - Hide (Picked item)





Custom script: call SetItemPosition(udg_cane, udg_x, udg_y)





Custom script: call SetItemPosition(udg_cane2, udg_x, udg_y)





Item - Pick every item in pathregion and do (Actions)






Loop - Actions







Item - Show (Picked item)





Item - Hide cane





Item - Hide cane2





Custom script: if RectContainsCoords(bj_mapInitialPlayableArea, udg_x, udg_y)and udg_x==GetWidgetX(udg_cane)and udg_y==GetWidgetY(udg_cane)and(udg_x!=GetWidgetX(udg_cane2)or udg_y!=GetWidgetY(udg_cane2))then





-------- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --------





-------- Moving unit --------





Custom script: call SetUnitX(udg_u, udg_x)





Custom script: call SetUnitY(udg_u, udg_y)





Custom script: endif





-------- Creating special effects --------





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






If - Conditions







Sprint_Data[((i x 10) + 8)] Equal to Sprint_Data[((i x 10) + 9)]






Then - Actions







Set Sprint_Data[((i x 10) + 8)] = 0.00







-------- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: --------







-------- Change path to desired special effect path --------







Special Effect - Create a special effect attached to the origin of u using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl







Special Effect - Destroy (Last created special effect)






Else - Actions







Set Sprint_Data[((i x 10) + 8)] = (Sprint_Data[((i x 10) + 8)] + 1.00)




Else - Actions

-------- Turn off if nothing is running --------

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


If - Conditions



Sprint_Max Less than 1


Then - Actions



Trigger - Turn off (This trigger)


Else - Actions