From c0adf370e5ac3166bb74abb6d824556fbae54f6f Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 14 Aug 2012 18:11:06 +0100 Subject: Core/Vendors: Add currencies to vendors npc_vendor table gets a new field, type (1 is item, 2 is currency) for type 1 fields still mean the same, for type 2 maxcount is buycount (without any "precision") changed structure of SMSG_UPDATE_CURRENCY(_WEEK_LIMIT) but not enabled, wrong values are being wrongly calculated --- src/server/scripts/Commands/cs_npc.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 77fc2918e0b..e43760191df 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -178,6 +178,8 @@ public: if (!*args) return false; + const uint8 type = 1; // FIXME: make type (1 item, 2 currency) an argument + char* pitem = handler->extractKeyFromLink((char*)args, "Hitem"); if (!pitem) { @@ -214,13 +216,13 @@ public: uint32 vendor_entry = vendor ? vendor->GetEntry() : 0; - if (!sObjectMgr->IsVendorItemValid(vendor_entry, itemId, maxcount, incrtime, extendedcost, handler->GetSession()->GetPlayer())) + if (!sObjectMgr->IsVendorItemValid(vendor_entry, itemId, maxcount, incrtime, extendedcost, type, handler->GetSession()->GetPlayer())) { handler->SetSentErrorMessage(true); return false; } - sObjectMgr->AddVendorItem(vendor_entry, itemId, maxcount, incrtime, extendedcost); + sObjectMgr->AddVendorItem(vendor_entry, itemId, maxcount, incrtime, type, extendedcost); ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(itemId); @@ -435,7 +437,9 @@ public: } uint32 itemId = atol(pitem); - if (!sObjectMgr->RemoveVendorItem(vendor->GetEntry(), itemId)) + const uint8 type = 1; // FIXME: make type (1 item, 2 currency) an argument + + if (!sObjectMgr->RemoveVendorItem(vendor->GetEntry(), itemId, type)) { handler->PSendSysMessage(LANG_ITEM_NOT_IN_LIST, itemId); handler->SetSentErrorMessage(true); -- cgit v1.2.3