• 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.

Leaking Trigger

Status
Not open for further replies.
Level 9
Joined
Apr 23, 2011
Messages
460
For whatever reason this trigger is no longer working, I don't know what happened, something might have been deleted when i had someone look at the map on accident, I can't find it.
  • Flame Explosion
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Flame Explosion (Neutral Hostile)
    • Actions
      • Unit - Create 1 dummy_fireball for (Owner of (Casting unit)) at (Target point of ability being cast) facing Default building facing degrees
      • Wait 1.00 seconds
      • Unit - Remove (Last created unit) from the game
      • Unit - Create 1 dummy_explode for (Owner of (Casting unit)) at (Target point of ability being cast) facing Default building facing degrees
      • Unit Group - Pick every unit in (Units within 350.00 of (Target point of ability being cast)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A Hero) Equal to True
            • Then - Actions
            • Else - Actions
              • Unit - Cause (Casting unit) to damage (Picked unit), dealing ((2.50 x (Real((Intelligence of (Casting unit) (Include bonuses))))) + (50.00 x (Real((Level of (Ability being cast) for (Casting unit)))))) damage of attack type Spells and damage type Magic
      • Wait 1.00 seconds
      • Unit - Remove (Last created unit) from the game
 
You use waits and you still refer to the target point of ability being cast and the caster.
  • Set Unit = (Triggering unit)
  • Set Point1 = (Target point of ability being cast)
  • Unit - Create 1 dummy_fireball for (Triggering player) at Point1 facing Default building degrees
  • Unit - Add a 1.00 seconds generic expiration timer to (Last created unit)
  • Unit - Create 1 dummy_explode for (Triggering player) at Point1 facing Default building degrees
  • Unit - Add a 1.00 second generic expiration to (Last created unit)
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units within 350.00 of Point1 matching ((((Matching unit) is a Hero) Equal to True) and ((Matching unit) belongs to an enemy of (Triggering player)) Equal to True) and do (Actions)
    • Loop - Actions
      • Unit - Cause Unit to damage (Picked unit), dealing ((2.50 x (Real((Intelligence of Unit (Include bonuses))))) + (50.00 x (Real((Level of (Ability being cast) for Unit))))) damage of attack type Spells and damage type Magic
  • Custom script: call RemoveLocation (udg_Point1)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,255
Unit - Create 1 dummy_fireball for (Owner of (Casting unit)) at (Target point of ability being cast) facing Default building facing degrees
Wait 1.00 seconds
Unit - Remove (Last created unit) from the game
This not only leaks if the spell is cast before the dummy is removed, but removing units leaks due to engine bugs in WC3. Make the unit time expire after 1 second rather and let natural death remove them.

Unit Group - Pick every unit in (Units within 350.00 of (Target point of ability being cast)) and do (Actions)
Leaks a group and location object, you allocate these objects but never deallocate them.

Wait 1.00 seconds
Unit - Remove (Last created unit) from the game
Same as first leak, you must add an expiration timer to the unit and let natural death recycle it.
 
Status
Not open for further replies.
Top