Name | Type | is_array | initial_value |
Bullet | integer | No | |
Button | button | Yes | |
chance | integer | No | |
chancee | integer | Yes | |
EndGameButton | button | Yes | |
GameEnd | dialog | No | |
Handgun | itemcode | No | |
Kick | group | No | |
Letter1 | dialog | No | |
MH_Angle | real | No | |
MH_Level | integer | No | |
MH_Link | unit | Yes | |
MH_Links | integer | No | |
MH_Unit | unit | Yes | |
Missil_Caster | location | No | |
Missil_Colision1 | location | No | |
Missil_Colision2 | location | No | |
Missil_Colision3 | location | No | |
Missil_Count | integer | No | |
Missil_Damage | real | Yes | |
Missil_Group | group | No | |
Missil_Inicio | location | No | |
Missil_Move | location | No | |
Missil_Point | location | No | |
Missil_Real_Target | group | No | |
Missil_Target | location | No | |
PostSign | dialog | No | |
Rain | weathereffect | No | |
Temp_Group | group | No | |
Velocidade_Missil | real | Yes | |
YanMekler | timer | No |
function Combine_Items_Conditions takes nothing returns boolean
return GetItemCharges(GetManipulatedItem()) > 0
endfunction
function Combine_Items_Actions takes nothing returns nothing
local item NEWITEM = GetManipulatedItem()
local unit OURUNIT = GetManipulatingUnit()
local integer MAXIMUM = 100 //The max no. of charges allowed
local integer ITEMCOUNT = 0
local integer ITEMLOOP = 0
local integer CHARGES = 0
loop
exitwhen ITEMLOOP > 6
if GetItemTypeId(NEWITEM) == GetItemTypeId(UnitItemInSlot(OURUNIT, ITEMLOOP)) then
if GetItemCharges(UnitItemInSlot(OURUNIT, ITEMLOOP)) + GetItemCharges(NEWITEM) <= MAXIMUM then
if not (UnitItemInSlot(OURUNIT, ITEMLOOP) == NEWITEM) then
set CHARGES = GetItemCharges(UnitItemInSlot(OURUNIT, ITEMLOOP)) + GetItemCharges(NEWITEM)
call SetItemCharges(UnitItemInSlot(OURUNIT, ITEMLOOP), CHARGES)
call RemoveItem(NEWITEM)
set ITEMLOOP = 7
endif
endif
endif
if (ITEMLOOP < 7) then
set ITEMLOOP = ITEMLOOP + 1
endif
endloop
set NEWITEM = null
set OURUNIT = null
endfunction
function InitTrig_Combine_Items takes nothing returns nothing
set gg_trg_Combine_Items = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Combine_Items, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_Combine_Items, Condition( function Combine_Items_Conditions ) )
call TriggerAddAction( gg_trg_Combine_Items, function Combine_Items_Actions )
endfunction