Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
You are using an out of date browser. It may not display this or other websites correctly. You should upgrade or use an alternative browser.
Triggers
SwitchAttack v2.2.w3x
Variables
SwitchAttack
INFO
SwitchAttackConfig
SwitchAttack
examples
start
Attack1
Attack2
Enter map-specific custom script code below. This text will be included in the map script after variables are declared and before any trigger code.
Name
Type
is_array
initial_value
SwitchAttack_Ability1
abilcode
No
SwitchAttack_Ability2
abilcode
No
SwitchAttack_Tree
destructablecode
No
SwitchAttackTo1_Unit
unit
No
SwitchAttackTo2_Unit
unit
No
Recommended for units / structures.
Allows to choose what attack (from 2 available) will be enabled on given unit.
Uses War Club ability to swich between two attacks
Instalation:
Copy from OE: destructable tree: "TreeForAttackChange", 2 abilities: "SwitchAttack1" and "SwitchAttack2"
copy in TriggerEditor whole "SwitchAttack" category, Set dummy tree and 2 abilities in "SwitchAttackConfig" trigger.
Keep "SwitchAttackConfig" trigger above "SwitchAttack" trigger.
How to use:
Prepare your units in Object Editor you wish to use with changeable attacks.
Set "Combat Attack 1" and "Combat Attack 2" parameters. Enable "Attack 1 Only" or "Attack 2 Only".
To set on unit "Combat Attack 1" as active and other one disabled:
1. set SwitchAttackTo1_Unit = <Your Unit>
2. Trigger - Run SwitchAttack (ignoring conditions)
And vice versa: to enable "Combat Attack 2" and disable "Combat Attack 1":
1. set SwitchAttackTo2_Unit = <Your Unit>
2. Trigger - Run SwitchAttack (ignoring conditions)
Why not recommended for heroes:
It works on heroes. However there are issues:
After switching to "Attack 2" attack icon on User Interface will disapear (see picture). Hero can normally attack but no icon is annoying.
When mixed with Orbs (which enables "Attack 2" like Orb of Frost, Orb of Slow) may result in losing both attacks.
Scenario: Orb is picked up, System enables "Attack 2", Orb is dropped. It can be fixed by re-pick and Orb or <Trigger - Run SwitchAttack (ignoring conditions)>
SwitchAttackConfig
Events
Map initialization
Conditions
Actions
Set Variable Set SwitchAttack_Tree = "B000"
Set Variable Set SwitchAttack_Ability1 = "A005"
Set Variable Set SwitchAttack_Ability2 = "A008"
-------- ---------------------- --------
Set Variable Set SwitchAttackTo1_Unit = No unit
Set Variable Set SwitchAttackTo2_Unit = No unit
-------- ---------------------- --------
SwitchAttack
Events
Conditions
Actions
Custom script: local real x
Custom script: local real y
Custom script: local real r
Custom script: local unit u
-------- ---------------------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SwitchAttackTo1_Unit Not equal to No unit
Then - Actions
Unit - Add SwitchAttack_Ability1 to SwitchAttackTo1_Unit
Custom script: set u=udg_SwitchAttackTo1_Unit
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SwitchAttackTo2_Unit Not equal to No unit
Then - Actions
Unit - Add SwitchAttack_Ability2 to SwitchAttackTo2_Unit
Custom script: set u=udg_SwitchAttackTo2_Unit
Else - Actions
Game - Display to (All players) the text: |cffff4500 Switch Attack: failed, unit not speficied! |r
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.