• 🏆 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] Any leak?

Status
Not open for further replies.
Level 2
Joined
Sep 2, 2017
Messages
6
I'm making a spells that increase damage (increase level) when you attack/approach enemy units within limited ranges and when he leaves in specific range it will auto-decrease back to default lvl (1 or 2). I was wandering if there is any leak here ( I'm not experienced enough to find any solution of this leak). Im glad if there is anyone help me.

  • Damage Stack Active 1
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Damage Stack
    • Actions
      • Set DamageStack_LearnedUnits = (Learning Hero)
      • Trigger - Turn on Damage Stack Active 2 Copy <gen>
  • Damage Stack Active 2 Copy
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Thief
    • Actions
      • Unit - Set level of Damage Stack for (Attacking unit) to (Random integer number between 1 and 3)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Attacking unit) Equal to DamageStack_LearnedUnits
          • ((Attacking unit) is in (Units within (Random real number between 85.00 and 105.00) of (Position of (Attacked unit)))) Equal to True
        • Then - Actions
          • Unit - Set level of Damage Stack for (Attacking unit) to (Random integer number between 2 and 10)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (((Attacking unit) is in (Units within 350.00 of (Position of (Attacked unit)))) Equal to True) and ((Current order of (Attacking unit)) Equal to (Order(move)))
              • (Attacking unit) Equal to DamageStack_LearnedUnits
            • Then - Actions
              • Unit - Set level of Damage Stack for (Attacking unit) to (Random integer number between 1 and 2)
            • Else - Actions
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
There are 2 unit group and 2 point leaks:
(Units within (Random real number between 85.00 and 105.00) of (Position of (Attacked unit)))
(Units within 350.00 of (Position of (Attacked unit)))) Equal to True)

You need a group and a point variable to remove them.
 
Level 2
Joined
Sep 2, 2017
Messages
6
There are 2 unit group and 2 point leaks:
(Units within (Random real number between 85.00 and 105.00) of (Position of (Attacked unit)))
(Units within 350.00 of (Position of (Attacked unit)))) Equal to True)

You need a group and a point variable to remove them.
thank you for pointing that leak
 
Status
Not open for further replies.
Top