• 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.

Ability wont stop working

Status
Not open for further replies.
Level 17
Joined
Apr 24, 2005
Messages
762
This ability has worked fine before, but now suddenly it started acting weird. Its based on the Berserk ability and when the hero activates it, it adds the Healing Ward buff to the hero, healing units around it for 10 secs. When the berserk buff goes away it should remove the healing. The problem is, sometimes it wont stop healing.. What could cause that?
  • Moon Heal L1
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Moonlight Healing
      • (Integer((Real((Level of Moonlight Healing for (Triggering unit)))))) Equal to 1
    • Actions
      • Set MoonRegenCaster = (Casting unit)
      • Unit - Add Healing L1 to MoonRegenCaster
      • Environment - Create at (Entire map) the weather effect Rays Of Moonlight
      • Set RegenEffect = (Last created weather effect)
      • Environment - Turn RegenEffect On
      • Trigger - Turn on Moon Regen Stop <gen>
  • Moon Regen Stop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Integer((Real((Level of Moonlight Healing for MoonRegenCaster))))) Equal to 1
          • (MoonRegenCaster has buff Regen L1 ) Equal to False
        • Then - Actions
          • Unit - Remove Moon Regen L1 from MoonRegenCaster
          • Environment - Turn RegenEffect Off
          • Game - Display to (All players) the text: test
          • Trigger - Turn off (This trigger)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Integer((Real((Level of Moonlight Healing for MoonRegenCaster))))) Equal to 2
          • (MoonRegenCaster has buff Regen L2 ) Equal to False
        • Then - Actions
          • Unit - Remove Moon Regen L2 from MoonRegenCaster
          • Environment - Turn RegenEffect Off
          • Game - Display to (All players) the text: test 2
          • Trigger - Turn off (This trigger)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Integer((Real((Level of Moonlight Healing for MoonRegenCaster))))) Equal to 3
          • (MoonRegenCaster has buff Regen L3 ) Equal to False
        • Then - Actions
          • Unit - Remove Moon Regen L3 from MoonRegenCaster
          • Environment - Turn RegenEffect Off
          • Game - Display to (All players) the text: test 3
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Try this:
  • trigger1
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Moonlight Healing
  • Actions
    • Unit Group - Add (Triggering unit) to MoonlighGroup
    • Unit - Add Healing (Ability) to (Triggering unit)
    • Unit - Set level of Healing (ability) to (Level of (Ability being cast) for (Triggering unit))
    • Environment - Create at (Entire map) the weather effect Rays Of Moonlight
    • Set RegenEffect = (Last created weather effect)
    • Environment - Turn RegenEffect On
    • Trigger - Turn on Moon Regen Stop <gen>
  • Moon Regen Stop
  • Events
    • Time - Every 0.10 seconds of game-time
  • Conditions
  • Actions
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (MoonlightGroup is empty) Equal to False
      • Then - Actions
        • Unit Group - Pick every unit in MoonlightGroup and do (Actions)
          • Loop - Actions
            • If (All conditions are true) then do (Actions) else do (Actions)
              • If - Conditions
                • (Picked unit has buff Healing) Equal to False
              • Then - Actions
                • Unit Group - Remove (Picked unit) from MoonlightGroup
                • Unit - Remove Healing (ability) from (Picked unit)
                • Environment - Turn RegenEffect Off
              • Else - Actions
        • Else - Actions
          • Trigger - Turn off (This trigger)
Just give your ward-based ability levels.

This is not MUI, if you want MUI, I can give you a solution with hashtables. Not much will change, we will just save the Weather effect to the unit for MUI reasons.
 
Status
Not open for further replies.
Top