here are my bases and my mods to the script for it.
Thank you yet once again i was able to get the system working off the scripts you posted! Looks just beautiful!
Last edited:
here are my bases and my mods to the script for it.
using System;
using System.Collections.Generic;
using Server.Items;
using ItemNameHue;
namespace Server.Mobiles
{
public class GenericSellInfo : IShopSellInfo
{
private readonly Dictionary<Type, int> m_Table = new Dictionary<Type, int>();
private Type[] m_Types;
public GenericSellInfo()
{
}
public Type[] Types
{
get
{
if (this.m_Types == null)
{
this.m_Types = new Type[this.m_Table.Keys.Count];
this.m_Table.Keys.CopyTo(this.m_Types, 0);
}
return this.m_Types;
}
}
public void Add(Type type, int price)
{
this.m_Table[type] = price;
this.m_Types = null;
}
public int GetSellPriceFor(Item item)
{
int price = 0;
this.m_Table.TryGetValue(item.GetType(), out price);
if (item is BaseArmor)
{
BaseArmor armor = (BaseArmor)item;
if (armor.Quality == ArmorQuality.Low)
price = (int)(price * 0.60);
else if (armor.Quality == ArmorQuality.Exceptional)
price = (int)(price * 1.25);
//Chance the Price multiplier here//
price += 7 * ArmorItemProps.CheckArmor(armor);
price += 100 * (int)armor.Durability;
price += 100 * (int)armor.ProtectionLevel;
if (price < 1)
price = 1;
}
else if (item is BaseWeapon)
{
BaseWeapon weapon = (BaseWeapon)item;
if (weapon.Quality == WeaponQuality.Low)
price = (int)(price * 0.60);
else if (weapon.Quality == WeaponQuality.Exceptional)
price = (int)(price * 1.25);
//Chance the Price multiplier here//
price += 7 * WeaponItemProps.CheckWeapon(weapon);
price += 100 * (int)weapon.DurabilityLevel;
price += 100 * (int)weapon.DamageLevel;
if (price < 1)
price = 1;
}
//Jewelry and Clothing Mod//
else if (item is BaseJewel)
{
BaseJewel jewel = (BaseJewel)item;
//Chance the Price multiplier here//
price += 7 * JewelItemProps.CheckJewel(jewel);
if (price < 1)
price = 1;
}
else if (item is BaseClothing)
{
BaseClothing clothing = (BaseClothing)item;
//Chance the Price multiplier here//
price += 7 * ClothingItemProps.CheckClothing(clothing);
if (price < 1)
price = 1;
}
else if (item is BaseBeverage)
{
int price1 = price, price2 = price;
if (item is Pitcher)
{
price1 = 3;
price2 = 5;
}
else if (item is BeverageBottle)
{
price1 = 3;
price2 = 3;
}
else if (item is Jug)
{
price1 = 6;
price2 = 6;
}
BaseBeverage bev = (BaseBeverage)item;
if (bev.IsEmpty || bev.Content == BeverageType.Milk)
price = price1;
else
price = price2;
}
return price;
}
public int GetBuyPriceFor(Item item)
{
return (int)(1.90 * this.GetSellPriceFor(item));
}
public string GetNameFor(Item item)
{
if (item.Name != null)
return item.Name;
else
return item.LabelNumber.ToString();
}
public bool IsSellable(Item item)
{
if (item.QuestItem)
return false;
//if ( item.Hue != 0 )
//return false;
return this.IsInList(item.GetType());
}
public bool IsResellable(Item item)
{
if (item.QuestItem)
return false;
//if ( item.Hue != 0 )
//return false;
return this.IsInList(item.GetType());
}
public bool IsInList(Type type)
{
return this.m_Table.ContainsKey(type);
}
}
}
Here is a mod to make Vendors calculate the rarity of the items to sell for better pricing Tristian came to me and asked
GenericSell.cs
Code:using System; using System.Collections.Generic; using Server.Items; using ItemNameHue; namespace Server.Mobiles { public class GenericSellInfo : IShopSellInfo { private readonly Dictionary<Type, int> m_Table = new Dictionary<Type, int>(); private Type[] m_Types; public GenericSellInfo() { } public Type[] Types { get { if (this.m_Types == null) { this.m_Types = new Type[this.m_Table.Keys.Count]; this.m_Table.Keys.CopyTo(this.m_Types, 0); } return this.m_Types; } } public void Add(Type type, int price) { this.m_Table[type] = price; this.m_Types = null; } public int GetSellPriceFor(Item item) { int price = 0; this.m_Table.TryGetValue(item.GetType(), out price); if (item is BaseArmor) { BaseArmor armor = (BaseArmor)item; if (armor.Quality == ArmorQuality.Low) price = (int)(price * 0.60); else if (armor.Quality == ArmorQuality.Exceptional) price = (int)(price * 1.25); //Chance the Price multiplier here// price += 7 * ArmorItemProps.CheckArmor(armor); price += 100 * (int)armor.Durability; price += 100 * (int)armor.ProtectionLevel; if (price < 1) price = 1; } else if (item is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)item; if (weapon.Quality == WeaponQuality.Low) price = (int)(price * 0.60); else if (weapon.Quality == WeaponQuality.Exceptional) price = (int)(price * 1.25); //Chance the Price multiplier here// price += 7 * WeaponItemProps.CheckWeapon(weapon); price += 100 * (int)weapon.DurabilityLevel; price += 100 * (int)weapon.DamageLevel; if (price < 1) price = 1; } //Jewelry and Clothing Mod// else if (item is BaseJewel) { BaseJewel jewel = (BaseJewel)item; //Chance the Price multiplier here// price += 7 * JewelItemProps.CheckJewel(jewel); if (price < 1) price = 1; } else if (item is BaseClothing) { BaseClothing clothing = (BaseClothing)item; //Chance the Price multiplier here// price += 7 * ClothingItemProps.CheckClothing(clothing); if (price < 1) price = 1; } else if (item is BaseBeverage) { int price1 = price, price2 = price; if (item is Pitcher) { price1 = 3; price2 = 5; } else if (item is BeverageBottle) { price1 = 3; price2 = 3; } else if (item is Jug) { price1 = 6; price2 = 6; } BaseBeverage bev = (BaseBeverage)item; if (bev.IsEmpty || bev.Content == BeverageType.Milk) price = price1; else price = price2; } return price; } public int GetBuyPriceFor(Item item) { return (int)(1.90 * this.GetSellPriceFor(item)); } public string GetNameFor(Item item) { if (item.Name != null) return item.Name; else return item.LabelNumber.ToString(); } public bool IsSellable(Item item) { if (item.QuestItem) return false; //if ( item.Hue != 0 ) //return false; return this.IsInList(item.GetType()); } public bool IsResellable(Item item) { if (item.QuestItem) return false; //if ( item.Hue != 0 ) //return false; return this.IsInList(item.GetType()); } public bool IsInList(Type type) { return this.m_Table.ContainsKey(type); } } }
if (values >= 250)
return String.Format("<BASEFONT COLOR=#FF8000>[Legendary {0}]",values) ;
else if (values >= 175)
return String.Format("<BASEFONT COLOR=#A335EE>[Epic {0}]",values);
else if (values >= 75)
return String.Format("<BASEFONT COLOR=#0070FF>[Rare {0}]", values);
else if (values >= 25)
return String.Format("<BASEFONT COLOR=#1EFF00>[Uncommon {0}]", values);
return String.Format("<BASEFONT COLOR=#D6D6D6>[Common {0}]", values);
if (values >= 300)
return "<BASEFONT COLOR=#FF944D>";
else if (values >= 200)
return "<BASEFONT COLOR=#B48FFF>";
else if (values >= 100)
return "<BASEFONT COLOR=#8DBAE8>";
else if (values >= 50)
return "<BASEFONT COLOR=#A1E68A>";
return "<BASEFONT COLOR=#D6D6D6>";
list.Add(1060658, "Totel Item Level : {0}",ArmorItemProps.CheckArmor(armor)+WeaponItemProps.CheckWeapon(weapon)+JewelItemProps.CheckJewel(jewel)+ClothingItemProps.CheckClothing(clothing));
foreach (long i in Enum.GetValues(typeof(AosWeaponAttribute)))
list.Add(1053099, ItemNameHue.WeaponItemProps.RarityNameMod(this, ((m_Quality == WeaponQuality.Exceptional) ? "Exceptional " : "") + "{0}\t{1}"), resourceName, GetNameString());
string itemnamehue = ItemNameHue.WeaponItemProps.GetWeaponItemValue(this);
string name = Name; // items no longer have names by default, they render the name defined in cliloc.<language>
if (name == null) // if item does have a name, it was specially named, so display only the name + color
list.Add(1053099, "{0}\t{1}", itemnamehue + resourceName, GetNameString());
else
list.Add(1053099, "{0}\t{1}", itemnamehue, GetNameString());
This works perfectly for everything Except Armor. it does not work at all for BaseArmor.here are my bases and my mods to the script for it.
We use essential cookies to make this site work, and optional cookies to enhance your experience.