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

[Trigger] Can't get a spell trigger to work

Status
Not open for further replies.
Level 1
Joined
Jun 13, 2012
Messages
5
I pretty much signed up today, so howdy Hive. I have been around here for quite some time, but I haven't thought of joining until now that I find map-creating interesting.

So here's the deal. In my map I have a fire elemental hero, who has an ability called Fulmination. This ability is based off of the Inferno ability, so it damages and stuns but it also summons something - in this case a circle of flame. The circle damages enemies in the circle with an perm. Immolation aura and the such, nothing special here. My idea was that if the fire elemental used the ability on him OR simply walked through the circle of flame, he would consume the circle in order to heal him, so I made these triggers.

(Some things like the distances and healing done isn't done yet, but that is most likely irrelevant to what is causing the problem here.)

Everything works just fine - if the fire elemental is in the radius of the initial explosion he gains the healing as intended and the circle disappears. No other units can trigger this as well due to of his passive aura I gave him.
Everything is working except for one thing: If he simply walks into the circle, the circle disappears as normal (and still only the fire elemental can do this), but there is no healing. I simply have no idea what I'm doing wrong, so I'm asking you people if you have a solution to this.

And to be clear, I'm not looking for an improved trigger that is in every way better than mine, I know it has flaws and I'm horrible at this stuff generally. I only want to know why my heal isn't setting off and what could be the most logical solution to it.

With that said, here are the triggers used for this.

Thanks a lot.

  • Circle of Flame Fix
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Trigger - Turn off Circle of Flame Heal2 <gen>
  • Circle of Flame Heal
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • ((Summoning unit) has buff Ashes To Ashes ) Equal to True
      • Or - Any (Conditions) are true
        • Conditions
          • (Real((Level of Fulmination for (Summoning unit)))) Equal to 1.00
          • (Real((Level of Fulmination for (Summoning unit)))) Equal to 2.00
          • (Real((Level of Fulmination for (Summoning unit)))) Equal to 3.00
    • Actions
      • Set TempUnit = (Summoned unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between (Position of (Summoning unit)) and (Position of TempUnit)) Less than or equal to 125.00
        • Then - Actions
          • Unit - Kill TempUnit
          • If ((Real((Level of Fulmination for (Summoning unit)))) Equal to 1.00) then do (Unit - Set life of (Summoning unit) to ((Life of (Summoning unit)) + (0.10 x ((Max life of (Summoning unit)) - (Life of (Summoning unit)))))) else do (Do nothing)
          • If ((Real((Level of Fulmination for (Summoning unit)))) Equal to 2.00) then do (Unit - Set life of (Summoning unit) to ((Life of (Summoning unit)) + (0.20 x ((Max life of (Summoning unit)) - (Life of (Summoning unit)))))) else do (Do nothing)
          • If ((Real((Level of Fulmination for (Summoning unit)))) Equal to 3.00) then do (Unit - Set life of (Summoning unit) to ((Life of (Summoning unit)) + (0.30 x ((Max life of (Summoning unit)) - (Life of (Summoning unit)))))) else do (Do nothing)
        • Else - Actions
          • Hashtable - Create a hashtable
          • Hashtable - Save Handle Of(Summoned unit) as 10 of 1 in (Last created hashtable)
          • Trigger - Turn on Circle of Flame Heal2 <gen>
  • Circle of Flame Heal2
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set TempUnit = (Load 10 of 1 in (Last created hashtable))
      • Unit Group - Pick every unit in (Units within 150.00 of (Position of TempUnit) matching (((Matching unit) has buff Ashes To Ashes ) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Matching unit) to (Max life of (Matching unit))
          • Unit - Kill TempUnit
          • Hashtable - Clear (Last created hashtable)
          • Trigger - Turn off (This trigger)
 
Level 4
Joined
Oct 20, 2011
Messages
129
A simple single error...
After picking an unit, it's Picked Unit, not Matching Unit.
  • Unit - Set life of (Picked unit) to (Max life of (Picked unit))
Edit: You don't need to turn off the trigger in map init. You can turn off it when editing the map.
Edit2: Your spell isn't MUI, it causes bug when casting it second time.
Solve: Use unit group instead of Hashtable.
Replace this
  • Hashtable - Create a hashtable
  • Hashtable - Save Handle Of(Summoned unit) as 10 of 1 in (Last created hashtable)
  • Trigger - Turn on Circle of Flame Heal2 <gen>
with this
  • Unit group - Add (Summoned unit) to FlameGroup
  • Trigger - Turn on Circle of Flame Heal2 <gen>
  • Unit Group - Pick every unit in FlameGroup and do (Actions)
    • Loop - Actions
      • Set TempUnit = (Picked unit)
      • Set TempLoc = (Position of TempUnit)
      • Unit Group - Pick every unit in (Units within 150.00 of TempLoc matching (((Matching unit) has buff Ashes To Ashes ) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to (Max life of (Picked unit))
          • Unit - Kill TempUnit
          • Unit Group - Remove TempUnit from FlameGroup
      • Custom script: call RemoveLocation(udg_TempLoc)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Number of units in FlameGroup) Equal to 0
      • Then - Actions
        • Trigger - Turn off (This trigger)
Edit3: If your Fire Elemental unit summons another unit with another spell, that summoned unit can heal the hero too.
Solve: Replace this
  • Or - Any (Conditions) are true
  • Conditions
  • (Real((Level of Fulmination for (Summoning unit)))) Equal to 1.00
  • (Real((Level of Fulmination for (Summoning unit)))) Equal to 2.00
  • (Real((Level of Fulmination for (Summoning unit)))) Equal to 3.00
with this
  • (Unit type of (Summoned Unit)) Equal to Flame Circle
 
Last edited:
Level 1
Joined
Jun 13, 2012
Messages
5
I'm afraid I don't know much about triggers in general, so no. What would you think would remove the leaks?
 
Status
Not open for further replies.
Top