HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

GetIssuedOrderItem

07-12-2008, 04:20 AM#1
Vexorian
If a unit was ordered to use an item, returns such item. Why is this useful? Perhaps you are coding InvX or something?

Collapse JASS:
function GetIssuedOrderItem takes nothing returns item
    if not (GetIssuedOrderId() >= 852008) and (GetIssuedOrderId() <= 852013) then
        return null
    endif
    return(UnitItemInSlot(GetTriggerUnit(), (GetIssuedOrderId()-852008)))
endfunction
07-12-2008, 04:38 AM#2
Here-b-Trollz
Uhh, perhaps it would be more friendly if it was like... 'GetDraggedItem' or some such? I remember using this type of stuff for WMI. I thought it was 852002 though... But usually you had to know the slot it was in and such and stuff like that too... like:

Collapse JASS:
local integer order=GetIssuedOrderId()
local integer dropslot=order-852002
local unit u=GetOrderedUnit()
local item drag=UnitItemInSlot(u,dropslot)
local item drop=GetOrderTargetItem()

After looking at WMI, I'm positive it was 852002, so either this doesn't do what I thought it did, or WMI works for absolutely no reason.
07-12-2008, 04:49 AM#3
Rising_Dusk
852002-852007 are for dragging and dropping items in your inventory (moveslot), 852008-852013 are orders that force units to use items in specified slots. Read more here. This function is for GetIssuedOrderItem(), so it will run from ..08-..13 for its orders.

It would also be cute if you had a GetIssuedDragItem() too.
07-12-2008, 05:05 AM#4
Here-b-Trollz
Oh okay. I was confused then.
07-12-2008, 05:35 PM#5
Rising_Dusk
Does what it says it does, which apparently seems to be the only criteria for approving scripts, so approved.