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

[Spell] Trigger fix

Status
Not open for further replies.
Level 7
Joined
Feb 23, 2020
Messages
253
This trigger works properly except for the thing that it only damages 1 target (Because of the set mana to 0).
Now my question is, how do i make this work properly?

  • Frozen Land Work
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Frozen land
    • Actions
      • Set VariableSet Frozenland_Group = (Units within Frozenland_Area[(Level of Frozen land for (Triggering unit))] of (Position of (Triggering unit)).)
      • Unit Group - Pick every unit in Frozenland_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
              • ((Picked unit) belongs to an enemy of (Owner of (Triggering unit)).) Equal to True
            • Then - Actions
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing ((Mana of (Triggering unit)) + (Real(FrozenLand_DMG[(Level of Frozen land for (Triggering unit))]))) damage of attack type Chaos and damage type Normal
              • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Set mana of (Triggering unit) to 0.00
            • Else - Actions
      • Custom script: call DestroyGroup (udg_Frozenland_Group)
 

Uncle

Warcraft Moderator
Level 63
Joined
Aug 10, 2018
Messages
6,457
As IcemanBo said, you're setting the mana of the casting unit to 0.00 for EACH picked unit. So if the spell hit 10 enemy units, you're setting your caster's mana to 0, 10 times in a row! Maybe you meant to set the mana of the PICKED unit to 0?

If not, try moving "set mana to 0.00" to the very bottom of the trigger, under "DestroyGroup". Also, note that you're leaking a Point when you reference "Position of triggering unit" AND "Position of picked unit".
 
Level 7
Joined
Feb 23, 2020
Messages
253
Thank you both for your response!
And thanks @Uncle for pointing out that leak :)
 
Last edited:
Status
Not open for further replies.
Top