HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Marketplace help!

08-17-2011, 11:17 PM#1
whitefang
i currently put this Thread in the wong place, please forgive me. Any ways if u have not seen the other thread in the genral forums, i am trying to make a marketplace be able to have all the items that you sell to it so that other players may buy the item that u sold to the same marketplace

Exsample:i sell a light healing pot to the marketplace, then it shows up in the marketplace, then anther player comes up and buys it from the same marketplace.

Any help will be usefull thanks c(^.^c)
08-18-2011, 12:19 AM#2
Fledermaus
Expand JASS:

You need to change the constant to the id of your marketplace unit type.
Currently it wont increase an items max stock if you sell the same item type to it more than once. I can change that if you want it, it's not too much more work but will have to use a hashtable (or table if you only want 1 marketplace) since there's no native to see if a unit has an item in stock (or how much stock of it it has).
Also if the marketplace gets more than 11 items, the first item added will be removed. That seems to be a wc3 limitation. I could probably build a work around but I can't be bothered.

I'll attach the map so you can see if this is how you wanted it.


EDIT: Oh yeah, the Marketplace unit needs to have the "Sell Items" ability.
Attached Files
File type: w3xMarket Place.w3x (13.4 KB)
08-19-2011, 01:32 AM#3
whitefang
Well, i c that u use scripts, i am not very good at scripts, Mind puting it in trigger form, cause i can t under stand any of of that scripting u put down.
08-19-2011, 03:00 AM#4
Fledermaus
Trigger:
Marketplace
Collapse Events
Unit - A unit Pawns an item (to shop)
Collapse Conditions
(Unit-type of (Buying unit)) Equal to WHATEVER YOUR MARKET PLACE UNIT IS
Collapse Actions
Neutral Building - Add (Item-type of (Sold Item)) to (Buying unit) with 1 in stock and a max stock of 1
08-19-2011, 08:12 PM#5
whitefang
Rep+ thank you very much Fledermaus. im just more good with triggers that all c(^^c)