• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Marketplace Item Removal

Status
Not open for further replies.
Level 9
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
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877

The trigger would look like this:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • (Item-type of (Sold Item)) Equal to Claws of Attack +15
    • Actions
      • Neutral Building - Remove Claws of Attack +15 from all marketplaces
You could also change the Event to Unit - A unit Uses an item or Unit - A unit Acquires an item and switch (Sold Item) to (Item being manipulated).

Marketplaces are bugged and only able to Remove items that were Added via triggers:
  • Untitled Trigger 002
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Neutral Building - Add Claws of Attack +15 to all marketplaces with 1 in stock and a max stock of 1
Make sure you aren't still adding the Item to the shop in the Object Editor.
 
Last edited:
Level 9
Joined
Apr 14, 2020
Messages
63

This trigger would look like this:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • (Item-type of (Sold Item)) Equal to Claws of Attack +15
    • Actions
      • Neutral Building - Remove Claws of Attack +15 from all marketplaces
You could also change the Event to Unit - A unit Uses an item or Unit - A unit Acquires an item and switch (Sold Item) to (Item being manipulated).

Marketplaces are bugged and only able to Remove items that were Added via triggers:
  • Untitled Trigger 002
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Neutral Building - Add Claws of Attack +15 to all marketplaces with 1 in stock and a max stock of 1
Make sure you aren't still adding the Item to the shop in the Object Editor.
The trigger adding item is what I did not know. That will make it fixable. Thanks!
 
Status
Not open for further replies.
Top