• 🏆 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] Dispell Magic

Status
Not open for further replies.
Level 4
Joined
Aug 31, 2011
Messages
88
Hi, guys I need a help with this trigger.

So what a trigger does:

If a unit has a specific buff in this case "Wild Growth" this spells will consume this buff and heal a unit for 100 hp, while also removing all other buffs/debuffs.

If a unit doesn't have the buff it will function as normal dispell magic spell.


  • Revitalize
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Cleanse
    • Actions
      • Unit Group - Pick every unit in (Units within 200.00 of (Target point of ability being cast)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Target unit of ability being cast) has buff Wild Growth ) Equal to True
            • Then - Actions
              • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 100.00)
              • Unit - Remove All buffs from (Target unit of ability being cast)
            • Else - Actions
              • Unit - Remove All buffs from (Target unit of ability being cast)


The problem is, that this trigger in game does absolutely nothing. -.-"

Any help?
 
Level 9
Joined
Dec 12, 2007
Messages
489
change all of "Target unit of ability being cast" below the loop - actions to "Picked unit"

so that it looks like:

Pick every unit in (Units within 200.00 of Target point of ability being cast) then
- Loop actions
- - If
- - - Picked unit has buff "X" equal to true
- - then
- - - Set life of picked unit to (life of picked unit) + 100.
- - - Remove all buffs from picked unit
- - else
- - - Remove all buffs from picked unit

you can move the remove all buffs before "if" as it will be executed regardless the if output.
and your trigger leaks location, you should store that "Target point of ability being cast to variable first then remove it after use.
 
Last edited:
Level 20
Joined
Feb 23, 2014
Messages
1,264
change all of "Target unit of ability being cast" below the loop - actions to "Picked unit"
Basically this.

The reason why your trigger doesn't work is because "Target unit of ability being cast" refers to a unit that was specifically targeted by an ability - in your case it appears that you are targeting an area instead.

Another thing is, your trigger leaks both a unit group and a location. You should remove that.

This will help you:
Things That Leak

Overall, I'd do something like this:
  • Set PointTemp = (Target point of ability being cast)
  • Set UnitGroupTemp = Units within 200.00 of PointTemp
  • Custom script: call RemoveLocation (udg_PointTemp)
  • Unit Group - Pick every unit in UnitGroupTemp and do Actions
    • <your actions>
  • Custom script: call DestroyGroup (udg_UnitGroupTemp)
 
Status
Not open for further replies.
Top