修复蜜蜡
This commit is contained in:
124
src/dispatch.cpp
124
src/dispatch.cpp
@@ -115,9 +115,10 @@ ENUM_PACK_RET_TYPE CDispatch::UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf)
|
||||
|
||||
//Data: equipment_citem->GetItemType=147418664 item_citem->is_stackable=1 item_citem->GetItemType=11
|
||||
int equipment_Type = ((CEquipItem*)equipment_citem)->GetItemType();
|
||||
int rarity = equipment_citem->get_rarity();
|
||||
|
||||
LOG(u8"Data: equipment_citem->GetItemType=%d item_citem->is_stackable=%d item_citem->GetItemType=%d"
|
||||
, (*(int(**)(CItem*))(*(int*)equipment_citem + 12))(equipment_citem)
|
||||
, equipment_Type
|
||||
, item_citem->is_stackable()
|
||||
, item_citem->GetItemType()
|
||||
);
|
||||
@@ -138,10 +139,14 @@ ENUM_PACK_RET_TYPE CDispatch::UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf)
|
||||
user->SendCmdErrorPacket(205, 209);
|
||||
return PAK_IGNORE;
|
||||
}
|
||||
|
||||
|
||||
Inven_Item new_equipment_item = {};
|
||||
invenR->GetInvenSlot(&new_equipment_item, CInventory::INVENTORY_TYPE_ITEM, equipment_pos);
|
||||
|
||||
|
||||
int v9 = 0; //返回给客户端的错误码
|
||||
switch (item_id)
|
||||
{
|
||||
case ITEM_ID_KUAJIESHI:
|
||||
if (item_id == ITEM_ID_KUAJIESHI)
|
||||
{
|
||||
LOG(u8"user->CheckInTrade:%d", user->CheckInTrade());
|
||||
|
||||
@@ -158,15 +163,9 @@ ENUM_PACK_RET_TYPE CDispatch::UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf)
|
||||
{
|
||||
CAccountCargo* AccountCargo = user->GetAccountCargo();
|
||||
|
||||
invenR = user->getCurCharacInvenR();
|
||||
|
||||
Inven_Item ins_item = {};
|
||||
|
||||
invenR->GetInvenSlot(&ins_item, CInventory::INVENTORY_TYPE_ITEM, equipment_pos);
|
||||
|
||||
|
||||
LOG(u8"ins_item.IsTradeLimitAttachTypeItem :%d", ins_item.IsTradeLimitAttachTypeItem());
|
||||
LOG(u8"AccountCargo->CheckInsertCondition :%d", AccountCargo->CheckInsertCondition(&ins_item));
|
||||
LOG(u8"ins_item.IsTradeLimitAttachTypeItem :%d", new_equipment_item.IsTradeLimitAttachTypeItem());
|
||||
LOG(u8"AccountCargo->CheckInsertCondition :%d", AccountCargo->CheckInsertCondition(&new_equipment_item));
|
||||
|
||||
int empty_slot = 0;
|
||||
if (AccountCargo->CheckSlotEmpty(empty_slot) != 1)
|
||||
@@ -186,8 +185,8 @@ ENUM_PACK_RET_TYPE CDispatch::UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf)
|
||||
|
||||
if (invenW->delete_item(CInventory::INVENTORY_TYPE_ITEM, equipment_pos, 1, 37, 1) && invenW->delete_item(CInventory::INVENTORY_TYPE_ITEM, item_pos, 1, 37, 1))
|
||||
{
|
||||
int a9 = AccountCargo->InsertItem(&ins_item, empty_slot);
|
||||
user->SendUpdateItemList(1, ins_item.GetItemSpace(), equipment_pos);
|
||||
int a9 = AccountCargo->InsertItem(&new_equipment_item, empty_slot);
|
||||
user->SendUpdateItemList(1, new_equipment_item.GetItemSpace(), equipment_pos);
|
||||
user->SendUpdateItemList(1, item_avartar->GetItemSpace(), item_pos);
|
||||
user->send_itemspace(12);
|
||||
|
||||
@@ -209,17 +208,6 @@ ENUM_PACK_RET_TYPE CDispatch::UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf)
|
||||
}
|
||||
return PAK_IGNORE;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
case ITEM_ID_YIJIRUHUN:
|
||||
{
|
||||
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -263,4 +251,90 @@ ENUM_PACK_RET_TYPE CDispatch::UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf)
|
||||
return PAK_OK;
|
||||
}
|
||||
|
||||
ENUM_PACK_RET_TYPE CDispatch::Dispatcher_ModItemAttr_dispatch_sig(Dispatcher_ModItemAttr* dis_mod, CUser* user, PacketBuf* pBuf)
|
||||
{
|
||||
if (user->get_state() != 3 || !user->getCurCharacR())
|
||||
{
|
||||
user->SendCmdErrorPacket(84, 0xD1u);
|
||||
return PAK_IGNORE;
|
||||
}
|
||||
int equipment_pos = pBuf->get_short();
|
||||
int equipment_id = pBuf->get_int();
|
||||
int item_pos = pBuf->get_short();
|
||||
|
||||
auto CurCharacInvenW = (CInventory*)user->getCurCharacInvenW();
|
||||
Inven_Item equipment_inven = {};
|
||||
CurCharacInvenW->GetInvenSlot(&equipment_inven, CInventory::INVENTORY_TYPE_ITEM, equipment_pos);
|
||||
|
||||
if (equipment_inven.isEmpty() || equipment_inven.getKey() != equipment_id)
|
||||
{
|
||||
user->SendCmdErrorPacket(84, 4);
|
||||
return PAK_IGNORE;
|
||||
}
|
||||
CItem* equipment_item = CDataManager::G_CDataManager()->find_item(equipment_id);
|
||||
if (!equipment_item)
|
||||
{
|
||||
user->SendCmdErrorPacket(84, 4);
|
||||
return PAK_IGNORE;
|
||||
}
|
||||
|
||||
int equipment_Type = ((CEquipItem*)equipment_item)->GetItemType();
|
||||
|
||||
if (equipment_Type <= 9 || equipment_Type > 21 || equipment_Type == 11)
|
||||
{
|
||||
user->SendCmdErrorPacket(84, 19);
|
||||
return PAK_IGNORE;
|
||||
}
|
||||
Inven_Item item_inven = {};
|
||||
CurCharacInvenW->GetInvenSlot(&item_inven, CInventory::INVENTORY_TYPE_ITEM, item_pos);
|
||||
|
||||
if (item_inven.isEmpty())
|
||||
{
|
||||
user->SendCmdErrorPacket(84, 17);
|
||||
return PAK_IGNORE;
|
||||
}
|
||||
|
||||
if (user->CheckItemLock(1, equipment_pos))
|
||||
{
|
||||
user->SendCmdErrorPacket(84, 0xD5u);
|
||||
return PAK_IGNORE;
|
||||
}
|
||||
|
||||
if (item_inven.getKey() != ITEM_ID_YIJIRUHUN)
|
||||
{
|
||||
user->SendCmdErrorPacket(84, 17);
|
||||
return PAK_IGNORE;
|
||||
}
|
||||
|
||||
int grade = equipment_item->get_grade();
|
||||
int rarity = equipment_item->get_rarity();
|
||||
int attach_type = equipment_item->GetAttachType();
|
||||
auto add_info = item_inven.get_add_info();
|
||||
|
||||
if (equipment_item->GetAttachType() != 3)
|
||||
{
|
||||
user->SendCmdErrorPacket(84, 19);
|
||||
return PAK_IGNORE;
|
||||
}
|
||||
if (equipment_inven.package != 0)
|
||||
{
|
||||
user->SendCmdErrorPacket(84, 18);
|
||||
return PAK_IGNORE;
|
||||
}
|
||||
if (CurCharacInvenW->delete_item(CInventory::INVENTORY_TYPE_ITEM, item_pos, 1, 3, 1) != 1)
|
||||
{
|
||||
user->SendCmdErrorPacket(84, -3);
|
||||
return PAK_IGNORE;
|
||||
}
|
||||
|
||||
equipment_inven.package = 1;
|
||||
CurCharacInvenW->update_item(
|
||||
CInventory::INVENTORY_TYPE_ITEM,
|
||||
equipment_pos,
|
||||
equipment_inven);
|
||||
|
||||
dis_mod->_SendResult(user, 1, item_pos, equipment_pos);
|
||||
|
||||
return PAK_IGNORE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user