• 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.

Adding inventory items to a neutral store

Level 26
Joined
Dec 24, 2019
Messages
491
Hi everyone, I hope someone can help me with this little problem.

I have a couple of heroes cached, the idea is to restore them and mark the items they have in their inventories. Then I want to add those items to the neutral store on the map, that is, I want the store to sell the items that those heroes had in their inventories.

Any ideas on how to do it? I started thinking about it and started to smell something burning so I gave up :ogre_hurrhurr:

Thanks and regards.
 
Level 30
Joined
Aug 29, 2012
Messages
1,383
I'd do something like this

  • Actions
    • For each (Integer A) from 1 to 6, do (Actions)
      • Loop - Actions
        • Set VariableSet ItemType[(Integer A)] = (Item-type of (Item carried by MyHero in slot (Integer A)))
        • Neutral Building - Add ItemType[(Integer A)] to Goblin Merchant 0000 <gen> with 0 in stock and a max stock of 1
Dunno how many heroes you have but you can repeat as needed, basically scan their inventory slots 1 -> 6, store the items in a variable and add said items to the shop
 
Level 26
Joined
Dec 24, 2019
Messages
491
I'd do something like this

  • Actions
    • For each (Integer A) from 1 to 6, do (Actions)
      • Loop - Actions
        • Set VariableSet ItemType[(Integer A)] = (Item-type of (Item carried by MyHero in slot (Integer A)))
        • Neutral Building - Add ItemType[(Integer A)] to Goblin Merchant 0000 <gen> with 0 in stock and a max stock of 1
Dunno how many heroes you have but you can repeat as needed, basically scan their inventory slots 1 -> 6, store the items in a variable and add said items to the shop
You're a real genius! I always drown in the smallest puddles :ogre_hurrhurr:

Thank you very much and regards.
 
Top