Vulcansurge
Ultra Cool Member
- Reaction score
- 27
HEre is my code:
I know its messy, things need to be fixed and im new at this. This code it used to make little ships at the position of a hero when he aquires a specfic item. But they dont get created...
Code:
//===========================================================================
// AQUIRE SHIPS
//===========================================================================
function Trig_ShipAquireJASS_Actions takes nothing returns nothing
local unit um=GetManipulatingUnit()
local integer i=GetItemTypeId(GetManipulatedItem())
local player pl=GetOwningPlayer(um)
local location pt=GetUnitLoc(um)
local integer l=0
local integer n=0
local integer array it
local integer array ut
local integer array ua
local unit array up
set it[1]='I001'
set it[2]='I000'
set it[3]='I002'
set it[4]='I005'
set it[5]='I008'
set it[6]='I007'
set it[7]='I006'
set ut[1]='H000'
set ut[2]='H001'
set ut[3]='H003'
set ut[4]='H002'
set ut[5]='H00F'
set ut[6]='H004'
set ut[7]='H005'
set ua[1]=10
set ua[2]=6
set ua[3]=8
set ua[4]=6
set ua[5]=1
set ua[6]=3
set ua[7]=5
loop
set l=l+1
if (i==it[l]) then
loop
set n=n+1
call CreateNUnitsAtLoc(1,ut[l],pl,pt,100)
set up[n]=GetLastCreatedUnit()
exitwhen n==ua[l]
endloop
set n=0
endif
exitwhen (i==it[l])
endloop
endfunction
//===========================================================================
function InitTrig_ShipAquireJASS takes nothing returns nothing
set gg_trg_ShipAquireJASS = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_ShipAquireJASS, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddAction( gg_trg_ShipAquireJASS, function Trig_ShipAquireJASS_Actions )
endfunction
I know its messy, things need to be fixed and im new at this. This code it used to make little ships at the position of a hero when he aquires a specfic item. But they dont get created...