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

[Trigger] Will this leak..?

Status
Not open for further replies.
The point of this trigger is for when a unit gets attacked he is to cast a war stomp ability but he can only do it every 5 seconds.. but will this leak? (i know its not MUI and im working on fixing that)

  • Boss is attacked
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Set CO_AttackingUnit[(Player number of (Owner of (Attacking unit)))] = (Attacking unit)
      • Set CO_AttackedUnit[(Player number of (Owner of (Attacked unit)))] = (Attacked unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of CO_AttackingUnit[(Player number of (Owner of (Attacking unit)))]) is an enemy of (Owner of CO_AttackedUnit[(Player number of (Owner of (Attacked unit)))])) Equal to True
          • (Unit-type of CO_AttackedUnit[(Player number of (Owner of (Attacked unit)))]) Equal to Firelord
        • Then - Actions
          • Unit - Add Counter Attack to CO_AttackedUnit[(Player number of (Owner of (Attacked unit)))]
          • Unit - Order CO_AttackedUnit[(Player number of (Owner of (Attacked unit)))] to Orc Tauren Chieftain - War Stomp
          • Wait 1.00 seconds
          • Unit - Remove Counter Attack from CO_AttackedUnit[(Player number of (Owner of (Attacked unit)))]
        • Else - Actions
  • Boss is attacked cooldown
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Counter Attack
    • Actions
      • Wait 1.00 seconds
      • Trigger - Turn off Boss is attacked <gen>
      • Wait 5.00 seconds
      • Trigger - Turn on Boss is attacked <gen>
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
Nopes, i dont think so,,
But why first set the variables, and THEN check if they are enemys?
Why not just:
  • conditions
    • ((Owner of (Attacking Unit)) is an enemy of(Ownder of (Attacked unit))) equal to true
    • Unit-type of (Attacked Unit) equal to Firelord
And then set the variables, otherwise the variable could be set to another unit while waitin 1 sec,,
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
Yes, but you set them to Attacked unit, and Attacking unit,,
But you can also set the condition with Attacked Unit and Attacking Unit instead of the variables, will be the exact same,,
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
Ok, you right,, but you would save lagg if you check it immediately, otherwise, every time a unit gets attacked, it is set!
Well,, it is not a big point,,
Your triggers do not leak! That IS the point =)
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
Well,, random number isnt really random number, for as far as i know,,
But:
  • Set RANDOM = random integer number between 1 and 100
    • if Random greater then or equal to 75
    • then do 75/100 actions
    • else
      • if RANDOM less then 75
        • RANDOM greater then or equal to 50
      • then do 50/75 actions
      • else
        • if RANDOM less then 50
          • And RANDOM Greater then or equal to 25
        • then do 25/50 actions
        • else do 0/25 actions
Hope it works for you
 
Status
Not open for further replies.
Top