Auto-cast trigger

SiorTapas

New Member
Reaction score
0
is there any way of make a trigger run when a unit right clicks an auto-cast ability? (when turns auto-cast on) If not how I can make 2 triggers like that: the one runs when a unit turns immolation on and the other runs when a unit turns immolation off
 

Jinxx

New Member
Reaction score
4
Yes, I think this is doable. All the auto-cast abilities have 2 order strings, an "on" and "off" order which enables/disables auto-casting. So if you base your ability from, say, Poison Arrows, you'd do something like this...

if ( GetIssuedOrderId() == OrderId("poisonarrows") ) then [do your stuff here]

I haven't played around with custom hero abilities of this type, but this should work... in theory... :p

EDIT: Turning off poison arrows would be "unpoisonarrows". Also, Immolation is a toggle ability, why would you need it auto-cast?
 

Sneakster

Active Member
Reaction score
24
The way I would handle the situation would involve making 2 dummy spells. The first one would be "turn on" and the second "turn off". I would then trigger my spell (or use JASS...) to detect when they turn it on/off and make 2 triggers like this:


Activate Spell
Trigger:
  • Turn On
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Turn On Immolation
    • Actions
      • -------- Running is a boolean. True=Spell is running. False=Spell is not running. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Running Equal to False
        • Then - Actions
          • Set Running = True
          • Trigger - Run When On <gen> (checking conditions)
        • Else - Actions



Deactivate Spell
Trigger:
  • Turn Off
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Turn Off Immolation
    • Actions
      • -------- Running is a boolean. True=Spell is running. False=Spell is not running. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Running Equal to True
        • Then - Actions
          • Set Running = False
          • Trigger - Run When Off <gen> (checking conditions)
        • Else - Actions
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top