alambik
Sorceror
~Custom Vendor On The Fly~
Custom Vendors On The Fly
-UPDATED 21th Feb 2006-
MORE NOW!
A context menu is available on the MyVendorBag:
- Repeat : Dupe the bag with its containt ( very useful for several vendor of same type)
- Copy : After targeting a standard vendor, it creates a bag with the items that the standard vendor is selling. It configure those items to mach the same price and amount.
Brief description:
This script allows to use customizable vendors. Those scripts allow:
- To choose which Item to sell simply by adding them in his backpack
- To make invisible bags of items sold by the vendor
- To allow a "Rate" of price for those items (items more expensive in a shop than another for example)
- To allow the player to sell to the vendor those items at 33% of the price
Instalation:
1) Drag and drop scripts in your custom script folder
2) You have to fix the 2 BUGS in cripts/Mobiles/Vendors/GenericBuy.cs
A )Replace:
-----------
with
----
B) Replace this function:
-------------------------
By this one:
-----------
Optional additional change : FRENCH ONLY AT THE MOMENT
Pour avoir des vendeurs plus amusant:
Dans BaseCreature.cs, ajouter dans le switch de la méthode ChangeAIType :
------------------------------------------------------------------------
Dans Scripts\Engines\AI\AI\BaseAI.cs, ajouter dans l'"enum" de AIType :
----------------------------------------------------------------------
Enfin dans MyVendor.cs, au début:
--------------------------------
Mettez m_Language à "1" pour le français
Mettez m_MyVendorAI à "true" pour activer un semblant de conversation.
Known bug:
=========
When creating a MyVendor at the first time, it is sometime possible to see all sold items in double. Don't worry about that: all is fixed automaticaly on the next restart of your server.
Usage:
=====
1) Create a vendor:
[add MyVendor
2) Add a vendor bag (optional):
[add MyVendorBag
3) Put the item you want to sell in this bag:
On each item, use the [props command to modify the value you want:
-Name: name of the object
-Amount: maximum amount of items allow to be sold
-Weight: price of one of this item
-Hue: hue of the sold object
3) Customize the Vendor:
Open the vendor backpack and put the vendor bag with the items in it.
A gump propose you to dupe the bag and all its containt eventually (useful when doing one bag per kind of vendor and wanting to dupe it)
4) Validate the changes:
You MUST double click again on the vendor to validate what you put in the backpack.
5) Customize the vendor rate (optional)
The vendor default rate is 1,0
That is to say that all item are sold at their normal price.
If you set the rate to 0,5 for example, all the items will be sold and bought at half of there defined price.
You can change this rate using [props command on the vendor and DOUBLE CLICK on the vendor to compute the new prices.
HOPE YOU'LL ENJOY!
Custom Vendors On The Fly
-UPDATED 21th Feb 2006-
MORE NOW!
A context menu is available on the MyVendorBag:
- Repeat : Dupe the bag with its containt ( very useful for several vendor of same type)
- Copy : After targeting a standard vendor, it creates a bag with the items that the standard vendor is selling. It configure those items to mach the same price and amount.
Brief description:
This script allows to use customizable vendors. Those scripts allow:
- To choose which Item to sell simply by adding them in his backpack
- To make invisible bags of items sold by the vendor
- To allow a "Rate" of price for those items (items more expensive in a shop than another for example)
- To allow the player to sell to the vendor those items at 33% of the price
Instalation:
1) Drag and drop scripts in your custom script folder
2) You have to fix the 2 BUGS in cripts/Mobiles/Vendors/GenericBuy.cs
A )Replace:
-----------
Code:
public GenericBuyInfo( string name, Type type, int price, int amount, int itemID, int hue, object[] args )
{
amount = 20;
with
----
Code:
public GenericBuyInfo( string name, Type type, int price, int amount, int itemID, int hue, object[] args )
{
if (amount<1)
amount = 20;
B) Replace this function:
-------------------------
Code:
//get a new instance of an object (we just bought it)
public virtual object GetObject()
{
if ( m_Args == null || m_Args.Length == 0 )
return Activator.CreateInstance( m_Type );
return Activator.CreateInstance( m_Type, m_Args );
//return (Item)Activator.CreateInstance( m_Type );
}
By this one:
-----------
Code:
//get a new instance of an object (we just bought it)
public virtual object GetObject()
{
object myObject;
if ( m_Args == null || m_Args.Length == 0 )
myObject=Activator.CreateInstance( m_Type );
else
myObject=Activator.CreateInstance( m_Type, m_Args );
if ( m_Type == typeof(Item) )
{
((Item)myObject).ItemID=m_ItemID;
((Item)myObject).Hue=m_Hue;
/* Next line not well managed. Commented.*/
/*((Item)myObject).Name=m_Name;*/
}
return myObject;
}
Optional additional change : FRENCH ONLY AT THE MOMENT
Pour avoir des vendeurs plus amusant:
Dans BaseCreature.cs, ajouter dans le switch de la méthode ChangeAIType :
------------------------------------------------------------------------
Code:
case AIType.AI_MyVendorAI:
m_AI = new MyVendorAI(this);
break;
Dans Scripts\Engines\AI\AI\BaseAI.cs, ajouter dans l'"enum" de AIType :
----------------------------------------------------------------------
Code:
,AI_MyVendor
Enfin dans MyVendor.cs, au début:
--------------------------------
Mettez m_Language à "1" pour le français
Mettez m_MyVendorAI à "true" pour activer un semblant de conversation.
Known bug:
=========
When creating a MyVendor at the first time, it is sometime possible to see all sold items in double. Don't worry about that: all is fixed automaticaly on the next restart of your server.
Usage:
=====
1) Create a vendor:
[add MyVendor
2) Add a vendor bag (optional):
[add MyVendorBag
3) Put the item you want to sell in this bag:
On each item, use the [props command to modify the value you want:
-Name: name of the object
-Amount: maximum amount of items allow to be sold
-Weight: price of one of this item
-Hue: hue of the sold object
3) Customize the Vendor:
Open the vendor backpack and put the vendor bag with the items in it.
A gump propose you to dupe the bag and all its containt eventually (useful when doing one bag per kind of vendor and wanting to dupe it)
4) Validate the changes:
You MUST double click again on the vendor to validate what you put in the backpack.
5) Customize the vendor rate (optional)
The vendor default rate is 1,0
That is to say that all item are sold at their normal price.
If you set the rate to 0,5 for example, all the items will be sold and bought at half of there defined price.
You can change this rate using [props command on the vendor and DOUBLE CLICK on the vendor to compute the new prices.
HOPE YOU'LL ENJOY!