# [Trigger]Leaks?

Status
Not open for further replies.

#### turaak

Level 5
Have I removed all leaks well or should I change something??
• Healing Wave
• Events
• Unit - A unit Starts the effect of an ability
• Conditions
• (Ability being cast) Equal to Healing Wave
• Actions
• Wait 0.10 game-time seconds
• Set CasterPoint = (Position of (Triggering unit))
• Set Wave_Points[(Player number of (Owner of (Triggering unit)))] = CasterPoint
• Set Wave_Angls[(Player number of (Owner of (Triggering unit)))] = (Facing of (Triggering unit))
• For each (Integer A) from 1 to 7, do (Actions)
• Loop - Actions
• Special Effect - Destroy Effect1[(Player number of (Owner of (Triggering unit)))]
• Special Effect - Destroy Effect2[(Player number of (Owner of (Triggering unit)))]
• Special Effect - Destroy Effect3[(Player number of (Owner of (Triggering unit)))]
• Set Wave_Points[(Player number of (Owner of (Triggering unit)))] = (Wave_Points[(Player number of (Owner of (Triggering unit)))] offset by 150.00 towards Wave_Angls[(Player number of (Owner of (Triggering unit)))] degrees)
• Special Effect - Create a special effect at Wave_Points[(Player number of (Owner of (Triggering unit)))] using Abilities\Spells\Other\Charm\CharmTarget.mdl
• Set Effect1[(Player number of (Owner of (Triggering unit)))] = (Last created special effect)
• Special Effect - Create a special effect at (Wave_Points[(Player number of (Owner of (Triggering unit)))] offset by 100.00 towards (Wave_Angls[(Player number of (Owner of (Triggering unit)))] + 90.00) degrees) using Abilities\Spells\Other\Charm\CharmTarget.mdl
• Set Effect2[(Player number of (Owner of (Triggering unit)))] = (Last created special effect)
• Special Effect - Create a special effect at (Wave_Points[(Player number of (Owner of (Triggering unit)))] offset by 100.00 towards (Wave_Angls[(Player number of (Owner of (Triggering unit)))] + 270.00) degrees) using Abilities\Spells\Other\Charm\CharmTarget.mdl
• Set Effect3[(Player number of (Owner of (Triggering unit)))] = (Last created special effect)
• Set HealingUnits = (Units within 200.00 of Wave_Points[(Player number of (Owner of (Triggering unit)))] matching (((Matching unit) belongs to an ally of (Owner of (Triggering unit))) Equal to True))
• Unit Group - Pick every unit in HealingUnits and do (Actions)
• Loop - Actions
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• ((Picked unit) has buff Healed ) Equal to True
• Then - Actions
• Do nothing
• Else - Actions
• If (((Picked unit) is dead) Equal to True) then do (Skip remaining actions) else do (Do nothing)
• If (((Picked unit) is Mechanical) Equal to True) then do (Skip remaining actions) else do (Do nothing)
• If ((Unit-type of (Picked unit)) Equal to Paladin) then do (Skip remaining actions) else do (Do nothing)
• Unit - Create 1 Wave Caster for (Owner of (Triggering unit)) at Wave_Points[(Player number of (Owner of (Triggering unit)))] facing Default building facing degrees
• Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
• If ((Level of Healing Wave for (Triggering unit)) Greater than or equal to 1) then do (Unit - Add Dummy Buff Adder to (Last created unit)) else do (Do nothing)
• Unit - Order (Last created unit) to Orc Shaman - Bloodlust (Picked unit)
• Unit - Create 1 Wave Caster for (Owner of (Triggering unit)) at Wave_Points[(Player number of (Owner of (Triggering unit)))] facing Default building facing degrees
• Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
• If ((Level of Healing Wave for (Triggering unit)) Equal to 1) then do (Unit - Add Wave Heal (Level 1) to (Last created unit)) else do (Do nothing)
• If ((Level of Healing Wave for (Triggering unit)) Equal to 2) then do (Unit - Add Wave Heal (Level 2) to (Last created unit)) else do (Do nothing)
• If ((Level of Healing Wave for (Triggering unit)) Equal to 3) then do (Unit - Add Wave Heal (Level 3) to (Last created unit)) else do (Do nothing)
• Unit - Order (Last created unit) to Human Paladin - Holy Light (Picked unit)
• Wait 0.10 seconds
• Custom script: call RemoveLocation(udg_Wave_Points[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
• Custom script: call DestroyGroup(udg_HealingUnits)
• Custom script: call RemoveLocation(udg_CasterPoint)
• Special Effect - Destroy Effect1[(Player number of (Owner of (Triggering unit)))]
• Special Effect - Destroy Effect2[(Player number of (Owner of (Triggering unit)))]
• Special Effect - Destroy Effect3[(Player number of (Owner of (Triggering unit)))]

#### emperor_d3st

Level 17
I think those waits are going to cause you some headache. Better remove them. I haven't checked the whole trigger for leaks, sorry, GUI is just.. ugly like .. something what is very ugly..

#### turaak

Level 5
then don't visit GUI topic -.-
i don't care about waits and those i can fix it later, my main concern are leaks.
Wave_Points are removed for the owners of triggering player but what about HealingUnits and CasterPoint???

#### GhostWolf

Level 29
When you use polar offsets (some_point offset by some_value towards some_angle) both of the points must be initialized to not leak.
• Set PointVar1 = some location
• Set PointVar2 = PointVar1 offset by some_value towards some_angle
• do something
I do not see what's the point of CasterPoint, you can just set it into Wave_Points from the start.

You do not need those waits (waits are evil, try to avoid them when not necessary) as they wait a value you can hardly even see with your eyes.

You do not need the Do Nothing, never use them.

Why are you using inside-if's when you can just put them in the main if statement ?

Why are you destroying effects which are already destroyed ? (remove either of those)

You don't need arrays for this as it is instant (if you remove the waits which you should).

#### turaak

Level 5
i have just noticed that this spell heals 75 HP regardless of lvl of spell on either trigger i posted or fixed on Ghostwolf's suggestion...

#### ~Void~

Level 36
You could eliminate... all of the if statements in that trigger.

Status
Not open for further replies.

Replies
4
Views
498
Replies
6
Views
704
Replies
6
Views
704
Replies
0
Views
629
Replies
11
Views
939