• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Autocast ability in a trigger's event

Status
Not open for further replies.
Level 10
Joined
Jun 6, 2007
Messages
392
You can detect when a unit is ordered to activate/deactivate autocast. Set a boolean variable on those events (use dynamic indexing or hashtable for MUI). Then you have to trigger the effect when unit takes physical damage and the boolean variable is set for damaging unit. You can use a damage detection system for detecting damage.

Another way to do this would be to base your ability on frost arrows, and detect when damaged unit has that buff.
 
Level 1
Joined
Jun 13, 2008
Messages
132
First idea to do this easily that comes to my mind is to create two abilities for your searing arrows, switch between them, add a damage detector to your map and then check and do actions, you can add effects to your attack with hidden abilities.
 
Level 2
Joined
Nov 5, 2014
Messages
23
Ive done this when i was trying to create a certain spell
here what i did
1st in the object editor you might want to make sure you have the following
1. Your base Searing arrow spell
2. the buff that it produces to the enemy unit after it hits
(i suggest you use poison arrow to meet these 2 conditions)

for the triggers...
If you dont want to use damage detection system you can make your own improvised

  • SD Detection
    • Events
      • Unit - A unit Is attacked
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • -------- ------------------------------------------------------------------------------------------------------------------------------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Searing Arrow
        • Then - Actions
          • -------- ------------------------------------------------------------------------------------------------------------------------------ --------
          • Trigger - Add to Life Steal <gen> the event (Unit - (Target unit of ability being cast) Takes damage)
          • -------- ------------------------------------------------------------------------------------------------------------------------------ --------
        • Else - Actions
          • -------- ------------------------------------------------------------------------------------------------------------------------------ --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Searing Arrow for (Attacking unit)) Greater than 0
            • Then - Actions
              • -------- ------------------------------------------------------------------------------------------------------------------------------ --------
              • Trigger - Add to Life Steal <gen> the event (Unit - (Attacked unit) Takes damage)
              • -------- ------------------------------------------------------------------------------------------------------------------------------ --------
            • Else - Actions
  • Life Steal
  • Life Steal
    • Events
    • Conditions
      • ((Triggering unit) has buff Fire Spirit (Non-stacking)) Equal to True
    • Actions
      • -------- --------------------------------------------------------------------------------------------------------------------------------------- --------
      • Unit - Remove Fire Spirit (Non-stacking) buff from (Triggering unit)
      • -------- Set Your Regeneration and other stuff here --------
      • Set SD_Damage_Effect = (5.00 x (Real((Level of Searing Arrow for (Damage source)))))
      • Unit - Set life of (Damage source) to ((Life of (Damage source)) + SD_Damage_Effect)
 
Status
Not open for further replies.
Top