Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPCs buy exceptional weapons for very high prices #4981

Open
Lexshmyr opened this issue Dec 27, 2021 · 0 comments
Open

NPCs buy exceptional weapons for very high prices #4981

Lexshmyr opened this issue Dec 27, 2021 · 0 comments

Comments

@Lexshmyr
Copy link

Maybe there was some limiting code in the past, but the current Scripts/VendorInfo/GenericSell.cs uses 10 * the Damage increase of a weapon added to any exceptional weapons as the buy price from players for NPCs.

The OSI buy price is at a loss for most of these items. (exceptional daggers 8gp, exceptional katana 12gp; even at the base of 5gp for iron ingots buying the ingots to craft would not be profitable).

Here is the piece of code in the current ServUO (pub 58):
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 += 5 * armor.ArmorAttributes.DurabilityBonus;

            if (price < 1)
                price = 1;
        }
        else if (item is BaseWeapon)
        {
            BaseWeapon weapon = (BaseWeapon)item;

            if (weapon.Quality == ItemQuality.Low)
                price = (int)(price * 0.60);
            else if (weapon.Quality == ItemQuality.Exceptional)
                price = (int)(price * 1.25);

            price += 100 * weapon.WeaponAttributes.DurabilityBonus;

            price += 10 * weapon.Attributes.WeaponDamage;

            if (price < 1)
                price = 1;
        }

weapon.WeaponAttributes.DurabilityBonus = 0 on crafted items. It seems it may have a value for artifacts (which will not be exceptional), but I was not getting anything other than 0 for that value on items I tested crafting.

weapon.Attributes.WeaponDamage is Damage Increase, which is 35%-40% depending on the Arms Lore skill of the player. So this is adding 350 to 400 gold to the price the NPC will pay for the item.

I would think an appropriate buy value would be about 2x or 3x what it costs to make it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant