RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Getting vendors to buy more than regular leather

psz

Administrator
Getting vendors to buy more than regular leather

Here's a snippet from my SBTanner. I'm trying to get him to buy all four types of cut leather for 3gold each.

He'll buy the regular cut leather, but NOT the spined, horned, or barbed.

[code:1] public class InternalSellInfo : GenericSellInfo
{
public InternalSellInfo()
{
Add( typeof( Scissors ), 6 );
Add( typeof( Leather ), 3);
Add( typeof( SpinedLeather ), 3);
Add( typeof( HornedLeather ), 3);
Add( typeof( BarbedLeather ), 3);
}
[/code:1]

No errors at startup. I've respawned the tanners, but yet they still refuse to buy the other leather types. Makes being a newbie tailor/leather worker a bit difficult (And makes killing lizardmen/ratmen useless in that regard)
 

psz

Administrator
I hadn't tried the ingots yet... One thing at a time ;->

I just can't figure it out, unless you have to <ponder> Manually set the name in the sell script similar to how you do it in the buy script for things like GameBoard/ChessBoard/CheckerBoard...


Ideas? ->
 

psz

Administrator
Well, can't use ItemID, as it's the same for all four types of leather...

Anyway, here's the pertinent snippet'o'script if anyone knows...

[code:1] public class InternalSellInfo : GenericSellInfo
{
public InternalSellInfo()
{
Add( typeof( Scissors ), 6 );
Add( typeof( Leather ), 3);
Add( typeof( SpinedLeather ), 3);
Add( typeof( HornedLeather ), 3);
Add( typeof( BarbedLeather ), 3);
}
}

[/code:1]
 

tindin

Wanderer
dont know if this work (havent tested it but it may..
[code:1]public class InternalSellInfo : GenericSellInfo
{
public InternalSellInfo()
{
Add( typeof( Scissors ), 6 );
Add( typeof( Leather ), 3);
Add( typeof( SpinedHides ), 3);
Add( typeof( HornedHides), 3);
Add( typeof( BarbedHides ), 3);
}
}
[/code:1]
 

Mortis

Knight
Updated to display proper hues in sell menu.

Notice you can buy a rune book from a mage and even though it is in his sellinfo you cant sell it back to him. Looks like a BUG.

I made a whole SBspeacialTanner.cs

I can get it to show the item label right in the sell menu and buy it but vendor will not buy it back.

SBSpeacialTanner.cs
[code:1]using System;
using System.Collections;
using Server.Items;

namespace Server.Mobiles
{
public class SBSpeacialTanner : SBInfo
{
private ArrayList m_BuyInfo = new InternalBuyInfo();
private IShopSellInfo m_SellInfo = new InternalSellInfo();

public SBSpeacialTanner()
{
}

public override IShopSellInfo SellInfo { get { return m_SellInfo; } }
public override ArrayList BuyInfo { get { return m_BuyInfo; } }

public class InternalBuyInfo : ArrayList
{
public InternalBuyInfo()
{
Add( new GenericBuyInfo( typeof( Leather ), 6, 20, 0x1081, 0 ) );
Add( new GenericBuyInfo( typeof( Scissors ), 6, 10, 0xF9F, 0 ) );
Add( new GenericBuyInfo( "1049354", typeof( SpinedLeather ), 3, 20, 0x1081, 0x8ac ) );
Add( new GenericBuyInfo( "1049355", typeof( HornedLeather ), 3, 20, 0x1081, 0x845 ) );
Add( new GenericBuyInfo( "1049356", typeof( BarbedLeather ), 3, 20, 0x1081, 0x851 ) );
}
}

public class InternalSellInfo : GenericSellInfo
{
public InternalSellInfo()
{
Add( typeof( Scissors ), 6 );
Add( typeof( Leather ), 3);
Add( typeof( SpinedLeather ), 3);
Add( typeof( HornedLeather), 3);
Add( typeof( BarbedLeather ), 3);
}
}
}
}[/code:1]

And the line added to Tanner.cs
[code:1] m_SBInfos.Add( new SBSpeacialTanner() );[/code:1]
 

psz

Administrator
The problem is that Hides aren't the same as Leather. Hides are the uncut "furs" whereas Leather is the Cut Leather you use with tailoring.

Though I DO plan on adding the ability to sell the non-standard Hides to the Furtrader after I get THIS working ;->
 

tindin

Wanderer
after doing some testing i found that you can not make vendors sell things that have the same id # they well sell the baseitem for it (ironingots, leather)
 

Mortis

Knight
tindin said:
after doing some testing i found that you can not make vendors sell things that have the same id # they well sell the baseitem for it (ironingots, leather)

The leather in my above script you do get horned, barbed and spined leather when you buy it from the vendor.
It has the same Id # but "1049356", this # in the line gets you the proper item Barbed leather. Selling the proper thing is not the problem for me.

Getting the vendor to buy it back is the issue.

[code:1]Add( new GenericBuyInfo( "1049356", typeof( BarbedLeather ), 3, 20, 0x1081, 0 ) ); [/code:1]

For ingots I tested this same thing proper ingot/hue in menu but blacksmith would not buy it back.

SBColoredIngots.cs
[code:1]using System;
using System.Collections;
using Server.Items;

namespace Server.Mobiles
{
public class SBColoredIngot : SBInfo
{
private ArrayList m_BuyInfo = new InternalBuyInfo();
private IShopSellInfo m_SellInfo = new InternalSellInfo();

public SBColoredIngot()
{
}

public override IShopSellInfo SellInfo { get { return m_SellInfo; } }
public override ArrayList BuyInfo { get { return m_BuyInfo; } }

public class InternalBuyInfo : ArrayList
{
public InternalBuyInfo()
{
Add( new GenericBuyInfo( "1042690", typeof( VeriteIngot ), 3, 20, 0x1BEF, 0x89f ) );
Add( new GenericBuyInfo( "1042691", typeof( ValoriteIngot ), 3, 20, 0x1BEF, 0x8ab ) );
Add( new GenericBuyInfo( "1042685", typeof( ShadowIronIngot ), 3, 20, 0x1BEF, 0x966 ) );
}
}

public class InternalSellInfo : GenericSellInfo
{
public InternalSellInfo()
{
Add( typeof( VeriteIngot ), 6 );
Add( typeof( ValoriteIngot ), 3);
Add( typeof( ShadowIronIngot ), 3);
}
}
}
}[/code:1]

Added to Blacksmith.cs
[code:1] m_SBInfos.Add( new SBColoredIngot() );[/code:1]
 

psz

Administrator
Yes, the problem I have is that vendors will not BUY horned/spiked/barbed cut leather from players... I'm not concerned with vendors selling it or hides (yet) ;->
 

Mortis

Knight
Same. I was just testing. I noticed more than just leathers and ingots have the buy issue.

Above were just examples of the BUG.

I also mentioned you can buy a runebok from a mage. But, cannot sell it back to him even though it is in his sellinfo.

Appears you cannot sell quite a few items back to a vendor even if you script it to do so.

Perhaps this should be in the BUG REPORTING thread?
 

tindin

Wanderer
tindin said:
after doing some testing i found that you can not make vendors sell things that have the same id # they well sell the baseitem for it (ironingots, leather)
lol sorry i ment players cant sell things with the same id #.....
 

Namida

Wanderer
Getting Vendors to Buy

For those of you having problems getting your vendors to buy things, a tip.

In GenericSell.cs (Located in Scripts/Mobiles/Vendors) on lines 86 and 87 is an 'if' statement that disables any item with a hue from being sold to the vendor. Commenting out these two lines should allow vendors to buy things like special ingots or different leathers.

The consequence of this is that any item that players can change the hue of, and sell, could make for some really long sell lists.

I hope this helps.
 

psz

Administrator
That shouldn't be too much of a problem... Considering some of the lists on OSI ;->

Will try and get back to you!


*Edit*

Cool. Works fine. I actually commented out both the Is Sellable section of hue checking as well as the Is Resellable.
 
Top