• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Please help finish trigger

Status
Not open for further replies.
Level 4
Joined
Dec 3, 2012
Messages
51
Hi, I have a trigger for a spell that I need help finishing.

Here is what I have:The hero can summon "spirits" (based on spirit of vengence). These are the only targets for the spell. The hero can target this spirit, and then nearby friendly units are healed, and nearby enemy units are damaged.

Here is what I would like:

1) Have the trigger leakless
2) Have more spirits summoned by any units the spell kills.

  • Well of Souls
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Well of Souls
    • Actions
      • Set Point = (Target point of ability being cast)
      • Set UnitGroup = (Units within 650.00 of Point matching (((Matching unit) is alive) Equal to True))
      • Set Level = (Level of Well of Souls for (Triggering unit))
      • Set Dmg = (Level x ((Hero level of (Triggering unit)) + 125))
      • Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing 1000.00 damage of attack type Spells and damage type Normal
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Well of Souls
        • Then - Actions
          • Unit Group - Pick every unit in UnitGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of (Picked unit)) is an ally of Player 12 (Brown)) Equal to True
                • Then - Actions
                  • Unit - Set life of (Picked unit) to 100.00%
                  • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Undead\DeathPact\DeathPactTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
                  • Unit - Cause (Casting unit) to damage (Picked unit), dealing (Real(Dmg)) damage of attack type Spells and damage type Normal
                  • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
        • Else - Actions
      • Custom script: call RemoveLocation(udg_Point)
      • Custom script: set udg_Point = null
      • Custom script: call DestroyGroup( udg_UnitGroup)
      • Custom script: set udg_UnitGroup = null
Thanks.
 
Level 7
Joined
Jan 22, 2013
Messages
293
You have position leaks( In that if-block inside the group,Position of Picked Unitt)

That isn't going to help much, more people learn through example and seeing it done before them.

I'm headed to bed in a few minutes, I always help people fix the GUI triggers. I'm headed to bed though so if no one has helped him by the time I get up I'll do it.



(Reserved for Fix)
 
Level 4
Joined
Dec 3, 2012
Messages
51
Thanks for the replies. Would this solve the leaks?

  • Well of Souls
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Well of Souls
    • Actions
      • Set Point = (Position of (Target unit of ability being cast))
      • Set UnitGroup = (Units within 650.00 of Point matching (((Matching unit) is alive) Equal to True))
      • Set Level = (Level of Well of Souls for (Casting unit))
      • Set Dmg = (Level x ((Intelligence of (Casting unit) (Include bonuses)) + 125))
      • Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing 1000.00 damage of attack type Spells and damage type Normal
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Well of Souls
        • Then - Actions
          • Unit Group - Pick every unit in UnitGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of (Picked unit)) is an ally of Player 12 (Brown)) Equal to True
                • Then - Actions
                  • Set Point2 = (Position of (Picked unit))
                  • Unit - Set life of (Picked unit) to 100.00%
                  • Special Effect - Create a special effect at Point2 using Abilities\Spells\Undead\DeathPact\DeathPactTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Custom script: call RemoveLocation(udg_Point2)
                  • Custom script: set udg_Point2 = null
                • Else - Actions
                  • Set Point2 = (Position of (Picked unit))
                  • Unit - Cause (Casting unit) to damage (Picked unit), dealing (Real(Dmg)) damage of attack type Spells and damage type Normal
                  • Special Effect - Create a special effect at Point2 using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Custom script: call RemoveLocation(udg_Point2)
                  • Custom script: set udg_Point2 = null
        • Else - Actions
      • Custom script: call RemoveLocation(udg_Point)
      • Custom script: set udg_Point = null
      • Custom script: call DestroyGroup( udg_UnitGroup)
      • Custom script: set udg_UnitGroup = null

I am also interested in adding an action that would create more spirit units out of each unit killed by the spell. Is that possible, or would I need another trigger?
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
yes that removes the leaks but u should do what almia said. that way u dont have 2 of the same actions.

also u dont have to but its my opinion that all temp variables should be named tempVariableType. for example a temp point would be tempPoint. that way its easy to tell what needs to be removed and what is there to stay in the trigger.
 
Status
Not open for further replies.
Top