TPOX
New Member
- Reaction score
- 10
I made a battle charge a while back that basically increases your movement speed and dmgs the unit but im wondering if this may have any bugs or may mess up somehow if it was in a dota type map. Like any suggestions or variables ect to edit to prevent any bugs. The movement speed is supposed to stop if you click elsewhere while charging, until you reach the target, or after 7 seconds or whatever.
Code:
Battle Charge
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Battle Charge
Actions
Set TempReal = 0.00
Set TargetUnitOfAbilityBeingCast = (Target unit of ability being cast)
Set CastingUnitPoint = (Position of (Casting unit))
Unit - Set (Casting unit) movement speed to 800.00
Unit - Order (Casting unit) to Attack TargetUnitOfAbilityBeingCast
Set Wait = (Create a periodic One-shot timer lasting 7.00)
Wait until (((Integer((Distance between (Position of (Casting unit)) and (Position of TargetUnitOfAbilityBeingCast)))) Less than or equal to 200) or (((Current order of (Casting unit)) Equal to (Order(smart))) or ((Integer((Remaining time for Wait))) Equal to 0))), checking every 1.00 seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Integer((Distance between (Position of (Casting unit)) and (Position of TargetUnitOfAbilityBeingCast)))) Less than or equal to 200
Then - Actions
Unit - Set mana of (Casting unit) to ((Mana of (Casting unit)) + (10.00 x (Real((Level of Battle Charge for (Casting unit))))))
Unit - Set (Casting unit) movement speed to (Default movement speed of (Casting unit))
Unit - Order (Casting unit) to damage TargetUnitOfAbilityBeingCast for (1.00 x (Distance between CastingUnitPoint and (Position of TargetUnitOfAbilityBeingCast))) using attack type Normal and damage type Universal.
Set TempReal = (Real((1 x (Integer((Distance between CastingUnitPoint and (Position of TargetUnitOfAbilityBeingCast)))))))
Unit - Create 1 Peasant for (Owner of (Casting unit)) at (Position of TargetUnitOfAbilityBeingCast) facing (Position of TargetUnitOfAbilityBeingCast)
Unit - Set Level of Charge Stun (Dummy Spell) for (Last created unit) to (1 x (Level of Battle Charge for (Casting unit)))
Unit - Order (Last created unit) to Neutral - Firebolt TargetUnitOfAbilityBeingCast
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Floating Text - Create floating text that reads ((|cffFFFF00 + (String((Integer(TempReal))))) + ( Damage + <Empty String>)) at (Position of (Casting unit)) with Z offset 0.00, using font size 12.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Set TempFloatText = (Last created floating text)
Wait 3.00 seconds
Floating Text - Destroy (Last created floating text)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Current order of (Casting unit)) Equal to (Order(smart))
Then - Actions
Unit - Set (Casting unit) movement speed to (Default movement speed of (Casting unit))
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Integer((Remaining time for Wait))) Equal to 0
Then - Actions
Unit - Set (Casting unit) movement speed to (Default movement speed of (Casting unit))
Else - Actions
Do nothing


