public GenericBuyInfo(Type type, int price, int amount, int itemID, int hue) : this(null, type, price, amount, itemID, hue, null)
public GenericBuyInfo(string name, Type type, int price, int amount, int itemID, int hue) : this(name, type, price, amount, itemID, hue, null)
public GenericBuyInfo(Type type, int price, int amount, int itemID, int hue, object[] args) : this(null, type, price, amount, itemID, hue, args)
public GenericBuyInfo(string name, Type type, int price, int amount, int itemID, int hue, object[] args)
//get a new instance of an object (we just bought it)
public virtual IEntity GetEntity()
{
if (this.m_Args == null || this.m_Args.Length == 0)
return (IEntity)Activator.CreateInstance(this.m_Type);
return (IEntity)Activator.CreateInstance(this.m_Type, this.m_Args);
}
public GenericBuyInfo(string name, Type type, int price, int amount, int itemID, int hue, object[] args)
this.Add(new GenericBuyInfo("display name", typeof(RecipeScroll), 100, 1, <whateveritemiditis>, 0, new object[] {500}));
i believe it's: Add( new GenericBuyInfo( typeof( RecipeScroll (????) ), 200, 20, 0x2831, 0 )
replace the (???) with the recipe #
Type type, int price, int amount, int itemID, int hue
type = RecipeScroll
amount = 200 // total in stock at one time
itemid shown in the vendor gump = 0x2831
hue = you should know this one...
too true, realized my error in trying to pass parameters to a type instead of an instance after submitting my postIf you have difficulties with something, search the source or examples which do the same thing you want.
If you read my post you can see the third and fourth constructors for the GenericBuyInfo (which is what you add to the list of stuffs to buy).
Let's take the fourth one:
Code:public GenericBuyInfo(string name, Type type, int price, int amount, int itemID, int hue, object[] args)
As i said, that "object[] args" is pretty much the parameters you enter in the constructor of RecipeScroll.
If you look at the constructor of RecipeScroll, you can see it accepts two things, either a Recipe object or an integer.
If we go by the integer way, we can get just send the recipe id there.
Here's a tested example.
Code:this.Add(new GenericBuyInfo("display name", typeof(RecipeScroll), 100, 1, <whateveritemiditis>, 0, new object[] {500}));
You can find a similar thing in SBJewel.cs, if you want something easier to understand.
If you have troubles with coding, learn some coding.
Searching the source and googling everything you see is a good start.
We use essential cookies to make this site work, and optional cookies to enhance your experience.