• 🏆 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 spell

Status
Not open for further replies.
Level 4
Joined
Jun 19, 2007
Messages
53
I need to make an autocast arrow that has a 3/7/11/15/19/23% of stunning the target. I have basic knowledge of trigger spells so i just need to know what to do.

But if you'd like to make one for me, I wouldn't decline.
 

Lux

Lux

Level 2
Joined
Jan 9, 2008
Messages
20
Let's see...create a spell based off the Demon Hunter's Immolation. For the sake of simplicity, I'll make the stun percentage chance of your spell based on multiples of three.

  • Events
    • Unit - A unit Is attacked
  • Conditions
    • Unit - Attacking Unit has buff Stone Arrows is Equal to True
  • Actions
    • If (Conditions) are true then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Random integer between 1 and 100 is Less than or equal to (3 x (Level of Stone Arrows for Attacking unit)) is True
      • Then - Actions
        • Unit - Create 1 DummyCaster for (Owner of (Attacking Unit)) at Position of (Attacked Unit) facing Default building facing degrees
        • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
        • Unit - Add Storm Bolt to (Last created unit)
        • Unit - Set level of Storm Bolt for (Last created unit) to (Level of (Stone Arrows) for (Attacking unit))
        • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Attacked unit)
      • Else - Actions
        • Do nothing

That should do it. Let me know if it doesn't work.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
That will stun the attacked unit the moment the attacking unit starts its attack animation.

"A unit is attacked" = a attacking unit started its attack animation.
Its NOT when the unit gets hit.

For this to work properly you'll need to use a attack detection system which isn't suggested in GUI because if 2 units will attack at the same time it will bug it.
 
Level 11
Joined
Feb 22, 2006
Messages
752
http://www.hiveworkshop.com/forums/showthread.php?t=33123

Use that system but make sure to check that the damaged unit has the buff that your arrow spell gives before setting up the chances to stun it. Also make sure that the attacking unit has the arrow spell. Make sure the buff doesn't last long (a fraction of a second at most), otherwise you will get bugs (for example two heroes attack the same unit, one is autocasting the arrow ability but the other isnt'. Say the one using arrow attacks first and gives the damaged unit the buff. The second one attacks shortly thereafter. If the buff is still on the damaged unit, your trigger will have a chance to stun the damaged unit even though the second hero isn't using the arrow spell.)
 
Status
Not open for further replies.
Top