- Joined
- Apr 14, 2020
- Messages
- 63
Using the below trigger to remove an item from the selected marketplaces if a unit acquires it (so there won't be duplicates), but it doesn't work.
Are there any tricks to this? Ultimately I want the item removed from all marketplaces on the map once it is used, but I would settle for once it is bought.
function Trig_asdf_Copy_2_Conditions takes nothing returns boolean
if ( not ( 'I01N' == GetItemTypeId(GetManipulatedItem()) ) ) then
return false
endif
return true
endfunction
function Trig_asdf_Copy_2_Actions takes nothing returns nothing
call RemoveItemFromStockBJ( 'I01N', gg_unit_h07F_1123 )
call RemoveItemFromStockBJ( 'I01N', gg_unit_h07F_0945 )
call RemoveItemFromStockBJ( 'I01N', gg_unit_h07F_1046 )
call RemoveItemFromStockBJ( 'I01N', gg_unit_h07F_0522 )
call RemoveItemFromStockBJ( 'I01N', gg_unit_h07F_1094 )
call RemoveItemFromStockBJ( 'I01N', gg_unit_h07F_0932 )
endfunction
//===========================================================================
function InitTrig_asdf_Copy_2 takes nothing returns nothing
set gg_trg_asdf_Copy_2 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_asdf_Copy_2, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_asdf_Copy_2, Condition( function Trig_asdf_Copy_2_Conditions ) )
call TriggerAddAction( gg_trg_asdf_Copy_2, function Trig_asdf_Copy_2_Actions )
endfunction
Are there any tricks to this? Ultimately I want the item removed from all marketplaces on the map once it is used, but I would settle for once it is bought.
function Trig_asdf_Copy_2_Conditions takes nothing returns boolean
if ( not ( 'I01N' == GetItemTypeId(GetManipulatedItem()) ) ) then
return false
endif
return true
endfunction
function Trig_asdf_Copy_2_Actions takes nothing returns nothing
call RemoveItemFromStockBJ( 'I01N', gg_unit_h07F_1123 )
call RemoveItemFromStockBJ( 'I01N', gg_unit_h07F_0945 )
call RemoveItemFromStockBJ( 'I01N', gg_unit_h07F_1046 )
call RemoveItemFromStockBJ( 'I01N', gg_unit_h07F_0522 )
call RemoveItemFromStockBJ( 'I01N', gg_unit_h07F_1094 )
call RemoveItemFromStockBJ( 'I01N', gg_unit_h07F_0932 )
endfunction
//===========================================================================
function InitTrig_asdf_Copy_2 takes nothing returns nothing
set gg_trg_asdf_Copy_2 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_asdf_Copy_2, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_asdf_Copy_2, Condition( function Trig_asdf_Copy_2_Conditions ) )
call TriggerAddAction( gg_trg_asdf_Copy_2, function Trig_asdf_Copy_2_Actions )
endfunction