Moderator
M
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
(0 ratings)
Approved
trigger "init"

Events


Map initialization

Conditions

Actions


Hashtable - Create a hashtable


Set Hashtable = (Last created hashtable)
trigger "Damage Source"

Events


Time - Every 0.03 seconds of game time

Conditions

Actions


Set Group = (Units in (Playable map area) matching ((Life of (Matching unit)) Not equal to (Load (Key life) of (Key (Matching unit)) from Hashtable)))


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



If - Conditions




(Number of units in Group) Greater than 0



Then - Actions




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





Loop - Actions






Set Real = (Load (Key life) of (Key (Picked unit)) from Hashtable)






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







If - Conditions








(Life of (Picked unit)) Less than Real







Then - Actions








Set Real = (Real - (Life of (Picked unit)))








Set Point = (Position of (Picked unit))








Floating Text - Create floating text that reads (String(Real)) at Point with Z offset 0.00, using font size 9.00, color (100.00%, 10.00%, 10.00%), and 10.00% transparency








Floating Text - Set the velocity of (Last created floating text) to 84.00 towards 90.00 degrees








Floating Text - Change (Last created floating text): Disable suspend state








Floating Text - Change (Last created floating text): Disable permanence








Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds








Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds








Custom script: call RemoveLocation(udg_Point)








Hashtable - Save (Life of (Picked unit)) as (Key life) of (Key (Picked unit)) in Hashtable







Else - Actions








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









If - Conditions










(Life of (Picked unit)) Greater than Real









Then - Actions










Hashtable - Save (Life of (Picked unit)) as (Key life) of (Key (Picked unit)) in Hashtable









Else - Actions



Else - Actions


Custom script: call DestroyGroup(udg_Group)
I hope nobody uploaded similar function like this.
however something like this would be perfect if the unit takes damage event did not exist
no point in running the trigger if there are no units being damaged
no point checking every unit on the map if they are damaged or not
however something like this would be perfect if the unit takes damage event did not exist
Unit takes damage works only for units you can sellect in editor,
this function works for every units in the map. (trigger created, summoned etc.)
And this system is easy and not that lagy as you think.
For maps where are not such lot of units its good in my opinion.
And also good for trigger beginners.
Events

Real - GDDSomething becomes equal to 1.00
That thing you'r saying, is possible only if the two spells are casted on the same target before 0.03 seconds, which is almost impossible.
I also tryed to attack with big amout of units to the same target at once, the system detected every damage.
That thing you'r saying, is possible only if the two spells are casted on the same target before 0.03 seconds, which is almost impossible.
I also tryed to attack with big amout of units to the same target at once, the system detected every damage.
struct Test extends array
private static method onDamage takes nothing returns nothing
endmethod
implement DDS
endstruct
