azerothcore / azerothcore-wotlk

Complete Open Source and Modular solution for MMO
http://www.azerothcore.org
GNU Affero General Public License v3.0
6.63k stars 2.64k forks source link

Feature: individual item gold cost per vendor + refactor npc_vendor #4329

Open BarbzYHOOL opened 3 years ago

BarbzYHOOL commented 3 years ago

Describe your feature request or suggestion in detail

1) We could have a new column override_gold_cost which allows to override the gold cost from item_template for each item sold by the vendor individually. This way we could have different gold prices for the same item, which is not possible actually.

2) Optional: The only issue with this is that it will increase the table size with no data. To solve that we could have this in a separate table like npc_vendor_extra. We could also move ExtendedCost to this new table because there are 25000 rows that do not use this column. Same for maxcount and incrtime cause they only represent 1600 rows... (Verified build could be deleted imo) We can also improve the table at the same time, just hit me up (notably on discord) for details on refactoring the table (data types, constraint keys, renaming etc)

Additional context

I put "good first issue" label as it doesn't seem that hard for a CPP dev, a nice feature to get started

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/96136590-feature-individual-item-gold-cost-per-vendor-refactor-npc_vendor?utm_campaign=plugin&utm_content=tracker%2F40032087&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F40032087&utm_medium=issues&utm_source=github).
BarbzYHOOL commented 3 years ago

Also the BuyCount column from item_template should be overwritable in the npc_vendor table, thus allowing to have different restock(age?) depending on the vendor (which means we can have two vendors selling the same things, but one is in a major city so he restocks quickly, while the other is in a small village, so he restocks slowly ;) ). Cf: https://www.azerothcore.org/wiki/npc_vendor#incrtime