Name | Type | is_array | initial_value |
cage | boolean | Yes | |
chain | boolean | No | |
Currunt_Camera | camerasetup | No | |
distance | real | No | |
event_num | integer | No | |
foot_step | sound | No | |
Lock | boolean | Yes | |
Lock_00 | boolean | No | true |
next_unit | unit | No | |
paint | boolean | No | |
Pass_word | boolean | No | |
selected_unit | unit | No | |
sound | rect | No | |
tomb_item | boolean | Yes | |
unit_point | integer | No | |
wenddy | unit | No |
function getItemN takes nothing returns integer
local integer j = 0
local integer i = 1
local integer i_End = 6
loop
exitwhen i > i_End
if ( GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), i )) == GetItemTypeId(GetManipulatedItem()) ) then
set j = j + 1
else
endif
set i = i + 1
endloop
return j
endfunction
function Trig_charge_Adder_Conditions takes nothing returns boolean
if ( not ( GetItemCharges(GetManipulatedItem()) > 0 ) ) then
return false
else
endif
if( not( getItemN() > 1 ) ) then
return false
endif
return true
endfunction
function Trig_charge_Adder_Func001C takes nothing returns boolean
return true
endfunction
function Trig_charge_Adder_Actions takes nothing returns nothing
local integer x = GetItemCharges(GetManipulatedItem())
local integer y = GetItemTypeId(GetManipulatedItem())
local integer i = 1
local integer i_End = 6
local item temp
call RemoveItem( GetManipulatedItem() )
loop
exitwhen i > i_End
set temp = UnitItemInSlotBJ(GetManipulatingUnit(), i)
if ( GetItemTypeId(temp) == y ) then
call SetItemCharges( temp, ( GetItemCharges(temp) + x ) )
else
endif
set i = i + 1
endloop
endfunction
//===========================================================================
function InitTrig_charge_Adder takes nothing returns nothing
set gg_trg_charge_Adder = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_charge_Adder, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_charge_Adder, Condition( function Trig_charge_Adder_Conditions ) )
call TriggerAddAction( gg_trg_charge_Adder, function Trig_charge_Adder_Actions )
endfunction