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

[Spell] Another "Detecting Autocast" Thread

Status
Not open for further replies.
Level 4
Joined
Nov 20, 2006
Messages
71
I looked through a lot of very old threads with people trying to figure out how to handle triggering things off of autocast but couldn't find a good answer.


This is the simplest version of what I'm trying to do:

If a unit fires autocast searing arrows, heal that unit for 1hp.


Most of what I saw was people who would add a unit to a group when it activates autocast, then remove it from the group when it deactivates autocast. The problem with this is that it doesn't take into account the situations where you autocast ability is on, but doesn't activate. If you have searing arrows on autocast and attack a magic immune unit, you can still be in the unit group but searing arrows isn't actually being used.


Does anyone have a better method?
 
Level 28
Joined
Feb 18, 2014
Messages
3,580
  • Trigger
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) is in AutocastGroup) Equal to TRUE
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Attacked unit) is A structure) Equal to FALSE
          • ((Attacked unit) is Immune to magic) Equal to FALSE
        • Then - Actions
          • Special Effect - Create a special effect attached to the origin of (Attacking unit) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
It's difficult because using "A unit is attacked" has it's own problems.

One idea I had was if the searing arrows costs mana you could use a mana comparison to find out if the attack successfully launched. Something like:

A unit is attacked

Set trackmana = mana of attacking unit
Wait however long it takes to launch the attack missile
If mana of attacking unit is < trackmana then set life of attacking unit to life of attacking unit + 1

This suffers from it's own issues though as you can lose/gain mana in other ways. But maybe you could trigger those other ways to be excluded.
 
Level 4
Joined
Nov 20, 2006
Messages
71
Yeah neither are perfect. Warseeker's was actually what I'm using right now but it has issues, and you need to have a new trigger like this for each ability created this way if the arrow effect has different valid targets.

I thought about some kind of damage detection but that's complicated and then only triggers on hits instead of casts. I also looked into a fully triggered arrow ability and those were even more messy :(
 
Status
Not open for further replies.
Top