• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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?
 
Status
Not open for further replies.
Top