[Trigger] Special Effects and a certain leak

Status
Not open for further replies.
Level 28
Joined
Mar 25, 2008
Messages
2,954
Okay, here's the thing.

  • Unit Group - Pick every unit in (Units owned by Player 12 (Brown) of type Doom) and do (Actions)
    • Loop - Actions
      • Unit - Set (Picked unit) acquisition range to 0.00
      • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Other\Doom\DoomDeath.mdl
      • Set tempeff = (Last created special effect)
      • Custom script: call DestroyEffect(udg_tempeff)
      • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Other\BreathOfFire\BreathOfFireDamage.mdl
      • Special Effect - Create a special effect attached to the head of (Picked unit) using Abilities\Spells\Other\BreathOfFire\BreathOfFireDamage.mdl
      • Special Effect - Create a special effect attached to the foot,left of (Picked unit) using Abilities\Spells\Other\BreathOfFire\BreathOfFireDamage.mdl
      • Special Effect - Create a special effect attached to the foot,right of (Picked unit) using Abilities\Spells\Other\BreathOfFire\BreathOfFireDamage.mdl
Is what I'm using to add special effects to a certain unit when spawning.
Now I know it leaks when the unit dies and so I have to index them and remove upon death, obviously.
Now do I have to add the special effects one by one to the unit and set the variables accordingly, or is there some nifty workaround?
Be it solely for a shorter trigger...
 
List them up and assign them to the unit using a hashtable for example.

Save effect under handle id of unit and effectCounter, increment effectCounter.

Of course, this should be done within a function to actually shorten your triggers and avoid errors, which leads us to jass.
 
Status
Not open for further replies.
Back
Top