Grurf
Ultra Cool Member
- Reaction score
- 30
I have some trigger code here that leaks a lot (maybe even all) of the special effects it creates. But I can't find it, this should properly remove them all. How to fix the leaking of special effects here?
Code:
Poisonous Cloud
Events
Unit - A unit enters (Entire map)
Conditions
(Unit-type of (Entering unit)) Equal to PoisonCloud
Actions
Set PoisonCloudLoc = (Position of (Entering unit))
For each (Integer PoisonCloud) from 1 to 30, do (Actions)
Loop - Actions
Set PoisonCloudGroup = (Units within 300.00 of PoisonCloudLoc matching (((((Matching unit) is dead) Equal to False) and (((Matching unit) is A ground unit) Equal to True)) and (((Matching unit) belongs to an enemy of (Owner of PoisonCloudCaster)) Equal to True)))
Set PoisonCloudAmount = (Number of units in PoisonCloudGroup)
Unit Group - Pick every unit in PoisonCloudGroup and do (Actions)
Loop - Actions
Unit - Order (Entering unit) to damage (Picked unit) for (20.00 x (Real((Level of Poisonous Cloud [Ancient Naga Enchantress] for PoisonCloudCaster)))) using attack type Spells and damage type Normal.
For each (Integer PoisonCloudInnerLoop) from 1 to PoisonCloudAmount, do (Actions)
Loop - Actions
Set PoisonCloudTarget = (Random unit from PoisonCloudGroup)
Set PoisonCloudEffect[PoisonCloudInnerLoop] = (Create a special effect using Abilities\Spells\Items\AIre\AIreTarget.mdl On PoisonCloudTarget 's origin)
Unit Group - Remove PoisonCloudTarget from PoisonCloudGroup
Wait 1.00 seconds
For each (Integer PoisonCloudInnerLoop) from 1 to PoisonCloudAmount, do (Actions)
Loop - Actions
Special Effect - Destroy PoisonCloudEffect[PoisonCloudInnerLoop]
Unit Group - Destroy unit group PoisonCloudGroup
Unit - Remove (Entering unit) from the game
Point - Remove PoisonCloudLoc