NEVER EVER EVER EVER EVER EVER use waits INSIDE a LOOP.
Just so you will never ever ever EVER forget it.
To make a new discussion between us 3
Let's head on.
Waits continue to run while the game is paused.
You can start a 60 seconds wait, alt+tab (the game is paused), wait a minute in real time, go back to WC3 and you will see that the wait has ended as soon as you unpause it.
That is why you want to use Wait Timers.
-
Wait 2.00 seconds
-
Wait 2.00 game-time seconds
JASS:
//This is the first.
native TriggerSleepAction takes real timeout returns nothing
//This is the second.
function PolledWait takes real duration returns nothing
local timer t
local real timeRemaining
if (duration > 0) then
set t = CreateTimer()
call TimerStart(t, duration, false, null)
loop
set timeRemaining = TimerGetRemaining(t)
exitwhen timeRemaining <= 0
// If we have a bit of time left, skip past 10% of the remaining
// duration instead of checking every interval, to minimize the
// polling on long waits.
if (timeRemaining > bj_POLLED_WAIT_SKIP_THRESHOLD) then
call TriggerSleepAction(0.1 * timeRemaining)
else
call TriggerSleepAction(bj_POLLED_WAIT_INTERVAL)
endif
endloop
call DestroyTimer(t)
endif
endfunction
You can see that there is definately difference between those.
But that is not the reason why you may not use them in loops.
The reason is that they are inaccurate.
When you wait '2' seconds, you actuall wait between 2.04 and 2.19 seconds.
In a loop that difference increases dramatically.
What you want to do is more like a damage over time... but then a heal.
Just wait a few minutes.
EDIT:
Does this kind of fits your needs?
(Yes I use a heal of 10 every 0.5 seconds for 5 seconds.
It is calculated at the bottom of the Roar Cast trigger.
You can change that to whatever you want.)