Welcome to AC Web.
Page 1 of 2 12 LastLast
Results 1 to 15 of 24

Thread: In-Game Store

  1. #1

    In-Game Store

    Registered members see less ads
    and also gain access to other great features.
    Hello everybody,
    Here is a script of a Store NPC.

    It allows you to set several categories and several items in each category. When you talk to the NPC, you will first see how much coins you have and then, below, all the categories.
    When you click on a cateogory, it will display all the items available in this category on the following form:

    [price] ItemName (x quantity)
    • Price is the amount of coins required to purchase the item
    • ItemName is the name of the item. When you create your store you just have to put the item entry and it will find its name
    • Quantity is the quantity of the item that the player will receive if it makes the purchase

    Once its done, the player can click on the item he wants to purchase it.

    This store is managed through the database so you will have to define items and categories in the database.
    When you add a new item, you will just have to give its entry and the script will find its name based on that.

    There is an equipment level constraint that you can apply if you want: for each item, you can set the required average item level for the players. If their item level is below that constraint, they won't see the item.

    When you add an item in the store, you can choose how much items the player will receive if it makes the purchase.

    The script and all the details and explainations is available on the Maelstrom-Scripts repo.

    I hope you'll like it and that it'll be helpful to you.
    Have a nice day !

  2. #2

    Join Date
    Aug 2008
    Good job

  3. #3

  4. #4
    Nice work, thanks!

  5. #5
    always loving free stuff, thanks for this nice release.

  6. #6

    Join Date
    Aug 2015
    Good job, Sure gonna use this script!

  7. #7
    Thanks for the positive feedback guys !

  8. #8
    You can implement extended interface using quest packets, and hook at item vendor buy. That way you can implement custom currency cost and it will also be visible without client editing (dbc). I did this long ago, Idea came from dispersion wow title npc that allows you to buy titles using quest request opcode. That way, you can also flag items and allow players to sell it back if they got wrong item (time limited). I can show you screen shots how everything looks, It is unique, I didn't saw if someone else did it

  9. #9
    Wow it sounds great ! I'd like to see the screen shots if you don't mind but I confess I have no idea how to do that Do you have an example code ?

  10. #10
    I don't have screen shots right now, I make some tonight, here is screen shot of code, you can see opcode entries, so check how it is handled inside trinity core handlers. Best way is to use some sniffer, like WPS, if you can find it somewhere.

    bool CurrenciesMgr::Request(Player const* player, uint32 reward_guid, uint64 npcGUID) const
        const auto c_itr = m_CurrencyStructureList.find(reward_guid);
        if (c_itr != m_CurrencyStructureList.end())
            if (this->IsRequestComplate(player, c_itr))
                return true;
            WorldPacket data(0x18B, 0x32);
            data << uint64(npcGUID);
            data << uint32(reward_guid);
            data << c_itr->second.interface_title;
            data << this->BuildInterfaceText(player, c_itr);
            data << uint32(0x00);
            data << uint32(0x00);
            data << uint32(0x00);
            data << uint32(0x00);
            data << uint32(0x00);
            data << uint32(0x00);
            data << uint32(0x00);
            data << uint32(0x00);
            data << uint32(0x04);
            data << uint32(0x08);
            data << uint32(0x10);
        return false;
    next packet is:
    WorldPacket data(0x188, 0x64);
    I didn't paste whole function for opcode 0x188 because I have implemented donation system for items, titles, honor points, arena points, transmogrification so on. So it is huge and I don't want to share it right now. But check how this opcodes are handled by trinity core, and I am sure you will find a way to use them.

    Edit (Made screen shots):
    User click at multivendor gossip option, then normal vendor open.
    Items are displayed in golds, because I use donation golds as custom currency.
    Once try to buy item, quest opcode is sent with user informations and item informations.
    When user accept, donation golds are modified and item is added to player.
    Player have two hours to return item to vendor and his donation golds will be restored fully.
    Current donation gold is displayed once item is restored.

    I also made this to work with Transmogrification, Titles and so on.

    Item example:

    Good luck if you decide to code this.
    Last edited by The Zxtreme; 09-05-2015 at 06:35 PM.

  11. #11
    Thanks a lot for you comment. It's really interesting and also very impressive ! Right now I don't have enough time to look deeply at this but I definately will when I do !

  12. #12
    keep working =)

  13. #13
    The script works fine , i can see ingame the price and quantity but the problem is that i cant see the info about the item ( item name)

    Here is screen

  14. #14
    I'll look into that later today !

    - - - Updated - - -

    I have managed to reproduce your problem using different DBC languages on the client and on the server. Are yours the same on both sides ?

  15. #15

    Registered members see less ads
    and also gain access to other great features.
    I guess that he want to display item link at gossip menu, Not sure if that is possible. I guess not. If you have other problem with item, delete Cache folder client side.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts