What i saw at one server was that they disabled the "Sell" Function at the NPCs. I think that is a good idea. Is there a root function where it could be done for all of them at once?
I was searching fpr some root access to change the plain gold in the loot. I wanted to decrease it to 5% of the deafault or lower.
This is probaly not where i have to do it isnt:
ServUO-master\Scripts\Mobiles\Normal
Rat: this.AddLoot(LootPack.Poor);
Here ("\LootPack) i see some default value like 100. Is it that one?
ServUO-master\Scripts\Misc
\Loot
\LootPack
Do i have to change it for each creature single or is there some root where it could be done?
if (item.Stackable)
{
item.Amount = m_Quantity.Roll();
}
if (item.Stackable)
{
item.Amount = m_Quantity.Roll();
if (item is Gold)
{
item.Amount = (int)(item.Amount * 0.05);
}
}
This will lower the gold amount to 5% of what it was
This can be done in BaseVendor.cs
public int GetSellPriceFor(Item item, BaseVendor vendor)
{
int price = 0;
m_Table.TryGetValue(item.GetType(), out price);
if (vendor != null && BaseVendor.UseVendorEconomy)
{
IBuyItemInfo buyInfo = vendor.GetBuyInfo().OfType<GenericBuyInfo>().FirstOrDefault(info => info.EconomyItem && info.Type == item.GetType());
if (buyInfo != null)
{
int sold = buyInfo.TotalSold;
price = (int)((double)buyInfo.Price * .1); // .75
return Math.Max(1, price);
}
}
// if (item is BaseArmor)
// {
// BaseArmor armor = (BaseArmor)item;
[...]
// 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 GetSellPriceFor(Item item)
{
return GetSellPriceFor(item, null);
}
public class InternalSellInfo : GenericSellInfo
{
public InternalSellInfo()
{
}
}
public class InternalSellInfo : GenericSellInfo
{
public InternalSellInfo()
{
Add(typeof(InteriorDecorator), 5000);
if (Core.AOS)
Add(typeof(HousePlacementTool), 301);
}
}
Each profession has a corresponding SB* file in /scripts/vendorinfo
For example, the Animal Trainer file is SBAnimalTrainer.cs. That file determines what they sell, the price, and initial quantity they will stock. It also controls what they will buy and for how much.
Near the bottom is the InternalSellInfo section. For the Animal Trainer, that area is already empty and they won't buy anything from anyone.
Code:public class InternalSellInfo : GenericSellInfo { public InternalSellInfo() { } }
Looking at the Architect (SBArchitect.cs), we see they will buy two items:
Code:public class InternalSellInfo : GenericSellInfo { public InternalSellInfo() { Add(typeof(InteriorDecorator), 5000); if (Core.AOS) Add(typeof(HousePlacementTool), 301); } }
That will give you a good idea where & how to change these items or zero them out altogether.
if (item is BaseArmor)
{
BaseArmor armor = (BaseArmor)item;
if (armor.Quality == ItemQuality.Low)
price = (int)(price * 0.60);
else if (armor.Quality == ItemQuality.Exceptional)
price = (int)(price * 1.25);
price += 100 * (int)armor.Durability;
price += 100 * (int)armor.ProtectionLevel;
if (price < 1)
price = 1;
}
We use essential cookies to make this site work, and optional cookies to enhance your experience.