• 🏆 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!

[Trigger] Custom Spell Not Picking Creeps

Status
Not open for further replies.
Level 18
Joined
Mar 16, 2008
Messages
721
This trigger/spell picks units around it, plays animations, and cuts picked units health in half. Only problem is that it doesn't seem to pick creeps. Anyone have any insight? It's intended to do 'friendly fire' as well as damage against enemies.

Fire Golem, Leviathan, Storm, Penguin King are unique 'bosses' that I don't want to be affected by this spell. They are owned by Natural Hostile so I tried removing those conditions but it still didn't seem to pick creeps. I have no clue why. I actually tested removing all the conditions and it has no effect.

Also, side note, I couldn't figure out how the more advanced trigger functions so I just made a trigger and variables for each potentially casting player. However that's not the purpose of this thread. The purpose of this tread is to try and figure out why it's not picking creeps.

Thank you for taking the time to look at this.

  • Death Rit Cast Yello
    • Events
      • Unit - A unit owned by Player 5 (Yellow) Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Death Ritual
    • Actions
      • Animation - Play (Triggering unit)'s Stand Victory animation
      • Unit Group - Pick every unit in (Units within 750.00 of (Position of (Triggering unit)).) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A structure) Equal to False
              • (Unit-type of (Picked unit)) Equal to Fire Golem
              • (Unit-type of (Picked unit)) Equal to Leviathan
              • (Unit-type of (Picked unit)) Equal to Storm
              • (Unit-type of (Picked unit)) Equal to Penguin King
            • Then - Actions
              • Set VariableSet DeathRitInteger_Var_Yel = (DeathRitInteger_Var_Yel + 1)
              • Set VariableSet DeathRitTar_Var_Yel[DeathRitInteger_Var_Yel] = (Picked unit)
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Demon\DarkConversion\ZombifyTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Set VariableSet DeathRitEfx_Var_Yel[DeathRitInteger_Var_Yel] = (Last created special effect)
            • Else - Actions
      • Set VariableSet DeathRitCasterPt_Var_Yel = (Position of (Triggering unit))
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (0.00, 750.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (0.00, -750.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (530.00, 530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (-530.00, -530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (750.00, 0.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (-750.00, 0.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (-530.00, 530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (530.00, -530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 0.50 seconds
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (0.00, 750.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (0.00, -750.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (530.00, 530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (-530.00, -530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (750.00, 0.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (-750.00, 0.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (-530.00, 530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (530.00, -530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 0.50 seconds
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (0.00, 750.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (0.00, -750.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (530.00, 530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (-530.00, -530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (750.00, 0.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (-750.00, 0.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (-530.00, 530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (530.00, -530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 0.50 seconds
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (0.00, 750.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (0.00, -750.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (530.00, 530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (-530.00, -530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (750.00, 0.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (-750.00, 0.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (-530.00, 530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (530.00, -530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_DeathRitCasterPt_Var_Yel)
      • Wait 0.50 seconds
      • Animation - Reset (Triggering unit)'s animation
      • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • For each (Integer DeathRitInteger_Var_Yel) from 1 to DeathRitInteger_Var_Yel, do (Actions)
        • Loop - Actions
          • Special Effect - Destroy DeathRitEfx_Var_Yel[DeathRitInteger_Var_Yel]
          • Set VariableSet DeathRitInteger_Var_Yel = (DeathRitInteger_Var_Yel - 1)
      • Unit Group - Pick every unit in (Units within 750.00 of (Position of (Triggering unit)).) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A structure) Equal to False
              • (Unit-type of (Picked unit)) Equal to Fire Golem
              • (Unit-type of (Picked unit)) Equal to Leviathan
              • (Unit-type of (Picked unit)) Equal to Storm
              • (Unit-type of (Picked unit)) Equal to Penguin King
            • Then - Actions
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Demon\DarkConversion\ZombifyTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) / 2.00)
            • Else - Actions
      • Set VariableSet DeathRitInteger_Var_Yel = 0
 
Last edited:

Cokemonkey11

Spell Reviewer
Level 29
Joined
May 9, 2006
Messages
3,534
1639521602481.png


It says here "all conditions are true"

A unit can have only one type, so no unit will match two different unit-type conditions

Instead, you should use "any - multiple conditions" and nest the unit-type conditions inside of the "any"

Something to study and think about perhaps: De Morgan's Laws | Brilliant Math & Science Wiki
 
Level 18
Joined
Mar 16, 2008
Messages
721
Thank you for taking the time to look through my trigger and thank you for your reply and that link is actually pretty interesting.

You got me thinking and 'any' could have some problems too perhaps...? That is part of a loop function so if a unit is to be picked, I want them to meet all of those criteria. I think I'll revise to be "not equal to" Fire Golem, etc.
 
Level 18
Joined
Mar 16, 2008
Messages
721
I made some minor changes and it still does not seem to be reducing nearby picked units hp by half. The odd thing is that this was working a few months ago.

  • Death Rit Cast Yel
    • Events
      • Unit - A unit owned by Player 5 (Yellow) Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Death Ritual
    • Actions
      • Animation - Play (Triggering unit)'s Stand Victory animation
      • Unit Group - Pick every unit in (Units within 750.00 of (Position of (Triggering unit)).) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A structure) Equal to False
              • (Unit-type of (Picked unit)) Not equal to Fire Golem
              • (Unit-type of (Picked unit)) Not equal to Leviathan
              • (Unit-type of (Picked unit)) Not equal to Storm
              • (Unit-type of (Picked unit)) Not equal to Penguin King
            • Then - Actions
              • Set VariableSet DeathRitInteger_Var_Yel = (DeathRitInteger_Var_Yel + 1)
              • Set VariableSet DeathRitTar_Var_Yel[DeathRitInteger_Var_Yel] = (Picked unit)
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Demon\DarkConversion\ZombifyTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Set VariableSet DeathRitEfx_Var_Yel[DeathRitInteger_Var_Yel] = (Last created special effect)
            • Else - Actions
      • Set VariableSet DeathRitCasterPt_Var_Yel = (Position of (Triggering unit))
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (0.00, 750.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (0.00, -750.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (530.00, 530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (-530.00, -530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (750.00, 0.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (-750.00, 0.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (-530.00, 530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (530.00, -530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 0.50 seconds
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (0.00, 750.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (0.00, -750.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (530.00, 530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (-530.00, -530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (750.00, 0.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (-750.00, 0.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (-530.00, 530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (530.00, -530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 0.50 seconds
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (0.00, 750.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (0.00, -750.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (530.00, 530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (-530.00, -530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (750.00, 0.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (-750.00, 0.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (-530.00, 530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (530.00, -530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 0.50 seconds
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (0.00, 750.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (0.00, -750.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (530.00, 530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (-530.00, -530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (750.00, 0.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (-750.00, 0.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (-530.00, 530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitCasterPt_Var_Yel offset by (530.00, -530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 0.50 seconds
      • Animation - Reset (Triggering unit)'s animation
      • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • For each (Integer DeathRitInteger_Var_Yel) from 1 to DeathRitInteger_Var_Yel, do (Actions)
        • Loop - Actions
          • Special Effect - Destroy DeathRitEfx_Var_Yel[DeathRitInteger_Var_Yel]
          • Set VariableSet DeathRitInteger_Var_Yel = (DeathRitInteger_Var_Yel - 1)
      • Unit Group - Pick every unit in (Units within 750.00 of DeathRitCasterPt_Var_Yel.) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A structure) Equal to False
              • (Unit-type of (Picked unit)) Not equal to Fire Golem
              • (Unit-type of (Picked unit)) Not equal to Leviathan
              • (Unit-type of (Picked unit)) Not equal to Storm
              • (Unit-type of (Picked unit)) Not equal to Penguin King
            • Then - Actions
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Demon\DarkConversion\ZombifyTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) / 2.00)
            • Else - Actions
      • Custom script: call RemoveLocation(udg_DeathRitCasterPt_Var_Yel)
      • Set VariableSet DeathRitInteger_Var_Yel = 0
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
Is this trigger supposed to be MUI? Or will only 1 instance of this ability exist at a time? Also, how exactly did you want it to work? Because right now it only cuts the hp of units that are near the caster after 2.00 seconds. It doesn't care about the units that were nearby when you first cast the spell.

Also, none of this stuff is needed:
  • Special Effect - Destroy (Last created special effect)
  • Set VariableSet DeathRitEfx_Var_Yel[DeathRitInteger_Var_Yel] = (Last created special effect)
Why are you storing a Destroyed Special Effect?

There's no reason to index anything:
  • Set VariableSet DeathRitInteger_Var_Yel = (DeathRitInteger_Var_Yel + 1)
And because of that you don't need the For Loop:
  • For each (Integer DeathRitInteger_Var_Yel) from 1 to DeathRitInteger_Var_Yel, do (Actions)
 
Last edited:
Level 18
Joined
Mar 16, 2008
Messages
721
@Uncle, I wanted it to be MUI but those options were too confusing so I re-created this trigger for each player.

The intended outcome is two seconds after the spells is cast, units in range HP is halved. Animations would play for two seconds to give an opportunity for units to move out of range, avoiding any damage.

Right now it doesn't even seem to half units' HP, I'm not sure why, I swear this was working when I was last working on this map/trigger.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
Create a new Point variable (or rename DeathRitCasterPt_Var_Yel), call it DeathRitPoint, and at the start of the trigger do this:
  • Actions
  • Custom script: local location udg_DeathRitPoint = GetUnitLoc(GetTriggerUnit())
You can now reference this Variable after Waits without any issues and it's completely MUI. The only catch with this method is that you cannot use DeathRitPoint in a Condition of an If Then Else statement (you aren't doing this here so this is more of a warning for the future).

Lastly, at the very end of the trigger, you should not only Remove DeathRitPoint but Null it as well because it's a local variable:
  • Custom script: call RemoveLocation(udg_DeathRitPoint)
  • Custom script: set udg_DeathRitPoint = null

(Triggering unit) is a safe to use Event Response after Waits so that's fine the way it is. If you want to get the casting Player then use (Owner of (Triggering unit)).

You only need 1 Trigger to make this MUI and work for everyone:
  • Events
  • Unit - A unit starts the effect of an ability
  • Conditions
  • (Ability being cast) Equal to Death Ritual
  • Actions
  • Custom script: local location udg_DeathRitPoint = GetUnitLoc(GetTriggerUnit())
  • // do sfx stuff
  • Wait 0.50 seconds
  • // do sfx stuff
  • Wait 0.50 seconds
  • // do sfx stuff
  • Wait 0.50 seconds
  • // do sfx stuff
  • Wait 0.50 seconds
  • // pick nearby units and halve their hp
  • Custom script: call RemoveLocation(udg_DeathRitPoint)
  • Custom script: set udg_DeathRitPoint = null
Note that your Pick Every Unit function is leaking a Unit Group. You should set, use, and destroy a Unit Group variable to avoid this. Also, make sure to always reference DeathRitPoint and not (Position of (Triggering unit)).

Local variable method described here: local udg_
 
Last edited:
Level 18
Joined
Mar 16, 2008
Messages
721
I am studying and implementing your post. Thank you.

So how should I set a local unit group variable for the pick every unit in range part? We need a local group variable to make it MUI?

  • Unit Group - Pick every unit in (Units within 750.00 of DeathRitPoint_Var.) and do (Actions)
    • Loop - Actions
      • Unit Group - Add (Picked unit) to DeathRitUnitGrp_Var
  • Unit Group - Pick every unit in DeathRitUnitGrp_Var and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) is A structure) Equal to False
          • (Unit-type of (Picked unit)) Not equal to Fire Golem
          • (Unit-type of (Picked unit)) Not equal to Leviathan
          • (Unit-type of (Picked unit)) Not equal to Storm
          • (Unit-type of (Picked unit)) Not equal to Penguin King
        • Then - Actions
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Demon\DarkConversion\ZombifyTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) / 2.00)
        • Else - Actions
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
This is the only local variable you'll use in the trigger:
  • Custom script: local location udg_DeathRitPoint = GetUnitLoc(GetTriggerUnit())
This is the position of the caster. It's a local variable which means that you don't have to worry about it changing it's value.

This is how you do the Pick Every Unit stuff:
  • Set Variable DeathRitUnitGrp_Var = (Units within 750.00 of DeathRitPoint_Var)
  • Unit Group - Pick every unit in DeathRitUnitGrp_Var and do (Actions)...
  • Custom script: call DestroyGroup(udg_DeathRitUnitGrp_Var)
 
Level 18
Joined
Mar 16, 2008
Messages
721
hey sorry to necro but this trigger randomly stopped playing the sfx stuff but i didn't change anything???

  • Death Ritual Cast All
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Death Ritual
    • Actions
      • Custom script: local location udg_DeathRitPoint_Var = GetUnitLoc(GetTriggerUnit())
      • Animation - Play (Triggering unit)'s Stand Victory animation
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (0.00, 750.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (0.00, -750.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (530.00, 530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (-530.00, -530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (750.00, 0.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (-750.00, 0.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (-530.00, 530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (530.00, -530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 0.50 seconds
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (0.00, 750.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (0.00, -750.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (530.00, 530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (-530.00, -530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (750.00, 0.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (-750.00, 0.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (-530.00, 530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (530.00, -530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 0.50 seconds
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (0.00, 750.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (0.00, -750.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (530.00, 530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (-530.00, -530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (750.00, 0.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (-750.00, 0.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (-530.00, 530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (530.00, -530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 0.50 seconds
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (0.00, 750.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (0.00, -750.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (530.00, 530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (-530.00, -530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (750.00, 0.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (-750.00, 0.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (-530.00, 530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (DeathRitPoint_Var offset by (530.00, -530.00)) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 0.50 seconds
      • Animation - Reset (Triggering unit)'s animation
      • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Set VariableSet DeathRitUnitGrp_Var = (Units within 750.00 of DeathRitPoint_Var.)
      • Unit Group - Remove (Triggering unit) from DeathRitUnitGrp_Var.
      • Unit Group - Pick every unit in DeathRitUnitGrp_Var and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A structure) Equal to False
              • (Unit-type of (Picked unit)) Not equal to Fire Golem (Elemental Boss)
              • (Unit-type of (Picked unit)) Not equal to Leviathan (Elemental Boss)
              • (Unit-type of (Picked unit)) Not equal to Storm (Elemental Boss)
              • (Unit-type of (Picked unit)) Not equal to Penguin King (Elemental Boss)
              • (Unit-type of (Picked unit)) Not equal to Penguin King (Elemental Boss)
            • Then - Actions
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) / 2.00)
            • Else - Actions
      • Unit - Set mana of (Triggering unit) to ((Mana of (Casting unit)) x 2.00)
      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) x 0.90)
      • Custom script: call DestroyGroup(udg_DeathRitUnitGrp_Var)
      • Custom script: call RemoveLocation(udg_DeathRitPoint_Var)
      • Custom script: set udg_DeathRitPoint_Var = null
 
Level 39
Joined
Feb 27, 2007
Messages
5,015
Upload a map here so someone other than you can test the same trigger to see if it's not working for everyone or just for you. However, my best guess is actually that you're having some sort of a driver/sound card issue. Check this thread for more discussion and possible resolutions: Special effects at a point do not work

Edit: You're also leaking a lot of points. One for every effect.
 
Status
Not open for further replies.
Top