• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Hi, I need hardly Help with this JASS script

Status
Not open for further replies.
Level 4
Joined
Nov 3, 2004
Messages
79
Hello i need help with this Jass script its a system "when a unit gets 3 items from type campaign each next gets dropped" pls i need badly help!
JASS:
function Trig_DropOnGet3 takes nothing returns nothing
    local integer CountItemSlots = 1
    local integer CountReagsInventory
    local item ReagMani = GetManipulatedItem()
    local unit manipulator = GetManipulatingUnit()
    
    if ( GetItemType(ReagMani) == ITEM_TYPE_CAMPAIGN ) then
        loop
        exitwhen CountItemSlots == 6
        if ( CountReagsInventory == 3 ) then
            call UnitRemoveItem(manipulator, ReagMani)
            
        else
        endif
        if ( GetItemType(UnitItemInSlotBJ(manipulator, CountItemSlots)) == ITEM_TYPE_CAMPAIGN ) then
           set CountReagsInventory = CountReagsInventory + 1
        else
            
        endif
        set CountItemSlots = CountItemSlots + 1
    endloop
    else
        
    endif
endfunction

//===========================================================================
function InitTrig_Reag_System takes nothing returns nothing
    set gg_trg_Reag_System = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Reag_System, EVENT_PLAYER_UNIT_PICKUP_ITEM )
    call TriggerAddAction( gg_trg_Reag_System, function Trig_DropOnGet3 )
endfunction
 
Status
Not open for further replies.
Top