mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user