[10679] New table npc_vendor_template for comon item data for diff vendors.

In vendor list show own vedor items + template ites if any.
Vendor template item lists selected by id stored in creature_template.vendor_id
This commit is contained in:
VladimirMangos 2010-11-04 18:27:08 +03:00
parent a0cb8494a9
commit 0bf8b0aa79
16 changed files with 217 additions and 68 deletions

View file

@ -12728,7 +12728,8 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId)
case GOSSIP_OPTION_VENDOR:
{
VendorItemData const* vItems = pCreature->GetVendorItems();
if (!vItems || vItems->Empty())
VendorItemData const* tItems = pCreature->GetVendorTemplateItems();
if ((!vItems || vItems->Empty()) && (!tItems || tItems->Empty()))
{
sLog.outErrorDb("Creature %u (Entry: %u) have UNIT_NPC_FLAG_VENDOR but have empty trading item list.", pCreature->GetGUIDLow(), pCreature->GetEntry());
hasMenuItem = false;
@ -18686,7 +18687,8 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
}
VendorItemData const* vItems = pCreature->GetVendorItems();
if(!vItems || vItems->Empty())
VendorItemData const* tItems = pCreature->GetVendorTemplateItems();
if ((!vItems || vItems->Empty()) && (!tItems || tItems->Empty()))
{
SendBuyError( BUY_ERR_CANT_FIND_ITEM, pCreature, item, 0);
return false;