ini

Events


Map initialization

Conditions

Actions


Set Gravity = -2.50


Set Friction = -1.50


Set XBountry = 3300.00


Set YBountry = 3300.00
Momentum loop

Events


Time - Every 0.03 seconds of game time

Conditions

Actions


Unit Group - Pick every unit in MomentumGroup and do (Actions)



Loop - Actions




Set Cus = (Custom value of (Picked unit))




Set Temp_Point = (Position of UDexUnits[Cus])




Set XCur = (X of Temp_Point)




Set YCur = (Y of Temp_Point)




Custom script: if RAbsBJ(udg_XCur) > udg_XBountry then




Set XVel[Cus] = (XVel[Cus] x -1.00)




Custom script: endif




Custom script: if RAbsBJ(udg_YCur) > udg_YBountry then




Set YVel[Cus] = (YVel[Cus] x -1.00)




Custom script: endif




Set ZCur = (Current flying height of UDexUnits[Cus])




Custom script: set udg_ZGround = GetLocationZ(udg_Temp_Point)




Custom script: call RemoveLocation(udg_Temp_Point)




Custom script: call SetUnitX(udg_UDexUnits[udg_Cus],udg_XCur + udg_XVel[udg_Cus])




Custom script: call SetUnitY(udg_UDexUnits[udg_Cus],udg_YCur + udg_YVel[udg_Cus])




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





If - Conditions






ZCur Less than 1.00






ZVel[Cus] Less than or equal to 0.00





Then - Actions






Custom script: if udg_ZVel[udg_Cus] < 0 then






Set LandPoint = (Position of UDexUnits[Cus])






Special Effect - Destroy LeapSFX[Cus]






Custom script: call DestroyEffect(AddSpecialEffectLoc( udg_LandSFX[udg_Cus],udg_LandPoint))






Set ZVel[Cus] = (ZVel[Cus] x -1.00)






Set LandEvent = 1.00






Set LandEvent = 0.00






Custom script: call RemoveLocation(udg_LandPoint)






Set ZVel[Cus] = 0.00






Custom script: endif






Custom script: set udg_XVel[udg_Cus] = udg_XVel[udg_Cus] + (udg_Friction / (RAbsBJ(udg_XVel[udg_Cus]) + RAbsBJ(udg_YVel[udg_Cus]))) * udg_XVel[udg_Cus]






Custom script: set udg_YVel[udg_Cus] = udg_YVel[udg_Cus] + (udg_Friction / (RAbsBJ(udg_XVel[udg_Cus]) + RAbsBJ(udg_YVel[udg_Cus]))) * udg_YVel[udg_Cus]






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







If - Conditions








(Abs(XVel[Cus])) Less than 1.00








(Abs(YVel[Cus])) Less than 1.00







Then - Actions








Set XVel[Cus] = 0.00








Set YVel[Cus] = 0.00








Unit Group - Remove UDexUnits[Cus] from MomentumGroup








Custom script: if CountUnitsInGroup(udg_MomentumGroup) == 0 then








Trigger - Turn off (This trigger)








Custom script: endif







Else - Actions





Else - Actions






Set Temp_Point = (Point((XCur + XVel[Cus]), (YCur + YVel[Cus])))






Custom script: set udg_LocDiffirence = GetLocationZ(udg_Temp_Point)






Custom script: call RemoveLocation(udg_Temp_Point)






Custom script: call SetUnitZ(udg_UDexUnits[udg_Cus], udg_ZCur + udg_ZVel[udg_Cus] + udg_ZGround - udg_LocDiffirence)






Set ZVel[Cus] = (ZVel[Cus] + Gravity)
Example

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Leap

Actions


Custom script: if CountUnitsInGroup(udg_MomentumGroup) == 0 then


Trigger - Turn on Momentum loop <gen>


Custom script: endif


Set Cus = (Custom value of (Triggering unit))


Unit Group - Add UDexUnits[Cus] to MomentumGroup


-------- Let the Land event trigger know what ability are we dealing with --------


Set LeapType[Cus] = Leap


-------- - --------


-------- The following is used to calculate xyz --------


Set CastPoint = (Position of UDexUnits[Cus])


Set TargetPoint = (Target point of ability being cast)


Set Distance = (Distance between CastPoint and TargetPoint)


-------- - --------


-------- Here you set the amount of momentum... This equation must be ajusted if you change the gravity to ensure that the unit land on the target point accuratly --------


Set XVel[Cus] = (XVel[Cus] + (((Square root(Distance)) / 1.40) x (Cos((Angle from CastPoint to TargetPoint)))))


Set YVel[Cus] = (YVel[Cus] + (((Square root(Distance)) / 1.40) x (Sin((Angle from CastPoint to TargetPoint)))))


Set ZVel[Cus] = (2.00 x ((Abs(XVel[Cus])) + (Abs(YVel[Cus]))))


-------- The Z value may be a fixed value. Just remember to ajust the X and Y --------


-------- - --------


Custom script: call RemoveLocation(udg_TargetPoint)


Special Effect - Destroy LeapSFX[Cus]


-------- Configurate landing special effect --------


Special Effect - Create a special effect attached to the orign of UDexUnits[Cus] using Abilities\Weapons\ProcMissile\ProcMissile.mdl


-------- - --------


Set LeapSFX[Cus] = (Last created special effect)


-------- More Configuratables --------


Set LandSFX[Cus] = Abilities\Spells\Human\FlakCannons\FlakTarget.mdl


Set LeapDamageSource[Cus] = UDexUnits[Cus]


Set LeapDamageAmount[Cus] = 300.00


Set LeapDamageAoE[Cus] = 300.00
Land Event

Events


Game - LandEvent becomes Equal to 1.00

Conditions

Actions


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



If - Conditions




LeapType[Cus] Equal to Leap



Then - Actions




Custom script: call DestroyEffect(AddSpecialEffectLocBJ( udg_LandPoint, "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" ))




Unit Group - Pick every unit in (Units within LeapDamageAoE[Cus] of LandPoint matching (((Owner of (Matching unit)) is an enemy of (Owner of LeapDamageSource[Cus])) Equal to True)) and do (Actions)





Loop - Actions






Unit - Cause LeapDamageSource[Cus] to damage (Picked unit), dealing (5.00 x ZVel[Cus]) damage of attack type Spells and damage type Normal




Custom script: call DestroyGroup(GetLastCreatedGroup())



Else - Actions