- Joined
- Apr 10, 2007
- Messages
- 23
I made a Snippet for Casting Time:
It creates the Time a Spell is casting At the heroes location.
it is leakless and MPI.
enjoy!
Code:
It creates the Time a Spell is casting At the heroes location.
it is leakless and MPI.
enjoy!
Code:
-
Let Unit Cast
-
Events
- Unit - A unit Begins casting an ability
- Unit - A unit Begins channeling an ability
- Conditions
-
Actions
- Set Casting[(Player number of (Owner of (Casting unit)))] = 0.00
- Set Casting_Unit_Loc[(Player number of (Owner of (Casting unit)))] = (Position of (Casting unit))
- Set Casting_Time[(Player number of (Owner of (Casting unit)))] = True
-
Events
-
Casting Time
-
Events
- Time - Every 0.01 seconds of game time
- Conditions
-
Actions
-
For each (Integer A) from 1 to 12, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Casting_Time[(Integer A)] Equal to True
-
Then - Actions
- Set Casting[(Integer A)] = (Casting[(Integer A)] + 0.01)
- Floating Text - Destroy Casting_Floating_Text[(Integer A)]
- Floating Text - Create floating text that reads (Casting Time: + (String(Casting[(Integer A)]))) at Casting_Unit_Loc[(Integer A)] with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
- Set Casting_Floating_Text[(Integer A)] = (Last created floating text)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer A) from 1 to 12, do (Actions)
-
Events
-
Stop Unit Cast
-
Events
- Unit - A unit Stops casting an ability
- Unit - A unit Finishes casting an ability
- Conditions
-
Actions
- Set Casting_Time[(Player number of (Owner of (Casting unit)))] = False
- Floating Text - Destroy Casting_Floating_Text[(Player number of (Owner of (Casting unit)))]
-
For each (Integer A) from 1 to 12, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Owner of (Casting unit)) Equal to (Player((Integer A)))
-
Then - Actions
- Custom script: call RemoveLocation (udg_Casting_Unit_Loc[GetForLoopIndexA()])
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Events
Attachments
Last edited by a moderator: