More Physical Sign-Chest-Shop plugin

Discussion in 'Archived: Plugin Requests' started by blablubbabc, Jan 22, 2013.

  1. Offline


    Yes I know, there are already some shop/economy plugins out there. With signs, and chests and both. And I took a look at all of them I could find.
    But I am still not satisfied with them :(

    What I want is a intuitive and good-looking sign-chest-shop plugin, where player don't have to remember if it was right or left click to sell and if it means "selling to the shop" or "the shop sells you something" and where the signs and shops are clearly to read and easy to setup and to use, for both, shop owner and shop user.
    And still it should have all these special features like supporting damage-values, potions, written books, server shops, aliases, activating/deactivating shops, blacklist of items (maybe group based even), lwc support (and/or other kind of protections),... , and these kinds of particularities.

    A further step (lower priority ;-) I know this project is not a small one, and will consume lot of time and work needed to be put into it :( Thats why I struggle with doing it by myself.. Best would maybe be to find some experienced author of the current shop plugins who like the idea, but I guess they have enough work with their own shop-plugin to improve and keeping up :/ ) could be to be able to define a region, like a market, I personal would like to set markets up in my servers faction-savezones.. maybe with preset chests, that players can then claim as their shop there by placing a sign or something like that..

    However.. here it comes:

    Plugin category: Economy

    Suggested name: Doesn't matter. Maybe ChestShop (but this could come in conflict with the existing ChestShop plugin..)

    What I want:

    A item-based-currency-based-physical-chest-sign-shop plugin.
    I prefer using items as currency to trade between players. This can even be a "splitted currency", like (which prefer, but maybe should be configurable..) gold-ingot (base currency, all prices are mainly defined by this) and gold-block (9*ingot) and maybe gold-nugget (1/9 ingot; as ingot is the base currency it would maybe be even better for reducing complexity of the plugin to not care/support "smaller" currencies and simple don't suppoert the nuggets..). So basicly gold-ingot (1) and gold block (9) would be a good currency, but maybe just with the possibility to define other items too with "worth-values" like the saying diamonds have a worth of 8 gold-ingots or something like that.

    So, this is the currency stuff is being traded with.. now to the shops:

    Basicly a shop consists of a chest and a sign over it (on a wall). Just like known from other plugins like chest-Shop or physical shops (to mention some). The shop is created with the placing of the sign, if it is recognized as valid shop sign.

    The signs could look like this (in the end, not everything has to be provided by the user at creation):
    For Server-Shops (infinite stock):
    B amount:price <-ignore these smileys :/ its two-points with p ":" and "p" building this :/
    S amount:price

    there is an (fixed, 1 for each item) itemname-alias, so there is a name and not just a number(id), maybe defined in a configurable list that can easily be updated from update to update..

    B stands for buy from the shop, and S for sell to the shop. (Yeah, I know. Looks similar to already existing signs/shops so far.. but wait)

    Signs for Player-Shops:
    B amount:price
    S amount:price

    yep, nickname. So if a players name is too long for the sign (maybe with colors even.. there would be max 11 characters be left for the name) an admin can simple change their nickname to something shorter..(maybe configurable to switch between real name and nickname, or first try realname and if its to long then nickname, or something like that..)

    Hint: The more data is saved on the sign directly, the less has to be saved and got later inside and from a database. So prices, shop-owner and item can be get directly from the sign without looksups in a database..

    Okay, now like I said, the players shall not have to provide all informations at sign creation. It is theoretically enough to write "$SHOP$" in the first line for a server-shop and "$USERSHOP$" for a player shop. If successfully created and everything is fine, the sign will be filled and changed (maybe colors; the "$USERSHOP$" will change to "$playernickname$" (admins can write usernames directly on the sign if they want to change/set the owner of a shop)), if no Buy and Sell lines are corecctly given, when they will be initialised with 0:0 (meaning nothing is sold and nothing will be bought).
    Additional-Feature: Shop-owners can simple edit their sign be placing an other sign on it, which will automatically copy the text from the sign "behind" onto the new editable sign (don't exactly know if and how this is possible.. maybe with ProtocolLib, if not, then signs are simple not "simple" editable direktly..) and remove the nex sign on creation and set the text of the old sign to the text of the new sign (if everything is still valid and the player has all permissions (if changing owner, selling blacklisted item, etc.)).

    To create the shop, there is also a item needed to be sold and/or bought. The user can give a valid id:subid and/or valid alias:subid(if no subid is given, it results implicit in subid 0 for items like log, leaves etc.), or the user can, if no item was specified on the sign, be prompted with a hint, that he should hit the chest with the item he would like to sell/buy. After that it creates the shop and updates the sign. (Also, maybe shop locations should be saved (chest, sign, block the sign is attached to), so there can happen a faster check if a broken/exploded/moved/etc. block was part of a shop, maybe. Don't know the exactly performance impact if there are all surrounded blocks checked for each breakevent etc.. but could be faster to save their locations and simple compare with them, maybe loading these even in ram for faster checks at plugin load).

    Now as the shop is created:

    If the shop owner opens his shop's chest, he sees it's stock (items and currency-items), which is saved in a database..

    Now the interesting part:

    If an other player opens the chest, he sees an simple empty chest where he can put his items into (the item which is bought by the shop, or the money-item, if both he gets an warning later or it prefers the money-items, if "invalid" items (for this shop) he gets an warning later).

    Now is later: The player has put items into the chest and now clicks the shop-sign above. It doesn't matter if he right- or left-clicks. It detects from the items inside the chest, if he wants to sell them or buy stuff for them (money-items) in exchange.

    It calculates how much items can be sold/bought depending on stock and space in both, the chest and the stock.
    And at the end it displays a message with the result: how mush was successfully bought, or how much successfully sold, or if there wasn't space left in stock/the chest, or the stock was empty.
    It tries to sell/buy as much as possible.

    So in theory, if there is enough space in stock and the chest. And the player keeps clicking, it transforms the items inside the chest from the money-items for example to the bought ones, which then gets sold again, and so on. Until it reaches an end, if there are differences between Buy and Sell prices.. ;-)

    Best would be to add support for different languages from start on. Saves work later.

    And an other hint: A server-shop doesn't need a stock. So even the "owners" of it (the admins) can trade there. It doesn't have to show the non-existend stack if the open the chest..

    Ideas for commands: Maybe some info commands, statistics (logs) for shops/in total for server/players. And logs about a specified amount of the last done transactions for a shop/the server/a player. Info/statistics for a player what he sold where, how much, income vs spent. Stuff like that. But thse have secondary priority ;-)

    Ideas for permissions: Permissions for everything..

    When I'd like it by: Now! :D No, I know that this is some giant work that would have to be done, if someone/s decides to develop this..

    Thanks, bla

    Ps.: Respect to everyone who reads this "short-story" .. Especially because the first parts are about default-shop-plugin stuff, until the "put-stuff-in-the-chest-and-then-click-sign"-part ..

    Ps.: To be honest: I already saw this on some server, but can't remember which one it was :( And I searched hours for it! Everywhere! :(
  2. Offline


    Have you considered the Shopkeepers plugin? Basically it allows you to turn villagers into shops, with the familiar villager trading interface.
  3. Offline


    Yep, I saw that. But I would like chests and custom item-currencies.
    However, I found a plugin on bukkit dev that does nearly what I want. I currently can't remember the name. It's the first plugin where you put your gold in the chest and then clock the sign for trading. But it could still be better/"more the way how described above" I guess..
    I will have to test it properly and give the author some detailed suggestions. I hope the author will still active work on this :(

    So if someone decides to do it exactly the way describe above I would love him for that :) And I would help out and contribute at as many aspects as possible, if someone decides to try it!
  4. Offline


    Hmm. I might consider doing this as a sort of Gringotts addon.

    I'd do it like this:
    Mark a chest with
    <price> buy / sell
    <any text>
    The owner places any item in the chest, so effectively every item in the chest is for sale at the given price.
    When the buyer clicks the chest/sign, they get an empty inventory. They place the currency items inside, and based on the available currency value, items from the stock appear in the same inventory. If the buyer takes the item out, the money gets moved to the seller's account or the chest.

    For selling to the shop, it works conversely: The owner places examples of the items they want to buy, the seller places the same items in the inventory, and money appears.

    How does that sound?
  5. Offline


    Hm.. I think this would be even more far away from what I am looking for.. :( Basicly I am looking for exaclty what I described above :D

    A shop for 1 kind of item (so I can make a nice servershop with some chests), with differen price/amount for selling and buying. And an easy settup/usage:
    * the owner puts money and stock into the chest and closes chest->this is getting save somewhere->finished
    * A customer puts money into the chest for buying/items into the chest for selling (if both or other items, it ignore the items) and clicks the sign-> chest content updates->finished

    Multiple items per shop sould getting complicated for customers I think.. But thats just me prefering that ;-)

    Additional: Easy settup for both, server and playershops, and easy owner changing by admins. If the owner is directly defined on the sign, admins can change it easily/create shops for other players. Also, maybe instead of knowing the itemid of the item a player wants to sell, after sign creation without given itemid he could be asked to click the chest with the exactly item he wants to sell (using enchantments, book text, metadata, etc.), and after doing this the shopsign fills the id (or better an alias for that id, if give and defined somewhere) automatically.

    And later maybe market-regions: doesn√Ąt have to befined by region, but could also be defined by preset shops that can somehow be claimed.

    Thank you for considering developing this ;-)
  6. Offline


    Honestly, from your description Shopkeepers really does all of this, aside of integration into a currency plugin and using chests as the point of interaction, which I'm personally not too fond of.
  7. Offline


  8. Offline


    Shopkeepers trade only with emeralds, with entities, multiple items per shop.. I prefer chest-sign shops..

    I think i might do it by my own , when i got time fo it... If you decide to change your mind and participate with the idea, feel free to let me know :)
  9. Offline


  10. Offline


    I saw that one. It works differently. The only one i found so far was tradecraftae . But there are some other issues with it i think.. I dont like how you have to predefine all possible sellable items in a list with prizes..
  11. Offline


    It works fine. Just give players the node and put the jar in, everything else will be setup
  12. Offline


    I didnt say that it doesnt work. But it works differently: you left/right click the sign to trade the items from inventory. I want the player to put their items they want to trade into the chest and then trade these by clicking the sign. I already made a feature request to physical shops, cause it has nearly all the other needed general shop features..

Share This Page