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

[Solved] Unit expiration timer (Pause/Unpause)

Status
Not open for further replies.
Level 2
Joined
Jun 5, 2012
Messages
18
Hi everyone,
First, sorry if this question already have been answered :/

When a necromancer summon a skeleton warrior, i want that, when he stands on blight, his expiration timer stop.
  • pause
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (playable area)) and do actions
        • Loop - Actions
          • If (All conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Piked unit) has buff skeleton servant) Equal to TRUE
              • (Position of (Picked Unit)) is Blighted) Equal to TRUE
            • Then - Actions
              • Unit - Pause the expiration timer for (Picked unit)
            • Else - Actions
              • Unit - Unpause the expiration timer for (Picked unit)
But there is my problem.
When the skeletton enters blighted area, le expiration timer stop as requested, but, after a while, the "cooldown" (blue bar decreasing) disapear and don't shop up again when leaving area.
I've try creating another expiration timer, but no luck...

Do you have any ideas how to avoid this problem ?

Thanks
PS: sorry if my english is bad
 
Level 21
Joined
Dec 4, 2007
Messages
1,477
The problem lies in continually pausing the expiration timer.

Here is a quick fix by using a dummy ability:
  • ExpirationPausing
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set temp_unitgroup = (Units in (Playable map area))
      • Unit Group - Pick every unit in temp_unitgroup and do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Position of (Picked unit)) is blighted) Equal to (==) True
              • ((Picked unit) is Summoned) Equal to (==) True
              • (Level of Critical Strike (Neutral Hostile) for (Picked unit)) Less than (<) 1
            • Then - Actions
              • Unit - Pause the expiration timer for (Picked unit)
              • Unit - Add Critical Strike (Neutral Hostile) to (Picked unit)
            • Else - Actions
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Position of (Picked unit)) is blighted) Equal to (==) False
                  • ((Picked unit) is Summoned) Equal to (==) True
                  • (Level of Critical Strike (Neutral Hostile) for (Picked unit)) Greater than or equal to (>=) 1
                • Then - Actions
                  • Unit - Unpause the expiration timer for (Picked unit)
                  • Unit - Remove Critical Strike (Neutral Hostile) from (Picked unit)
                • Else - Actions
      • Custom script: call DestroyGroup(udg_temp_unitgroup)
 
Level 2
Joined
Jun 5, 2012
Messages
18
Well; thanks a lot :)
but i couldn't imagine pausing too many times would do that
I could've search a long time
 
Status
Not open for further replies.
Top