mirror of
https://github.com/ZhengPeiRu21/mod-reagent-bank
synced 2025-11-29 23:08:30 +08:00
mod: store gems to 'Jewelcrafting' section
This commit is contained in:
@@ -93,13 +93,18 @@ private:
|
|||||||
{
|
{
|
||||||
uint32 count = pItem->GetCount();
|
uint32 count = pItem->GetCount();
|
||||||
ItemTemplate const *itemTemplate = pItem->GetTemplate();
|
ItemTemplate const *itemTemplate = pItem->GetTemplate();
|
||||||
|
|
||||||
// gems such as Malachite/Tigerseye will be stored in ITEM_SUBCLASS_METAL_STONE (7), i.e. "Metal & Stone" section
|
|
||||||
if (!(itemTemplate->Class == ITEM_CLASS_TRADE_GOODS || itemTemplate->Class == ITEM_CLASS_GEM) || itemTemplate->GetMaxStackSize() == 1)
|
if (!(itemTemplate->Class == ITEM_CLASS_TRADE_GOODS || itemTemplate->Class == ITEM_CLASS_GEM) || itemTemplate->GetMaxStackSize() == 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
uint32 itemEntry = itemTemplate->ItemId;
|
uint32 itemEntry = itemTemplate->ItemId;
|
||||||
uint32 itemSubclass = itemTemplate->SubClass;
|
uint32 itemSubclass = itemTemplate->SubClass;
|
||||||
|
|
||||||
|
// Put gems to ITEM_SUBCLASS_JEWELCRAFTING section
|
||||||
|
if (itemTemplate->Class == ITEM_CLASS_GEM)
|
||||||
|
{
|
||||||
|
itemSubclass = ITEM_SUBCLASS_JEWELCRAFTING;
|
||||||
|
}
|
||||||
|
|
||||||
if (!entryToAmountMap.count(itemEntry))
|
if (!entryToAmountMap.count(itemEntry))
|
||||||
{
|
{
|
||||||
// Item does not exist yet in storage
|
// Item does not exist yet in storage
|
||||||
@@ -203,7 +208,15 @@ public:
|
|||||||
// Get the actual item subclass from the template
|
// Get the actual item subclass from the template
|
||||||
const ItemTemplate *temp = sObjectMgr->GetItemTemplate(item_subclass);
|
const ItemTemplate *temp = sObjectMgr->GetItemTemplate(item_subclass);
|
||||||
WithdrawItem(player, item_subclass);
|
WithdrawItem(player, item_subclass);
|
||||||
ShowReagentItems(player, creature, temp->SubClass, gossipPageNumber);
|
if (temp->Class == ITEM_CLASS_GEM)
|
||||||
|
{
|
||||||
|
// Get back to ITEM_SUBCLASS_JEWELCRAFTING section when withdrawing gems
|
||||||
|
ShowReagentItems(player, creature, ITEM_SUBCLASS_JEWELCRAFTING, gossipPageNumber);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowReagentItems(player, creature, temp->SubClass, gossipPageNumber);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (item_subclass == DEPOSIT_ALL_REAGENTS)
|
if (item_subclass == DEPOSIT_ALL_REAGENTS)
|
||||||
|
|||||||
Reference in New Issue
Block a user