1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Custom Vendor

Discussion in 'General Discussion' started by TwilightRaven, Jul 10, 2017.

  1. TwilightRaven
    Offline

    TwilightRaven Member

    Joined:
    Oct 29, 2016
    Messages:
    410
    Likes Received:
    7
    Hi guys,

    I was wondering how I would create a custom vendor script? I want to create a new vendor that sells different things from other vendors.
     
  2. Lokai
    Offline

    Moderator ServUO Developer

    Joined:
    Dec 4, 2014
    Messages:
    919
    Likes Received:
    137
    Look at the NPC vendors and the SB_ scripts. Those show the Sell and Buy methods. Probably the easiest way to do that is to copy/paste one, change the name in the several locations it appears, then change the items to the ones you want the vendor to deal in.
     
  3. Nyght_Hex
    Offline

    Nyght_Hex Member

    Joined:
    Nov 27, 2016
    Messages:
    84
    Likes Received:
    6
    TwilightRaven,

    If you are using Vita-Nex Core use this it's already set up as a customer you will just have to change the name of it if you want and add/remove items that you want on it.

    It has already been compiled you may have to remove one or two items from it because they are custom scripts I use on my server. Let me know if you have any questions and I can try to help!

    Thanks,
    Nyght_Hex
     

    Attached Files:

  4. TwilightRaven
    Offline

    TwilightRaven Member

    Joined:
    Oct 29, 2016
    Messages:
    410
    Likes Received:
    7
    Sure. Another question. What is Vita-Nex core?
     
  5. Vorspire
    Offline

    Vorspire Vita-Nex: Core
    Admin ServUO Developer

    Joined:
    Jul 29, 2013
    Messages:
    928
    Likes Received:
    165
  6. TwilightRaven
    Offline

    TwilightRaven Member

    Joined:
    Oct 29, 2016
    Messages:
    410
    Likes Received:
    7
    Awesome Thanks. I have the Artifact Dealer but I don't know how to set the prices for his wares?
     
  7. Nyght_Hex
    Offline

    Nyght_Hex Member

    Joined:
    Nov 27, 2016
    Messages:
    84
    Likes Received:
    6
    it should be in the script next to the item in brackets
     
  8. TwilightRaven
    Offline

    TwilightRaven Member

    Joined:
    Oct 29, 2016
    Messages:
    410
    Likes Received:
    7
    No that's the quantity that the vendor has of the item.
     
  9. Nyght_Hex
    Offline

    Nyght_Hex Member

    Joined:
    Nov 27, 2016
    Messages:
    84
    Likes Received:
    6
    thats the price.PNG

    AddStock<HoodedShroudOfShadows>(this is the cost not the amount);
     
  10. Vorspire
    Offline

    Vorspire Vita-Nex: Core
    Admin ServUO Developer

    Joined:
    Jul 29, 2013
    Messages:
    928
    Likes Received:
    165
    These are the available arguments for the AddStock methods;

    Code (C#):
    1.  
    2. void AddStock<TObj>(int price, string name = null, int amount = 100, object[] args = null);
    3. void AddStock(Type type, int price, string name = null, int amount = 100, object[] args = null);
    4.  
    The point in AdvancedVendor was to take away the need for users to create their own SBInfo for every vendor they wanted, to be able to use any item as currency, and make adding stock as simple as possible, taking away the need to specify ItemIDs, Names, and Amounts, as all of this is extracted automatically by the AdvancedSBInfo.
     
  11. TwilightRaven
    Offline

    TwilightRaven Member

    Joined:
    Oct 29, 2016
    Messages:
    410
    Likes Received:
    7
    I tried using the parameters you have for AddStock and it doesn't change. Its always 25gp and 100 in stock
    --- Double Post Merged, Jul 15, 2017 ---
    Here is my script based off the custom vendor script. It is an artifact dealer and can be dropped anywhere.
     

    Attached Files:

  12. Michele
    Offline

    Michele Member

    Joined:
    Aug 22, 2017
    Messages:
    61
    Likes Received:
    0
    Hi, i try to custom a vendor, the vagabond, bsvagabond.cs (i dont need this vendor and i want to custom it)

    I have commetend items i dont want sell\buy and add custom items i have insert.... but in their menu appears in sell items like Tinker..

    i dont understand.............. so here te code..

    Spoiler

    using System;
    using System.Collections.Generic;
    using Server.Items;

    namespace Server.Mobiles
    {
    public class SBVagabond : SBInfo
    {
    private readonly List<GenericBuyInfo> m_BuyInfo = new InternalBuyInfo();
    private readonly IShopSellInfo m_SellInfo = new InternalSellInfo();
    public SBVagabond()
    {
    }

    public override IShopSellInfo SellInfo
    {
    get
    {
    return m_SellInfo;
    }
    }
    public override List<GenericBuyInfo> BuyInfo
    {
    get
    {
    return m_BuyInfo;
    }
    }

    public class InternalBuyInfo : List<GenericBuyInfo>
    {
    public InternalBuyInfo()
    {
    /* Add(new GenericBuyInfo(typeof(GoldRing), 27, 20, 0x108A, 0));
    Add(new GenericBuyInfo(typeof(Necklace), 26, 20, 0x1085, 0));
    Add(new GenericBuyInfo(typeof(GoldNecklace), 27, 20, 0x1088, 0));
    Add(new GenericBuyInfo(typeof(GoldBeadNecklace), 27, 20, 0x1089, 0));
    Add(new GenericBuyInfo(typeof(Beads), 27, 20, 0x108B, 0));
    Add(new GenericBuyInfo(typeof(GoldBracelet), 27, 20, 0x1086, 0));
    Add(new GenericBuyInfo(typeof(GoldEarrings), 27, 20, 0x1087, 0));

    Add(new GenericBuyInfo(typeof(Board), 3, 20, 0x1BD7, 0, true));
    Add(new GenericBuyInfo(typeof(IronIngot), 6, 20, 0x1BF2, 0, true));

    Add(new GenericBuyInfo(typeof(StarSapphire), 125, 20, 0xF21, 0, true));
    Add(new GenericBuyInfo(typeof(Emerald), 100, 20, 0xF10, 0, true));
    Add(new GenericBuyInfo(typeof(Sapphire), 100, 20, 0xF19, 0, true));
    Add(new GenericBuyInfo(typeof(Ruby), 75, 20, 0xF13, 0, true));
    Add(new GenericBuyInfo(typeof(Citrine), 50, 20, 0xF15, 0, true));
    Add(new GenericBuyInfo(typeof(Amethyst), 100, 20, 0xF16, 0, true));
    Add(new GenericBuyInfo(typeof(Tourmaline), 75, 20, 0xF2D, 0, true));
    Add(new GenericBuyInfo(typeof(Amber), 50, 20, 0xF25, 0, true));
    Add(new GenericBuyInfo(typeof(Diamond), 200, 20, 0xF26, 0, true));*/
    }
    }

    public class InternalSellInfo : GenericSellInfo
    {
    public InternalSellInfo()
    {

    Add(typeof(PracticeBattleAxe), 50);
    /*Add(typeof(IronIngot), 3);
    Add(typeof(Amber), 25);
    Add(typeof(Amethyst), 50);
    Add(typeof(Citrine), 25);
    Add(typeof(Diamond), 100);
    Add(typeof(Emerald), 50);
    Add(typeof(Ruby), 37);
    Add(typeof(Sapphire), 50);
    Add(typeof(StarSapphire), 62);
    Add(typeof(Tourmaline), 47);
    Add(typeof(GoldRing), 13);
    Add(typeof(SilverRing), 10);
    Add(typeof(Necklace), 13);
    Add(typeof(GoldNecklace), 13);
    Add(typeof(GoldBeadNecklace), 13);
    Add(typeof(SilverNecklace), 10);
    Add(typeof(SilverBeadNecklace), 10);
    Add(typeof(Beads), 13);
    Add(typeof(GoldBracelet), 13);
    Add(typeof(SilverBracelet), 10);
    Add(typeof(GoldEarrings), 13);
    Add(typeof(SilverEarrings), 10);*/
    }
    }
    }

    --- Double Post Merged, Jan 2, 2018 ---


    I try to see in vagabon.cs and i have this:

    public override void InitSBInfo()
    {
    m_SBInfos.Add(new SBTinker(this)); <------- why?
    m_SBInfos.Add(new SBVagabond());
     
  13. dagid4
    Offline

    dagid4 New Member

    Joined:
    Sep 27, 2015
    Messages:
    9
    Likes Received:
    0
    Just remove the question marked line. It's there, because Vagabond is also considered as Tinker vendor.
     
  14. Michele
    Offline

    Michele Member

    Joined:
    Aug 22, 2017
    Messages:
    61
    Likes Received:
    0
    yes i do this,correctly compile and run, but when i clic on buy (on the vagabond) nothin happen, dontshwo the buy menu
     
Similar Threads: Custom Vendor
Forum Title Date
Script Support Completely Customizable Vendor Nov 9, 2017
Script Support a custom vendor needing help Feb 3, 2017
Script Support Using CustomHuePicker with PlayerVendorCustomizeGump Jan 30, 2017
ServUO Discussion Vendor Customization Feb 27, 2016
Custom Releases Custom Vendors Jun 5, 2015
Custom Releases The Completely Customizable Vendor - .NET 4.0 and Cleaned Up Dec 25, 2014
Custom Releases Complete Customizable Vendor For Newer Clients [Deleted] Sep 13, 2014