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

Attachments

  • Black Market Thief.cs
    2.2 KB · Views: 96
These are the available arguments for the AddStock methods;

Code:
void AddStock<TObj>(int price, string name = null, int amount = 100, object[] args = null);
void AddStock(Type type, int price, string name = null, int amount = 100, object[] args = null);

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.
 
I tried using the parameters you have for AddStock and it doesn't change. Its always 25gp and 100 in stock
[doublepost=1500139501][/doublepost]Here is my script based off the custom vendor script. It is an artifact dealer and can be dropped anywhere.
 

Attachments

  • [ServUO.com]-ArtifactVendor.cs
    5.8 KB · Views: 47
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..

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);*/
}
}
}
[doublepost=1514884649][/doublepost]
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..

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);*/
}
}
}



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());
 
Just remove the question marked line. It's there, because Vagabond is also considered as Tinker vendor.
 
Just remove the question marked line. It's there, because Vagabond is also considered as Tinker vendor.
yes i do this,correctly compile and run, but when i clic on buy (on the vagabond) nothin happen, dontshwo the buy menu
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back