- Joined
- May 16, 2020
- Messages
- 660
Hi all,
I wanted to create Dota 2's Fury Swipe, and the trigger below seems to work.
But I'm never sure if I'm clearing hastables correctly, so would appreciate if someone could check the spell and provide feedback on what I can improve.
Spell description:
I wanted to create Dota 2's Fury Swipe, and the trigger below seems to work.
But I'm never sure if I'm clearing hastables correctly, so would appreciate if someone could check the spell and provide feedback on what I can improve.
Spell description:
Ursa's claws dig deeper wounds in the enemy, causing consecutive attacks to the same enemy to deal more damage. If the same target is not attacked after 10 seconds, the bonus damage is lost.
-
Fury Swipes Setup
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
Hashtable - Create a hashtable
-
Set VariableSet ZA_HashtableStack = (Last created hashtable)
-
-
-
Fury Swipes
-
Events
-
Game - DamageModifierEvent becomes Equal to 1.00
-
-
Conditions
-
(Level of Fury Swipes for DamageEventSource) Greater than 0
-
(DamageEventTarget is A structure) Equal to False
-
DamageEventAttackT Equal to ATTACK_TYPE_HERO
-
DamageEventDamageT Equal to DAMAGE_TYPE_NORMAL
-
-
Actions
-
Set VariableSet ZA_CV_Caster = (Custom value of DamageEventSource)
-
Custom script: set udg_ZA_Handle = GetHandleId(udg_DamageEventTarget)
-
-------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(DamageEventSource is in ZA_GroupCaster.) Equal to False
-
-
Then - Actions
-
Unit Group - Add DamageEventSource to ZA_GroupCaster
-
-
Else - Actions
-
-
-------- --------
-
Set VariableSet ZA_StackAmount = (Load ZA_CV_Caster of ZA_Handle from ZA_HashtableStack.)
-
Set VariableSet ZA_StackAmount = (ZA_StackAmount + 1)
-
-------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in ZA_Group[ZA_CV_Caster]) Equal to 0
-
-
Then - Actions
-
Custom script: set udg_ZA_Group[udg_ZA_CV_Caster] = CreateGroup()
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
ZA_StackAmount Equal to 1
-
-
Then - Actions
-
Unit - Add Fury Swipes (Dummy) to DamageEventTarget
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(DamageEventTarget is in ZA_Group[ZA_CV_Caster].) Equal to False
-
-
Then - Actions
-
Unit Group - Add DamageEventTarget to ZA_Group[ZA_CV_Caster]
-
-
Else - Actions
-
-
-
Else - Actions
-
-
-------- --------
-
Special Effect - Create a special effect attached to the chest of DamageEventTarget using Objects\Spawnmodels\Orc\Orcblood\BattrollBlood.mdl
-
Special Effect - Destroy (Last created special effect)
-
Set VariableSet DamageEventAmount = (DamageEventAmount + (Real((ZA_StackAmount x (10 x (Level of Fury Swipes for DamageEventSource))))))
-
-------- --------
-
Hashtable - Save ZA_StackAmount as ZA_CV_Caster of ZA_Handle in ZA_HashtableStack.
-
-------- --------
-
Set VariableSet ZA_CV_Target = (Custom value of DamageEventTarget)
-
Set VariableSet ZA_StackTimer[ZA_CV_Target] = 10
-
-------- --------
-
-------- START LOOP --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Fury Swipes Loop <gen> is on) Equal to False
-
-
Then - Actions
-
Game - Display to (All players) the text: ON
-
Trigger - Turn on Fury Swipes Loop <gen>
-
-
Else - Actions
-
-
-
-
Fury Swipes Loop
-
Events
-
Time - Every 1.00 seconds of game time
-
-
Conditions
-
Actions
-
Unit Group - Pick every unit in ZA_GroupCaster and do (Actions)
-
Loop - Actions
-
Set VariableSet ZA_Caster = (Picked unit)
-
Set VariableSet ZA_CV_Caster = (Custom value of ZA_Caster)
-
-------- --------
-
Unit Group - Pick every unit in ZA_Group[ZA_CV_Caster] and do (Actions)
-
Loop - Actions
-
Set VariableSet ZA_Target = (Picked unit)
-
Set VariableSet ZA_CV_Target = (Custom value of ZA_Target)
-
-------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
ZA_StackTimer[ZA_CV_Target] Equal to 0
-
(ZA_Target is alive) Equal to False
-
-
-
-
Then - Actions
-
Game - Display to (All players) the text: Remove from Group
-
Unit Group - Remove ZA_Target from ZA_Group[ZA_CV_Caster].
-
Unit - Remove Fury Swipes (Dummy) from ZA_Target
-
Unit - Remove Fury Swipes (Debuff) buff from ZA_Target
-
Custom script: set udg_ZA_Handle = GetHandleId(udg_ZA_Target)
-
Set VariableSet ZA_StackAmount = (Load ZA_CV_Caster of ZA_Handle from ZA_HashtableStack.)
-
Set VariableSet ZA_StackAmount = 0
-
Hashtable - Clear all child hashtables of child ZA_Handle in ZA_HashtableStack.
-
-------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in ZA_Group[ZA_CV_Caster]) Equal to 0
-
-
Then - Actions
-
Unit Group - Remove ZA_Caster from ZA_GroupCaster.
-
Custom script: call DestroyGroup (udg_ZA_Group[udg_ZA_CV_Caster])
-
-
Else - Actions
-
-
-
Else - Actions
-
Set VariableSet ZA_StackTimer[ZA_CV_Target] = (ZA_StackTimer[ZA_CV_Target] - 1)
-
Game - Display to (All players) the text: (String(ZA_StackTimer[ZA_CV_Target]))
-
-
-
-
-
-
-
-------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in ZA_GroupCaster) Equal to 0
-
-
Then - Actions
-
Game - Display to (All players) the text: OFF
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
-
-
Last edited: