Name | Type | is_array | initial_value |
Attackpoint | location | No | |
blabdice | integer | No | |
boss1 | boolean | No | |
boss2 | boolean | No | |
boss3 | boolean | No | |
containerspawndice | integer | No | |
containertypedice | integer | No | |
corpsegroup | group | No | |
gargolyetakeoff | boolean | No | |
havewon | boolean | No | |
herolevels | integer | No | |
holywordfx | effect | Yes | |
Holywordtargetfx | effect | Yes | |
holywordtargets | group | No | |
hostilecaster | unit | No | |
hostileforces | integer | No | |
inactivesentryguns | group | No | |
ItemSpawns | rect | Yes | |
itemtypedice | integer | No | |
levelmodifier | real | No | 1.00 |
loop | integer | No | |
moveisrunning | boolean | No | |
movingunit | unit | No | |
NightmareMode | boolean | No | false |
pickednightmare | unit | No | |
pickednightmaretarget | unit | No | |
playersactive | integer | No | |
powerbasedunits | group | No | |
replacementdice | integer | No | |
spawndice | real | No | |
spawnmodifier | real | No | |
spawnpoint | rect | Yes | |
spawnpointdice | integer | No | |
spawnvaule | real | No | |
speechtime | real | No | 5.00 |
SPS | real | No | |
tempcontainergroup | group | No | |
tempdeadgroup | group | No | |
tempherogroup | group | No | |
tempholyaoegroup | group | No | |
tempnightmares | group | No | |
tempnightmaretargets | group | No | |
tempplayergroup | force | No | |
temppoint | location | No | |
tempunitgroup | group | No | |
tempunitmovegroup | group | No | |
timeleft | real | No | |
timeleft_int | integer | No | |
totalkills | integer | No |
function Trig_Combine_Items_Conditions takes nothing returns boolean
if ( not ( GetItemCharges(GetManipulatedItem()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Combine_Items_Actions takes nothing returns nothing
local integer ITEMCOUNT
local integer ITEMLOOP
local integer CHARGES
local integer MAXIMUM
local item NEWITEM
local unit OURUNIT
set MAXIMUM = 30
set ITEMCOUNT = 0
set ITEMLOOP = 0
set CHARGES = 0
set NEWITEM = GetManipulatedItem()
set OURUNIT = GetManipulatingUnit()
loop
exitwhen ITEMLOOP > 6
if ((GetItemTypeId(NEWITEM)) == (GetItemTypeId(UnitItemInSlotBJ(OURUNIT, ITEMLOOP)))) then
if ((GetItemCharges(UnitItemInSlotBJ(OURUNIT, ITEMLOOP)) + GetItemCharges(NEWITEM)) <= MAXIMUM) then
if not ( (UnitItemInSlotBJ(OURUNIT, ITEMLOOP)) == (NEWITEM)) then
set CHARGES = (GetItemCharges(UnitItemInSlotBJ(OURUNIT, ITEMLOOP))) + GetItemCharges(NEWITEM)
call SetItemCharges( UnitItemInSlotBJ(OURUNIT, ITEMLOOP), CHARGES )
call RemoveItem( NEWITEM )
set ITEMLOOP=7
endif
endif
endif
if ( ITEMLOOP < 7 ) then
set ITEMLOOP = ITEMLOOP + 1
endif
endloop
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 Trig_Combine_Items_Conditions ) )
call TriggerAddAction( gg_trg_Combine_Items, function Trig_Combine_Items_Actions )
endfunction