Is this trigger leaking?

GhosTHunteR

New Member
Reaction score
2
Hello to TheHelper community!

I've been working with WE for a couple of months and I am in an "intermediate" level of triggering, if I can say so. Well, It may seem really simple but I've been working on a trigger enhanced spell that is supposed to SET the mana percentage of the affected units to 40% ( I will be glad if someone explain how to DECREASE the manapoints by 40%) and damage them. The problem is that when I Pick The Unit group within 600 range that are not enemies of the triggering unit it sets everybody's mana to 40% which doesn't satisfy me. I will try to code the trigger and in case I made a mistake somewhere, I will be thankful to the one who corrects my mistake or helps me make this stubborn trigger leakless!
Code:
Arcane Explosion
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Arcane Explosion 
    Actions
        Unit - Create 1 explosion dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing (Position of (Triggering unit))
        Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
        Unit Group - Pick every unit in (Units within 600.00 of (Position of (Triggering unit)) matching (((Picked unit) belongs to an ally of (Owner of (Triggering unit))) Not equal to True)) and do (Actions)
            Loop - Actions
                Unit - Set mana of (Picked unit) to 40.00%
P.S. At this rate I am not working with JASS so please don't advise me using it!
 

Draphoelix

It's not the wintercold that's killing me
Reaction score
132
Code:
Position of (Triggering unit)) facing (Position of (Triggering unit))
        Unit - Add a 5.00 second Generic expiration timer to (Last created unit)

Position of triggering unit leaks.

Code:
Units within 600.00 of (Position of (Triggering unit

Group leak

Make a condition

Picked unit is an ally of triggering unit etc.
 

GhosTHunteR

New Member
Reaction score
2
Very quick reply, Thanks!

Thanks Draphoelix, please can you help me a little more?

I think that in the position leak I need to make a variable, right?
And for the group leak, the condition is supposed to be in boolean or?

Thanks for the speedy reply again!
 

UndeadDragon

Super Moderator
Reaction score
447
To remove leaks, do something like:

Code:
Arcane Explosion
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Arcane Explosion 
    Actions
[B]        Set tmpPoint = (Position of (Triggering unit))[/B]
        Unit - Create 1 explosion dummy for (Owner of (Triggering unit)) at [B]tmpPoint[/B] facing (Position of (Triggering unit))
[B]        Custom Script - call RemoveLocation( udg_tmpPoint )[/B]
        Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
[B]        Set tmpPoint = (Position of (Triggering Unit))
        Set tmpGroup = ((Units within 600 of tmpPoint) matching (Matching Unit) belongs to an ally of (Owner of (Triggering Unit)) not equal to True)[/B]
        Unit Group - Pick every unit in [B]tmpGroup[/B] and do (Actions)
            Loop - Actions
                Unit - Set mana of (Picked unit) to [B](Mana of (Picked Unit)) - (Mana of (Picked Unit) / 2.5)[/B]
        Custom Script - call DestroyGroup( udg_tmpGroup )
        Custom Script - call RemoveLocation( udg_tmpPoint )

Try that. I also fixed your mana problem.
 
Reaction score
456
It still leaks a location in the first action Undy ;). And it's DestroyGroup(..) for groups, not DestroyForce(..).
 

UndeadDragon

Super Moderator
Reaction score
447
Thanks for that Uber :p

My silly mistakes :rolleyes:
 

GhosTHunteR

New Member
Reaction score
2
UndeadDragon and Uberplayer, thanks for this splendid answer!

I have one more question!

Code:
Unit - Set mana of (Picked unit) to (Mana of (Picked Unit)) - (Mana of (Picked Unit)

Where can I find "to (Mana of (Picked Unit)) - (Mana of (Picked Unit)"?

Sorry if I am too troublesome!
 

Lanboy

TH.net Regular
Reaction score
22
Yeah, this forum has some of the most helpful and friendly people you'll find. It's fantastic.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top