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.
Melee Initialization

Events


Map initialization

Conditions

Actions


Custom script: set udg_DamageHash = InitHashtable()


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


-------- The copies of each unit type that you want to detect the damage of --------


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


Set Dummies[0] = Paladin - (str)


Set Dummies[1] = Blademaster - (agi)


Set Dummies[2] = Blood Mage - (int)


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


-------- The target dummy's unit type --------


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


Set Dummies[100] = Paladin - (target)


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


-------- Unit types of units whose damage you want to detect --------


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


Set DamageAttackers[0] = Paladin


Set DamageAttackers[1] = Blademaster


Set DamageAttackers[2] = Blood Mage


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


-------- The coordinates of the spawn point of the dummy and attackers --------


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


Set SpawnCoordinates[0] = 0.00


Set SpawnCoordinates[1] = 0.00


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


-------- How many attackers per target are created --------


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


Set SpawnAmount = 8


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


-------- How many hit to get the damage amount --------


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


Set DamageHits = 100


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


-------- The max index of Dummies and DamageAttackers --------


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


Set DamageUnitTypes = 2
AcquireLose Items

Events


Unit - A unit Acquires an item


Unit - A unit Loses an item

Conditions


(Unit-type of (Triggering unit)) Not equal to Paladin - (str)


(Unit-type of (Triggering unit)) Not equal to Blademaster - (agi)


(Unit-type of (Triggering unit)) Not equal to Blood Mage - (int)

Actions


Set u1 = (Triggering unit)


Custom script: set udg_i1 = GetHandleId(udg_u1)


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


For each (Integer loopA) from 1 to SpawnAmount, do (Actions)



Loop - Actions




Custom script: set udg_u3 = LoadUnitHandle( udg_DamageHash , udg_i1 , udg_loopA )




Unit - Remove u3 from the game


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


Wait 0.00 seconds


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


Set u1 = (Triggering unit)


Custom script: set udg_i1 = GetHandleId(udg_u1)


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


Custom script: set udg_u2 = LoadUnitHandle( udg_DamageHash , udg_i1 , StringHash("dummy") )


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


Custom script: call SaveInteger(udg_DamageHash , udg_i1 , StringHash("hits") , 0 )


Custom script: call SaveReal(udg_DamageHash , udg_i1 , StringHash("TempMax") , 0 )


Custom script: call SaveReal(udg_DamageHash , udg_i1 , StringHash("TempMin") , 100000 )


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


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



If - Conditions




u2 Equal to No unit



Then - Actions




Custom script: set udg_u2 = CreateUnit( Player(15) , udg_Dummies[100] , udg_SpawnCoordinates[0] , udg_SpawnCoordinates[1] , 0 )




Custom script: call SaveUnitHandle( udg_DamageHash , GetHandleId(udg_u2) , StringHash("owner") , udg_u1 )




Custom script: call SaveUnitHandle( udg_DamageHash , udg_i1 , StringHash("dummy") , udg_u2 )




Custom script: call TriggerRegisterUnitEvent( gg_trg_Detect_Damage, udg_u2, EVENT_UNIT_DAMAGED )



Else - Actions




Unit - Unhide u2


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


For each (Integer loopC) from 0 to DamageUnitTypes, do (Actions)



Loop - Actions




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





If - Conditions






(Unit-type of u1) Equal to DamageAttackers[loopC]





Then - Actions






Set UnitType = Dummies[loopC]






For each (Integer loopA) from 1 to SpawnAmount, do (Actions)







Loop - Actions








Custom script: set udg_u3 = CreateUnit( Player(15) , udg_UnitType , udg_SpawnCoordinates[0] , udg_SpawnCoordinates[1] , 0 )








Hero - Set u3 Hero-level to (Level of u1), Hide level-up graphics








Hero - Modify Strength of u3: Set to (Strength of u1 (Exclude bonuses))








Hero - Modify Agility of u3: Set to (Agility of u1 (Exclude bonuses))








Hero - Modify Intelligence of u3: Set to (Intelligence of u1 (Exclude bonuses))








For each (Integer loopB) from 1 to 6, do (Actions)









Loop - Actions










Hero - Create (Item-type of (Item carried by u1 in slot loopB)) and give it to u3








Custom script: call SaveUnitHandle( udg_DamageHash , udg_i1 , udg_loopA , udg_u3 )








Animation - Change u3's animation speed to 1000.00% of its original speed








Unit - Order u3 to Attack u2






Skip remaining actions





Else - Actions
Detect Damage

Events

Conditions

Actions


Set r1 = (Damage taken)


Unit - Set life of (Triggering unit) to 100.00%


Custom script: set udg_i1 = GetHandleId( LoadUnitHandle( udg_DamageHash , GetHandleId( GetTriggerUnit() ) , StringHash ("owner") ) )


Custom script: set udg_i2 = LoadInteger( udg_DamageHash , udg_i1 , StringHash ("hits") )


Custom script: set udg_r2 = LoadReal( udg_DamageHash , udg_i1 , StringHash("TempMax") )


Custom script: set udg_r3 = LoadReal( udg_DamageHash , udg_i1 , StringHash("TempMin") )


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



If - Conditions




r1 Greater than r2



Then - Actions




Custom script: call SaveReal(udg_DamageHash , udg_i1 , StringHash("TempMax") , udg_r1 )



Else - Actions




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





If - Conditions






r1 Less than r3





Then - Actions






Custom script: call SaveReal(udg_DamageHash , udg_i1 , StringHash("TempMin") , udg_r1 )





Else - Actions


Set i2 = (i2 + 1)


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



If - Conditions




i2 Equal to DamageHits



Then - Actions




For each (Integer loopA) from 1 to SpawnAmount, do (Actions)





Loop - Actions






Custom script: set udg_u3 = LoadUnitHandle( udg_DamageHash , udg_i1 , udg_loopA )






Unit - Remove u3 from the game




Unit - Hide (Triggering unit)




Custom script: call SaveReal(udg_DamageHash , udg_i1 , StringHash("Max") , LoadReal( udg_DamageHash , udg_i1 , StringHash("TempMax") ) )




Custom script: call SaveReal(udg_DamageHash , udg_i1 , StringHash("Min") , LoadReal( udg_DamageHash , udg_i1 , StringHash("TempMin") ) )



Else - Actions




Custom script: call SaveInteger( udg_DamageHash , udg_i1 , StringHash("hits") , udg_i2 )
