Extremedesyr
New Member
- Reaction score
- 6
hey, for as far as I know i've never had a succesful stacking system, now I ended up with
but for some reason this doesnt work either, i've allso tried 3 diffrent GUI triggers but none of em worked. :/
JASS:
function Trig_ChargesAdd_Actions takes nothing returns nothing
local integer i=-1
local unit u=GetTriggerUnit()
local item it=GetManipulatedItem()
loop
set i=i+1
if GetItemType(it) == ITEM_TYPE_CHARGED and GetItemTypeId(UnitItemInSlot(u, i)) == GetItemTypeId(it) and UnitItemInSlot(u, i) != it then
call SetItemCharges( UnitItemInSlot(u, i), ( GetItemCharges(UnitItemInSlot(u, i)) + GetItemCharges(it) ) )
call RemoveItem( it )
endif
exitwhen i==5
endloop
set u=null
set it=null
endfunction
//===========================================================================
function InitTrig_ChargesAdd takes nothing returns nothing
set gg_trg_ChargesAdd = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_ChargesAdd, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddAction( gg_trg_ChargesAdd, function Trig_ChargesAdd_Actions )
endfunction
but for some reason this doesnt work either, i've allso tried 3 diffrent GUI triggers but none of em worked. :/