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

Auto cast fire ability detection

Status
Not open for further replies.
I've got a problem....
Is there a way to detect an attack with an autocast ability added to it as with the events with a unit finishes casting an ability etc it only works with doint it "manualy".
Any solutions I'm in great need of this :)
Also there is no conditions to detect auto cast is on and the only thing related to auto cast in WE is the event turn on auto cast.
 
Level 3
Joined
Apr 4, 2006
Messages
33
i tried to trigger a solution and i've found one.
it's a raw construction but it works.
i have to say that i really dislike wait-actions but here i had to use it.

and it has at least 1 bug:
when she's starting to attack and you cancel the autoattack with a rightclick, the trigger runs twice or more because of the wait-condition.

hope you understand :)

here's it:

  • Untitled Trigger 001
    • Events
      • Unit - Priestess of the Moon 0000 <gen> Notices a target in range
    • Conditions
    • Actions
      • Set real[1] = (Mana of Priestess of the Moon 0000 <gen>)
      • Set real[2] = (Life of (Targeted unit))
      • Wait until (real[2] Greater than (Life of (Targeted unit))), checking every 0.10 seconds
      • Set real[3] = (Mana of Priestess of the Moon 0000 <gen>)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • real[3] Less than real[1]
        • Then - Actions
          • Game - Display to (All players) the text: yes autocast
        • Else - Actions
          • Game - Display to (All players) the text: no autocast
 
Level 3
Joined
Apr 4, 2006
Messages
33
true but each autocast ability uses mana.
the variable checks the before and after-mana and you may create an another trigger with boolean ability being cast equal to false conditions
then there's no other way it has to be an autocast ability
and as i told it's a raw construction.
you may improve it or poste a better one, it's okay
and: the unit does not cast searing arrow, so no trigger will ever fire

edit
ok i didn't know that i can use the order string for order comparison! :)
 
Last edited:
Level 33
Joined
Mar 27, 2008
Messages
8,035
Let's take Searing Arrows as example.
If you activate its auto-cast, its order string if flamingarrows, and if you deactivate it, its order string is unflamingarrows

Trigger Example:
  • Activate And Deactivate
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Issued order) Equal to (Order(flamingarrows))
        • Then - Actions
          • Unit Group - Add (Triggering unit) to SearingArrowsGroup
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Issued order) Equal to (Order(unflamingarrows))
            • Then - Actions
              • Unit Group - Remove (Triggering unit) from SearingArrowsGroup
            • Else - Actions
As you can see, once you activate the auto-cast, the trigger will detect its order string (in this case, flamingarrows for Searing Arrows base spell auto-cast activating Event) and will put that unit inside a Unit Group (SearingArrowsGroup)

If you deactivate it (unflamingarrows), it will remove that unit from Unit Group making that unit not auto-casting the ability

Next, the Unit Group:
  • Activate Effect
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in SearingArrowsGroup and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 10.00)
Trigger above will make the trigger heals the picked unit (activating flamingarrows) for 10 HP per second. Lasts until the unit is out of group (it has been ordered to unflamingarrows = remove from unit group)

Remember, each auto-cast ability has different order string, so, to make your life easier (doesn't look in Object Editor), just do this:
  • Order String Knowledge
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • Game - Display to (All players) the text: (String((Issued order)))
(Conversion - Convert Order To String)
Every auto-cast ability, when you activate it, it will show on your screen the actual string order that is being used, good luck :)
 
Status
Not open for further replies.
Top