aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
authorNay <dnpd.dd@gmail.com>2012-08-14 18:11:06 +0100
committerNay <dnpd.dd@gmail.com>2012-08-14 18:11:06 +0100
commitc0adf370e5ac3166bb74abb6d824556fbae54f6f (patch)
tree2b2b5aacb2e539acbbf58e92964fd6edc6529a88 /src/server/scripts
parente761458b249b8f2a128867ea0bd7adf5eaec4769 (diff)
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
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Commands/cs_npc.cpp10
1 files changed, 7 insertions, 3 deletions
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);