• 🏆 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] Vicious Flame

Status
Not open for further replies.
Level 11
Joined
Jul 9, 2009
Messages
926
Can anyone check if my trigger leaks ?? if you can give me any way to improve it. please do :D

So here is how the ability works

Unit summons a flame cloud above him which strikes any opponent near itself every 0.3 seconds. Each Strike deals 15 + 10* Level of Vicious Flame as damage.

ok, so here are the triggers :D

  • Vicious Flame Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Hellfire Blast
    • Actions
      • Set ViciousFlameCaster = (Triggering unit)
      • Set ViciousFlamePoint = (Position of ViciousFlameCaster)
      • Set ViciousFlameLevel = (Level of Hellfire Blast for ViciousFlameCaster)
      • Unit - Create 1 Dummy (Vicious Flame) for (Owner of (Triggering unit)) at ViciousFlamePoint facing (Facing of ViciousFlameCaster) degrees
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • Set ViciousFlame = (Last created unit)
      • Unit - Set level of Vicious Flame Stun for ViciousFlame to ViciousFlameLevel
      • Countdown Timer - Start ViciousDuration as a One-shot timer that will expire in 3.00 seconds
      • Trigger - Turn on Vicious Flame <gen>
      • Trigger - Turn on Vicious Flame Follow <gen>
      • Trigger - Turn on Vicious Duration <gen>
      • Custom script: call RemoveLocation(udg_ViciousFlamePoint)
  • Vicious Flame
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
    • Actions
      • Set ViciousFlameTarget = (Random 1 units from (Units within 400.00 of (Position of ViciousFlameCaster) matching ((((Matching unit) belongs to an enemy of (Owner of ViciousFlame)) Equal to True) and (((Matching unit) is alive) Equal to True))))
      • Unit Group - Pick every unit in ViciousFlameTarget and do (Actions)
        • Loop - Actions
          • Unit - Order ViciousFlame to Human Mountain King - Storm Bolt (Picked unit)
          • Custom script: call DestroyGroup(udg_ViciousFlameTarget)
  • Vicious Flame Follow
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set ViciousFlamePoint = (Position of ViciousFlameCaster)
      • Unit - Move ViciousFlame instantly to (Position of ViciousFlameCaster)
      • Custom script: call RemoveLocation(udg_ViciousFlamePoint)
  • Vicious Duration
    • Events
      • Time - ViciousDuration expires
    • Conditions
    • Actions
      • Trigger - Turn off Vicious Flame <gen>
      • Trigger - Turn off Vicious Flame Follow <gen>
      • Trigger - Turn off (This trigger)
Thank you for your time. Any help will be appreciated :)
 
Level 11
Joined
Feb 14, 2009
Messages
884
I don't see any leaks, but I think it's more efficient to destroy locations at the end of the spell, instead of destroying them every 0.03 seconds. I haven't used triggers and JASS for quite some time, so it's probable that I'm entirely wrong :p
 
Level 11
Joined
Jul 9, 2009
Messages
926
Thank you for checking my triggers. +rep :)

and I think it wont work if I tried to clear the leaks on the final trigger. :)
 
Level 11
Joined
Nov 15, 2007
Messages
781
I don't see any leaks, but I think it's more efficient to destroy locations at the end of the spell, instead of destroying them every 0.03 seconds. I haven't used triggers and JASS for quite some time, so it's probable that I'm entirely wrong :p

He's creating a new location every .03 seconds, so he has to destroy it or else it'll leak.
 
Level 12
Joined
Aug 12, 2008
Messages
349
  • Unit Group - Pick every unit in ViciousFlameTarget and do (Actions)
    • Loop - Actions
    • Unit - Order ViciousFlame to Human Mountain King - Storm Bolt (Picked unit)
    • Custom script: call DestroyGroup(udg_ViciousFlameTarget)
The custom script should put outside of this unit group. This will bug IF the number of units in the unit group more than 1 because unit group functions runs like loop. If you put it in the unit group, it will destroy the unit group by the first loop it runs. Just for your information. :)
 
Status
Not open for further replies.
Top