HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How to detect the Stop order??

08-13-2006, 03:38 PM#1
moyack
Hi:

I was trying to find in the forums section how to detect the stop order in a unit, but I couldn't find it.

I have one spell that makes a loop, and inside that loop it checks if the unit has been stunned, is alive, etc. But now I need to detect the STOP order. This is the function that I've created in order to detect the caster status:

Collapse JASS:
function CheckConditions takes timer Tempo, unit CasterUnit, integer SpellAb returns real
    local real value = TimerGetRemaining(Tempo)
    // checks if the caster has been stunned 
    if UnitHasBuffBJ(CasterUnit, 'BSTN') or UnitHasBuffBJ(CasterUnit, 'BPSE') or UnitHasBuffBJ(CasterUnit, 'BHtb') then
        set value = 0.00
    endif 
    if GetSpellAbilityId() != SpellAb then // checks if the caster starts other ability
        set value = 0.00
    endif
    if IsUnitDeadBJ(CasterUnit) then // checks if the caster is dead
        set value = 0.00
    endif
    return value
endfunction

In theory, GetSpellAbilityId() should detect if the stop button has been activated, but it doesn't.

I browsed in the function list and I found that function:
Collapse JASS:
constant native GetIssuedOrderId takes nothing returns integer

So the only thing that I should do is to add that condition to my function:

Collapse JASS:
    if GetIssuedOrderId() != 'Stop ID' then // ?????
        set value = 0.00
    endif

So the question is: Which is the STOP code ID???

And I have other question: You can see in the stunned condition that I do a buff comparation, in order to detect the storm bolt and the stunned buffs.
  • Is there a shorter way to detect the stunned status??
  • Are there more buffs that stops channeling spells???
Thanks for your help
08-13-2006, 03:41 PM#2
|)@rk-Revenant
Perhaps you should make a simple GUI trigger that just detects a stop, convert it to JASS, then rip the code from that.

I don't use JASS, so I might not be correct.
08-13-2006, 04:02 PM#3
moyack
I've already tried that, but it doesn't give me the STOP order ID.
08-13-2006, 04:19 PM#4
blu_da_noob
Go into the game and order a unit to stop with a trigger which prints out the order id.
08-13-2006, 04:26 PM#5
Naakaloh
Perhaps you could mention your objective, it seems like you're trying to stop a channeling spell? There might be a more simple alternative.

But anyway:

Collapse JASS:
call BJDebugMsg(I2S(OrderId("stop")))

That should display 851972. Also, you could use Blade.dk's ConvOrder utility in the tools section.



Edit: To your second thing, I've never tried this, but you could try it:

Collapse JASS:
IsUnitType(whichUnit, UNIT_TYPE_STUNNED)
08-13-2006, 09:53 PM#6
moyack
My idea is to detect if a caster has given the stop or move order, in order to "detect" if the caster unit stops casting the spell (sorry if I sound redundant :P)

At the moment, I order my caster unit to change the action and the custom spell keeps working, a terrible bug that I need so solve.

I'll try the functions you gave me, thanks :)
08-14-2006, 12:49 AM#7
Naakaloh
Well, you could try using a different trigger to stop the effect of the other one. EVENT_PLAYER_UNIT_SPELL_ENDCAST.
08-14-2006, 08:28 PM#8
BertTheJasser
Or you just could check, if the units current order is not the the order of the channeling spell.