mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 09:06:46 +00:00
Okay finally merchant buying works -.-
This commit is contained in:
+3
-1
@@ -827,7 +827,8 @@ public:
|
||||
void IncStats(uint8 type,int16 increase_val);
|
||||
void DropItem(int16 slot_id);
|
||||
|
||||
//New Inventory
|
||||
//inv2: New Inventory methods, will probably move these to Mob in a future update as there's
|
||||
//little reason for them to be in client except for simplicity of implementation atm
|
||||
bool SwapItem(const EQEmu::InventorySlot &src, const EQEmu::InventorySlot &dest, int number_in_stack);
|
||||
bool SummonItem(uint32 item_id,
|
||||
int16 charges,
|
||||
@@ -842,6 +843,7 @@ public:
|
||||
uint32 ornament_icon = 0,
|
||||
uint32 ornament_idfile = 0,
|
||||
uint32 ornament_hero_model = 0);
|
||||
bool PutItemInInventory(const EQEmu::InventorySlot &slot, std::shared_ptr<EQEmu::ItemInstance> inst, bool client_update = false);
|
||||
|
||||
//
|
||||
// class Client::TextLink
|
||||
|
||||
@@ -12075,11 +12075,9 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app)
|
||||
}
|
||||
|
||||
if(free_slot.IsCursor()) {
|
||||
if(m_inventory.Get(EQEmu::InventorySlot(EQEmu::InvTypePersonal, EQEmu::PersonalSlotCursor))) {
|
||||
Message(13, "You do not have room for any more items.");
|
||||
safe_delete(outapp);
|
||||
return;
|
||||
}
|
||||
Message(13, "You do not have room for any more items.");
|
||||
safe_delete(outapp);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!stacked && !free_slot.IsValid())
|
||||
@@ -12091,7 +12089,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app)
|
||||
|
||||
std::string packet;
|
||||
if(!stacked && inst) {
|
||||
//PutItemInInventory(free_slot, inst);
|
||||
PutItemInInventory(free_slot, inst);
|
||||
SendItemPacket(free_slot, inst, ItemPacketTrade);
|
||||
}
|
||||
else if (!stacked){
|
||||
@@ -12119,7 +12117,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app)
|
||||
inst->SetMerchantSlot(mp->itemslot);
|
||||
inst->SetMerchantCount(new_charges);
|
||||
|
||||
//SendItemPacket(mp->itemslot, inst, ItemPacketMerchant);
|
||||
SendItemPacket(EQEmu::InventorySlot(EQEmu::InvTypeMerchant, mp->itemslot), inst, ItemPacketMerchant);
|
||||
}
|
||||
}
|
||||
safe_delete(outapp);
|
||||
|
||||
@@ -3353,3 +3353,24 @@ bool Client::SummonItem(uint32 item_id,
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
bool Client::PutItemInInventory(const EQEmu::InventorySlot &slot, std::shared_ptr<EQEmu::ItemInstance> inst, bool client_update) {
|
||||
if(!inst)
|
||||
return false;
|
||||
|
||||
if(!slot.IsValid()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Putting item %s (%d) into slot %s", inst->GetBaseItem()->Name, inst->GetBaseItem()->ID, slot.ToString().c_str());
|
||||
|
||||
if(!m_inventory.Summon(slot, inst)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(client_update) {
|
||||
SendItemPacket(slot, inst, slot.IsCursor() ? ItemPacketSummonItem : ItemPacketTrade);
|
||||
}
|
||||
|
||||
CalcBonuses();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user