• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Triggers with Spells

Status
Not open for further replies.
Level 4
Joined
Aug 20, 2004
Messages
65
Say i base a spell off of searing arrows, and want a triggered effect to happen every time you use it. How would I do the trigger so that the effect only happens when the searing arrow actually hits the target and not as soon as it's cast?
 
Level 19
Joined
Nov 16, 2006
Messages
2,165
Erhm, this would require some triggers to make it work.

You'll need these variables :
Activated = boolean
YOURUNIT = unit (could be the unit already set by variables)
AttackedUnit = unit

Trigger Legend:
->YOURUNIT = The unit that should cast it.
YOURAMOUNT = If the unit doesn't has more then the amount you gave, it will not able to cast this.

Get the triggers:

  • Activation
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Ordered unit) Equal to YOURUNIT
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Issued order) Equal to (Order(flamingarrows))
        • Then - Actions
          • Set Activated = True
        • 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
              • Set Activated = False
            • Else - Actions
              • Do nothing
-> Detects if the spell is activated or not.

  • Attack Attempt
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to YOURUNIT
      • Activated Equal to True
      • (Mana of YOURUNIT) Greater than or equal to YOURAMOUNT
    • Actions
      • Trigger - Turn off Effect <gen>
      • Set AttackedUnit = (Attacked unit)
      • Trigger - Add to Effect <gen> the event (Unit - AttackedUnit Takes damage)
      • Trigger - Turn on Effect <gen>
->If the spell is activated -> Check the mana -> Start the trigger.

  • Effect
    • Events
    • Conditions
      • (Damage source) Equal to YOURUNIT
    • Actions
      • < Add your actions here when casted >
      • Trigger - Turn off (This trigger)
-> The trigger that gets executed when the spell is turned on and casted.
 
Last edited:
Level 40
Joined
Dec 14, 2005
Messages
10,532
No, I don't think you understand what I mean.

Here we go --

Simulation
JoeUser picks Uberman with Searing Arrows

JoeUser enables Searing Arrows, with high mana and some mana boosting/mana regeneration boosting items so that he can maintain these arrows forever (sure, that's a little extreme, but it can still be bad)

JoeUser attacks a footman. The footman listens for damage from JoeUser. Good so far.

Uh-oh! JoeUser hit the footman and the event added to the Damage function didn't dissapear! We have a problem, captain!

JoeUser attacks the footman again.

Oh no, captain! The trigger had no idea that footman had already been attacked, so another event has been created to detect damage to the footman!

JoeUser switches targets. He spreads about 100 shots over a short period of time. That's 100 more events.

The footman (that he attacked the original time twice) dies. Oh no! Now the events are still looming in the trigger! The leak still exists!
So the leak is the event, nothing to do with the unit.

I hope you understood my simulation :p
 
I think that system is too complicated for him, i think he doesent have much knowledge to jass as he posts in GUI forum. (no ofense)
of what i know most people base searing arrow spells like this:
have it use something like cold arrows or poison arrows instead, with a special buff. each time a unit is attacked, you'll have a trigger that waits untill the target has the buff, and then runs the actions.
 
Last edited:
Status
Not open for further replies.
Top