HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Detecting channel stop

10-18-2006, 06:19 PM#1
The_AwaKening
I'm looking for a way to stop a stop a loop when a unit finishes casting earthquake. I did this:

call TriggerRegisterUnitEvent(T,c,EVENT_UNIT_SPELL_FINISH)

but it only seems to work when the ability timer expires. If I stop the earthquake short of it's duration, the loop still continues until timer expires.

I also tried checking the casting unit for exitwhen GetUnitAbilityLevel(c,'BOea')<1 which is supposed to be the buff for the caster, but apparently it's not working either

any ideas?
10-18-2006, 06:22 PM#2
Vexorian
EVENT_UNIT_SPELL_ENDCAST
10-18-2006, 06:26 PM#3
The_AwaKening
Great thanks. Didn't know that one existed.

Edit:
ERR, spoke too soon. This seems to have the same effect. Doesn't end till timer expires for the ability.
10-18-2006, 06:51 PM#4
BertTheJasser
A trrigger with that event will even fire when you endcast a non channel-interrupting spell (Manashield,immolation,windwalk,berserk,..).

To fix that, just add a condition like:
Collapse JASS:
function cond takes nothing returns boolean
return GetSpellAbilityId()=='yourspellidhere'
endfunction
10-18-2006, 07:06 PM#5
The_AwaKening
Ya, sorry guys. I found another problem with my loop that was the actual cause. My apologies.
10-18-2006, 07:14 PM#6
BertTheJasser
Even if you had another issue, your way of detecting is another issue (except you check for unit current order) which might explain some crazyness behaveior of your code.
10-19-2006, 12:51 AM#7
The_AwaKening
I never gave you my entire code. I already had the boolexpr filter in place to check for the spellabilityid. My problem was that I was retrieving a stored gamecache incorrectly in part of it.
10-19-2006, 04:50 PM#8
BertTheJasser
So, you should always post your code you have problems with, so guys like me can easiliy specify what caused the bug and correct if it is required.
Oh well.. problem solved.