2022-9-2 23:34:04

This commit is contained in:
小疯 2022-09-02 23:34:06 +08:00
parent b3ddde5254
commit 981b40bd96
7 changed files with 2134 additions and 124 deletions

View File

@ -5,7 +5,6 @@ namespace base
namespace CGameManager
{
const int G_CGameManager = 0x080CC18E;
}
namespace Dispatcher_UseJewel
@ -19,6 +18,12 @@ namespace base
{
const int Init = 0x08299FA0;
const int Init_fix_1 = 0x0829C075;
//base
const int s_pSecuProtectionField = 0x0941F7CC;
}
namespace CParty
@ -38,6 +43,8 @@ namespace base
const int getCurCharacLastPlayTick = 0x82A66AA;
const int get_level_up_exp = 0x0864E3BA;
const int getCurCharacInvenW = 0x80DA28E;
const int _checkItemMovable = 0x0865F1E1;
const int getCurCharacInvenR = 0x080DA27E;
}
namespace CUser
@ -57,6 +64,11 @@ namespace base
const int isGMUser = 0x0814589C;
const int exchange_interspace = 0x0865F7B0;
const int setLastPacketID = 0x0867CBC4;
const int GetAccountCargo = 0x0822FC22;
const int CheckInTrade = 0x080DA2FE;
const int IsExistAccountCargo = 0x0822FC30;
const int send_itemspace = 0x0865DB6C;
}
namespace CStackableItem
@ -70,6 +82,12 @@ namespace base
{
const int is_stackable = 0x80F12FA;
const int IsRoutingItem = 0x08150F18;
const int GetAttachType = 0x080F12E2;
}
namespace CEquipItem
{
const int GetItemType = 0x08514D26;
}
namespace Inven_Item
@ -78,6 +96,9 @@ namespace base
const int isEmpty = 0x811ED66;
const int getKey = 0x850D14E;
const int isEquipableItemType = 0x08150812;
const int IsTradeLimitAttachTypeItem = 0x081201DC;
const int GetItemSpace = 0x083481E2;
}
namespace CDataManager
@ -93,6 +114,7 @@ namespace base
const int use_money = 0x84FF54C;
const int gain_money = 0x84FF29C;
const int GetInvenRef = 0x84FC1DE;
const int GetInvenSlot = 0x084FB918;
}
namespace DB_UpdateAvatarJewelSlot
@ -193,7 +215,65 @@ namespace base
}
}
namespace CSecu_ProtectionField
{
const int Check = 0x08288A02;
}
namespace CAccountCargo
{
const int GetCapacity = 0x0822F012;
const int GetMoney = 0x0822F020;
const int CAccountCargo = 0x08289794;
const int SetDBData = 0x08289816;
const int Clear = 0x0828986C;
const int ResetSlot = 0x082898C0;
const int GetSlot = 0x082898F8;
const int GetSlotRef = 0x08289A0C;
const int CheckInsertCondition = 0x08289A4A;
const int InsertItem = 0x08289C82;
const int DeleteItem = 0x08289E3C;
const int MoveItem = 0x08289F26;
const int DepositMoney = 0x0828A12A;
const int WithdrawMoney = 0x0828A2F6;
const int CheckMoneyLimit = 0x0828A4CA;
const int CheckValidSlot = 0x0828A554;
const int GetEmptySlot = 0x0828A580;
const int CheckSlotEmpty = 0x0828A5D4;
const int GetSpecificItemSlot = 0x0828A61A;
const int CheckStackLimit = 0x0828A670;
const int AddMoney = 0x0828A742;
const int SubMoney = 0x0828A764;
const int GetItemCount = 0x0828A794;
const int SendNotifyMoney = 0x0828A7DC;
const int SendItemList = 0x0828A88A;
const int MakeItemPacket = 0x0828AB1C;
const int CreateAccountCargo = 0x0828AD72;
const int UpgradeAccountCargo = 0x0828B0B2;
const int SendNotifyRecipe = 0x0828B3D0;
const int DeleteAccountCargo = 0x0828B4EC;
const int SetStable = 0x0844DC16;
const int SetCapacity = 0x084EBE46;
const int IsAlter = 0x08695A0C;
}
namespace stMoveItemParam
{
const int stMoveItemParam_make = 0x08230CD4;
const int stMoveItemParam_destroy = 0x08248062;
const int stMoveItemParam_del = 0x08248092;
}
namespace cUserHistoryLog
{
const int AccountCargoAddItem = 0x086868B4;
}
namespace AvatarRechargeServer
{
const int Get = 0x081935A2;
const int SendDurability = 0x08190416;
}
}

View File

@ -71,23 +71,23 @@ int Controller::hook_IPacketDispatcher_ParamBase_dispatch_template(int a1, int a
Controller::Get()->old_IPacketDispatcher_ParamBase_dispatch_template(a1, a2, a3);
}
int Controller::hook_UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* pUser, PacketBuf* pBuf)
int Controller::hook_UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* user, PacketBuf* pBuf)
{
printf("getCurCharacName :%s \n", pUser->getCurCharacName().c_str());
printf("getCurCharacNo :%d \n", pUser->getCurCharacNo());
printf("getCurCharacName :%s \n", user->getCurCharacName().c_str());
printf("getCurCharacNo :%d \n", user->getCurCharacNo());
printf("get_buf_ptr :%p %p \n", pBuf->get_buf_ptr(0));
printf("get_len :%d \n", pBuf->get_len());
// printf("pBuf :%s \n", Util::ToHexString((const unsigned char*)pBuf->get_buf_ptr(0),40).c_str());
int state = pUser->get_state();
int state = user->get_state();
LOG("state :%d \n", state);
//校验角色状态是否允许镶嵌
if (state != 3)
return 0;
int isEnableAvatarSocketAction = pUser->isEnableAvatarSocketAction();
int isEnableAvatarSocketAction = user->isEnableAvatarSocketAction();
if (isEnableAvatarSocketAction)
pUser->SendCmdErrorPacket(205, (unsigned char)isEnableAvatarSocketAction);
user->SendCmdErrorPacket(205, (unsigned char)isEnableAvatarSocketAction);
//解析packet_buf
//时装所在的背包槽
@ -100,14 +100,14 @@ int Controller::hook_UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* pU
int emblem_cnt = pBuf->get_byte();
LOG("emblem_cnt :%d \n", emblem_cnt);
if (pUser->CheckItemLock(2, avartar_inven_slot))
if (user->CheckItemLock(2, avartar_inven_slot))
{
pUser->SendCmdErrorPacket(205, 213);
user->SendCmdErrorPacket(205, 213);
return 0;
}
//获取时装道具
CInventory* inven = pUser->getCurCharacInvenW();
CInventory* inven = user->getCurCharacInvenW();
if (!inven)
{
LOG("pUser->getCurCharacInvenW : error \n");
@ -120,7 +120,7 @@ int Controller::hook_UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* pU
return 0;
}
//校验时装 数据是否合法
if (avartar->isEmpty() || (avartar->getKey() != avartar_item_id) || pUser->CheckItemLock(2, avartar_inven_slot))
if (avartar->isEmpty() || (avartar->getKey() != avartar_item_id) || user->CheckItemLock(2, avartar_inven_slot))
{
LOG("avartar->isEmpty() || avartar->getKey() || pUser->CheckItemLock() : error \n");
@ -155,7 +155,7 @@ int Controller::hook_UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* pU
if (emblem->isEmpty() || (emblem->getKey() != emblem_item_id) || (avartar_socket_slot >= 3))
{
LOG("emblem->isEmpty() || (emblem->getKey() : error \n");
pUser->SendCmdErrorPacket(205, 209);
user->SendCmdErrorPacket(205, 209);
return 0;
}
@ -166,14 +166,14 @@ int Controller::hook_UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* pU
if (!DataManager)
{
LOG("CDataManager::G_CDataManager() : error \n");
pUser->SendCmdErrorPacket(205, 209);
user->SendCmdErrorPacket(205, 209);
return 0;
}
CItem* citem = DataManager->find_item(emblem_item_id);
if (!citem)
{
LOG("DataManager->find_item() : error \n");
pUser->SendCmdErrorPacket(205, 209);
user->SendCmdErrorPacket(205, 209);
return 0;
}
@ -181,7 +181,7 @@ int Controller::hook_UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* pU
if (!citem->is_stackable() || (citem->GetItemType() != 20))
{
LOG("citem->is_stackable() || (citem->GetItemType() : error \n");
pUser->SendCmdErrorPacket(205, 209);
user->SendCmdErrorPacket(205, 209);
return 0;
}
@ -194,7 +194,7 @@ int Controller::hook_UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* pU
{
//插槽类型不匹配
LOG("emblem_socket_type & avartar_socket_type\n");
pUser->SendCmdErrorPacket(205, 209);
user->SendCmdErrorPacket(205, 209);
return 0;
}
LOG("avartar_socket_slot:%d emblem_inven_slot:%d emblem_item_id:%d\n", avartar_socket_slot, emblem_inven_slot, emblem_item_id);
@ -206,7 +206,7 @@ int Controller::hook_UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* pU
{
//删除徽章
int emblem_inven_slot = avartar_socket_slot.second.first;
inven->delete_item(1, emblem_inven_slot, 1, 8, 1);
inven->delete_item(CInventory::INVENTORY_TYPE_ITEM, emblem_inven_slot, 1, 8, 1);
//设置时装插槽数据
int emblem_item_id = avartar_socket_slot.second.second;
@ -215,10 +215,10 @@ int Controller::hook_UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* pU
}
//时装插槽数据存档
DB_UpdateAvatarJewelSlot::makeRequest(pUser->getCurCharacNo(), avartar->get_ui_id(), (void*)jewel_socket_data);
DB_UpdateAvatarJewelSlot::makeRequest(user->getCurCharacNo(), avartar->get_ui_id(), (void*)jewel_socket_data);
//通知客户端时装数据已更新
pUser->SendUpdateItemList(1, 1, avartar_inven_slot);
user->SendUpdateItemList(1, 1, avartar_inven_slot);
LOG("徽章镶嵌完毕!!!");
//回包给客户端
InterfacePacketBuf* packet_guard = (InterfacePacketBuf*)PacketGuard::NewPacketGuard();
@ -226,7 +226,7 @@ int Controller::hook_UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* pU
packet_guard->put_header(1, 204);
packet_guard->put_int(1);
packet_guard->finalize(1);
pUser->Send((PacketGuard*)packet_guard);
user->Send((PacketGuard*)packet_guard);
PacketGuard::DelPacketGuard((PacketGuard*)packet_guard);
}
@ -258,6 +258,7 @@ int Controller::hook_PacketDispatcher_doDispatch(PacketDispatcher* a1, CUser* us
if (packet_id == Packet_UseEquipmentMoveItem)
{
int result = 0;
PacketBuf* v25 = PacketBuf::NewPacketBuf();
user->setLastPacketID(packet_id);
v25->bind_packet(packet_src, packet_len);
@ -271,11 +272,14 @@ int Controller::hook_PacketDispatcher_doDispatch(PacketDispatcher* a1, CUser* us
, Util::ToHexString((const unsigned char*)packet_src, packet_len).c_str()
);
int result = CDispatch::Get()->UseEquipmentMoveItem(user, v25);
if (v25)
{
ENUM_PACK_RET_TYPE ret = CDispatch::Get()->UseEquipmentMoveItem(user, v25);
result = (ret == PAK_ERROR) ? 1 : 0;
PacketBuf::DelPacketBuf(v25);
}
return result;
}
return Controller::Get()->old_PacketDispatcher_doDispatch(a1, user, packet_class, packet_id, packet_src, packet_len, a7, a8);

View File

@ -18,59 +18,70 @@ CDispatch::~CDispatch()
}
int CDispatch::UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf)
ENUM_PACK_RET_TYPE CDispatch::UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf)
{
int result = 0;
if (pBuf)
if (user->get_state() != 3)
{
LOG(u8"玩家状态不正常!");
return PAK_IGNORE;
}
int v110 = CSecu_ProtectionField::Get()->Check(user, 38);
if (v110)
{
user->SendCmdErrorPacket(84, v110);
return PAK_IGNORE;
}
LOG(u8"UseEquipmentMoveItem :%s ", Util::ToHexString((const unsigned char*)pBuf->get_buf_ptr(0), 40).c_str());
int equipment_pos = pBuf->get_short(); //装备位置
int equipment_id = pBuf->get_int(); //装备代码
int item_pos = pBuf->get_short(); //物品位置
//1 物品栏 2 时装
if (user->CheckItemLock(1, equipment_pos))
{
user->SendCmdErrorPacket(83, 213);
return result;
user->SendCmdErrorPacket(84, 0xD5);
return PAK_IGNORE;
}
CInventory* inven = user->getCurCharacInvenW();
if (!inven)
CInventory* invenR = user->getCurCharacInvenR();
if (!invenR)
{
LOG("user->getCurCharacInvenW : error \n");
return result;
LOG(u8"user->getCurCharacInvenW : error \n");
return PAK_IGNORE;
}
Inven_Item* equipment_avartar = inven->GetInvenRef(CInventory::INVENTORY_TYPE_ITEM, equipment_pos);
if (!equipment_avartar)
Inven_Item* equipment_InvenRef = invenR->GetInvenRef(CInventory::INVENTORY_TYPE_ITEM, equipment_pos);
if (!equipment_InvenRef)
{
LOG("inven->GetInvenRef : error \n");
return result;
LOG(u8"inven->GetInvenRef : error \n");
return PAK_IGNORE;
}
Inven_Item* item_avartar = inven->GetInvenRef(CInventory::INVENTORY_TYPE_ITEM, item_pos);
Inven_Item* item_avartar = invenR->GetInvenRef(CInventory::INVENTORY_TYPE_ITEM, item_pos);
if (!item_avartar)
{
LOG("inven->GetInvenRef : error \n");
return result;
LOG(u8"inven->GetInvenRef : error \n");
return PAK_IGNORE;
}
if (equipment_avartar->isEmpty() )
if (equipment_InvenRef->isEmpty())
{
LOG("服务器背包为空");
return result;
LOG(u8"equipment_InvenRef->isEmpty");
return PAK_IGNORE;
}
if (equipment_avartar->getKey() != equipment_id)
if (equipment_InvenRef->getKey() != equipment_id)
{
LOG("需要操作的装备ID和数据库的装备ID不一致");
return result;
LOG(u8"equipment_InvenRef->getKey() != equipment_id");
user->SendCmdErrorPacket(4, 0);
return PAK_IGNORE;
}
if (item_avartar->isEmpty())
{
LOG("需要操作的物品为空");
return result;
LOG(u8"item_avartar->isEmpty");
return PAK_IGNORE;
}
int item_id = item_avartar->getKey();
@ -79,20 +90,23 @@ int CDispatch::UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf)
if (!DataManager)
{
LOG("G_CDataManager 错误");
return result;
LOG(u8"G_CDataManager error");
return PAK_IGNORE;
}
CItem* equipment_citem = DataManager->find_item(equipment_id);
CItem* item_citem = DataManager->find_item(item_id);
LOG(u8"equipment_citem +12: %p"
, *(int*)equipment_citem + 12
);
if (!equipment_citem || !item_citem)
{
LOG("获取pvf中数据失败!");
return result;
LOG(u8"!equipment_citem || !item_citem");
return PAK_IGNORE;
}
LOG("UseEquipmentMoveItem [ equipment_pos:%d equipment_id:%d item_pos:%d item_id:%d ]"
LOG(u8"UseEquipmentMoveItem [ equipment_pos:%d equipment_id:%d item_pos:%d item_id:%d ]"
, equipment_pos
, equipment_id
, item_pos
@ -100,13 +114,124 @@ int CDispatch::UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf)
);
//Data: equipment_citem->GetItemType=147418664 item_citem->is_stackable=1 item_citem->GetItemType=11
LOG("Data: equipment_citem->GetItemType=%d item_citem->is_stackable=%d item_citem->GetItemType=%d"
, equipment_citem->GetItemType()
int equipment_Type = ((CEquipItem*)equipment_citem)->GetItemType();
LOG(u8"Data: equipment_citem->GetItemType=%d item_citem->is_stackable=%d item_citem->GetItemType=%d"
, (*(int(**)(CItem*))(*(int*)equipment_citem + 12))(equipment_citem)
, item_citem->is_stackable()
, item_citem->GetItemType()
);
if (equipment_Type <= 9 || equipment_Type > 21 || equipment_Type == 11)
{
LOG(u8"equipment_Type <= 9 || equipment_Type > 21 || equipment_Type == 11");
user->SendCmdErrorPacket(84, 0xD5);
return PAK_IGNORE;
}
if (item_citem->is_stackable() != true || item_citem->GetItemType() != ITEM_TYPE_CONSUMABLES)
{
LOG(u8"item_citem->is_stackable() != true || item_citem->GetItemType() != ITEM_TYPE_CONSUMABLES");
//没有镜像手机认证,无法使用该功能
user->SendCmdErrorPacket(205, 209);
return PAK_IGNORE;
}
int v9 = 0; //返回给客户端的错误码
switch (item_id)
{
case ITEM_ID_KUAJIESHI:
{
LOG(u8"user->CheckInTrade:%d", user->CheckInTrade());
if (user->CheckInTrade())
{
v9 = 19;
}
if (!user->IsExistAccountCargo())
{
v9 = 19;
LOG(u8"user->IsExistAccountCargo :%d", user->IsExistAccountCargo());
}
else
{
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));
int empty_slot = 0;
if (AccountCargo->CheckSlotEmpty(empty_slot) != 1)
{
empty_slot = AccountCargo->GetEmptySlot();
if (empty_slot < 0)
{
v9 = 4;
LOG("AccountCargo->CheckSlotEmpty :%d", empty_slot);
return PAK_IGNORE;
}
}
LOG(u8"empty_slot :%d", empty_slot);
//inven->delete_item(1, emblem_inven_slot, 1, 8, 1);
auto invenW = user->getCurCharacInvenW();
InterfacePacketBuf* packet_guard = (InterfacePacketBuf*)PacketGuard::NewPacketGuard();
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);
user->SendUpdateItemList(1, item_avartar->GetItemSpace(), item_pos);
user->send_itemspace(12);
packet_guard->put_header(1, 2000);
packet_guard->put_int(1);
packet_guard->finalize(1);
user->Send((PacketGuard*)packet_guard);
PacketGuard::DelPacketGuard((PacketGuard*)packet_guard);
LOG(u8"user->Send((PacketGuard*)packet_guard)", a9);
return PAK_OK;
}
else
{
packet_guard->put_header(1, 2000);
packet_guard->put_int(0);
packet_guard->finalize(0);
user->Send((PacketGuard*)packet_guard);
PacketGuard::DelPacketGuard((PacketGuard*)packet_guard);
}
return PAK_IGNORE;
}
}
break;
case ITEM_ID_YIJIRUHUN:
{
}
break;
default:
break;
}
/*
*/
//if (!item_citem->is_stackable() || (equipment_citem->GetItemType() != 20))
//{
// LOG("citem->is_stackable() || (citem->GetItemType() : error \n");
@ -114,6 +239,16 @@ int CDispatch::UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf)
// return 0;
//}
/*
[DNF_PROJECT] Recv() class:1 id:2000 len:21 packet_data :01 D0 07 15 00 00 00 36 E2 41 37 12 00 09 00 AD 6B 00 00 03 00
[DNF_PROJECT] UseEquipmentMoveItem :01 D0 07 15 00 00 00 36 E2 41 37 12 00 09 00 AD 6B 00 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[DNF_PROJECT] UseEquipmentMoveItem [ equipment_pos:9 equipment_id:27565 item_pos:3 item_id:2660238 ]
[DNF_PROJECT] Data: equipment_citem->GetItemType=0 item_citem->is_stackable=1 item_citem->GetItemType=11
*/
/*
Call (2000)
Call (,2)
@ -125,8 +260,7 @@ int CDispatch::UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf)
}
return result;
return PAK_OK;
}

View File

@ -14,7 +14,7 @@ public:
CDispatch();
~CDispatch();
public:
int UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf);
ENUM_PACK_RET_TYPE UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf);
protected:

View File

@ -6,3 +6,24 @@ enum ENUM_PACKET_ID
Packet_UseEquipmentMoveItem = 2000,
};
enum ENUM_PACK_RET_TYPE
{
PAK_OK = 0,
PAK_IGNORE = 1,
PAK_ERROR = 2,
};
enum ENUM_ITEM_TYPE
{
ITEM_TYPE_EQUIPMENT = 0,
ITEM_TYPE_CONSUMABLES = 11,
ITEM_TYPE_JEWEL = 20,
};
enum ENUM_ITEM_ID
{
ITEM_ID_YIJIRUHUN = 2660238, //一击入魂蜜蜡
ITEM_ID_KUAJIESHI = 20220831, //测试跨界石
};

View File

@ -25,6 +25,7 @@ template<typename R, typename A, typename ... ARG> R CallT(A call_addr, const AR
return R();
}
class CAccountCargo;
class DB_UpdateAvatarJewelSlot;
class CInventory;
class CStackableItem;
@ -100,6 +101,17 @@ public:
typedef CInventory* (*__func)(CUserCharacInfo* a1);
return ((__func)base::CUserCharacInfo::getCurCharacInvenW)(this);
}
bool _checkItemMovable(int a2, int a3, int a4, int a5, int a6, int a7)
{
CallT<bool>(base::CUserCharacInfo::_checkItemMovable, this, a2, a3, a4, a5, a6, a7);
}
CInventory* getCurCharacInvenR()
{
return CallT<CInventory*>(base::CUserCharacInfo::getCurCharacInvenR, this);
}
};
class CUser : public CUserCharacInfo
@ -167,6 +179,161 @@ public:
return CallT<CUser*>(base::CUser::setLastPacketID, this, a2);
}
CAccountCargo* GetAccountCargo()
{
return CallT<CAccountCargo*>(base::CUser::GetAccountCargo, this);
}
int CheckInTrade()
{
return CallT<int>(base::CUser::CheckInTrade, this);
}
bool IsExistAccountCargo()
{
return CallT<bool>(base::CUser::IsExistAccountCargo, this);
}
int send_itemspace(int a2)
{
return CallT<bool>(base::CUser::send_itemspace, this, a2);
}
};
class CAccountCargo
{
public:
int GetCapacity()
{
return CallT<int>(base::CAccountCargo::GetCapacity, this);
}
int GetMoney()
{
return CallT<int>(base::CAccountCargo::GetMoney, this);
}
int SetDBData(CUser* a2, Inven_Item* a3, uint a4, uint a5)
{
return CallT<int>(base::CAccountCargo::SetDBData, this, a2, a3, a4, a5);
}
int Clear()
{
return CallT<int>(base::CAccountCargo::Clear, this);
}
int ResetSlot(int a2)
{
return CallT<int>(base::CAccountCargo::ResetSlot, this, a2);
}
int* GetSlot(int a2)
{
return CallT<int*>(base::CAccountCargo::GetSlot, this, a2);
}
int GetSlotRef(int a2)
{
return CallT<int>(base::CAccountCargo::GetSlotRef, this, a2);
}
int CheckInsertCondition(Inven_Item* a2)
{
return CallT<int>(base::CAccountCargo::CheckInsertCondition, this, a2);
}
int InsertItem(Inven_Item* a2, int a3)
{
return CallT<int>(base::CAccountCargo::InsertItem, this, a2, a3);
}
int DeleteItem(int a2, int a3)
{
return CallT<int>(base::CAccountCargo::DeleteItem, this, a2, a3);
}
int MoveItem(int a2, int a3)
{
return CallT<int>(base::CAccountCargo::MoveItem, this, a2, a3);
}
int DepositMoney(uint a2)
{
return CallT<int>(base::CAccountCargo::DepositMoney, this, a2);
}
int WithdrawMoney(uint a2)
{
return CallT<int>(base::CAccountCargo::WithdrawMoney, this, a2);
}
int CheckMoneyLimit(uint a2)
{
return CallT<int>(base::CAccountCargo::CheckMoneyLimit, this, a2);
}
int CheckValidSlot(int a2)
{
return CallT<int>(base::CAccountCargo::CheckValidSlot, this);
}
int GetEmptySlot()
{
return CallT<int>(base::CAccountCargo::GetEmptySlot, this);
}
int CheckSlotEmpty(int a2)
{
return CallT<int>(base::CAccountCargo::CheckSlotEmpty, this, a2);
}
int GetSpecificItemSlot(int a2)
{
return CallT<int>(base::CAccountCargo::GetSpecificItemSlot, this, a2);
}
int CheckStackLimit(int a2, int a3, int a4)
{
return CallT<int>(base::CAccountCargo::CheckStackLimit, this);
}
int AddMoney(uint a2)
{
return CallT<int>(base::CAccountCargo::AddMoney, this, a2);
}
int SubMoney(uint a2)
{
return CallT<int>(base::CAccountCargo::SubMoney, this, a2);
}
int GetItemCount()
{
return CallT<int>(base::CAccountCargo::GetItemCount, this);
}
int SendNotifyMoney(int a2)
{
return CallT<int>(base::CAccountCargo::SendNotifyMoney, this, a2);
}
int SendItemList()
{
return CallT<int>(base::CAccountCargo::SendItemList, this);
}
int MakeItemPacket(PacketGuard* a2, int a3)
{
return CallT<int>(base::CAccountCargo::MakeItemPacket, this, a2, a3);
}
int CreateAccountCargo(CUser* a2)
{
return CallT<int>(base::CAccountCargo::CreateAccountCargo, this, a2);
}
int UpgradeAccountCargo(CUser* a2)
{
return CallT<int>(base::CAccountCargo::UpgradeAccountCargo, this, a2);
}
int SendNotifyRecipe(CUser* a2, int a3, bool a4)
{
return CallT<int>(base::CAccountCargo::SendNotifyRecipe, this, a2, a3, a4);
}
int DeleteAccountCargo(CUser* a2)
{
return CallT<int>(base::CAccountCargo::DeleteAccountCargo, this, a2);
}
int SetStable()
{
return CallT<int>(base::CAccountCargo::SetStable, this);
}
int SetCapacity(uint a2)
{
return CallT<int>(base::CAccountCargo::SetCapacity, this, a2);
}
int IsAlter(void)
{
return CallT<int>(base::CAccountCargo::IsAlter, this);
}
};
class CStackableItem
@ -191,9 +358,9 @@ class CItem : public CStackableItem
{
public:
//道具是否为消耗品
int is_stackable()
bool is_stackable()
{
typedef int (*__func)(CItem* a1);
typedef bool (*__func)(CItem* a1);
return ((__func)base::CItem::is_stackable)(this);
}
@ -203,12 +370,30 @@ public:
return ((__func)base::CItem::IsRoutingItem)(this);
}
int GetAttachType()
{
return CallT<int>(base::CItem::GetAttachType, this);
}
private:
};
class CEquipItem
{
public:
int GetItemType()
{
return CallT<int>(base::CEquipItem::GetItemType, this);
}
};
class Inven_Item
{
public:
unsigned char UnknownData_NUSL[0x3D];
public:
//获取道具附加信息
WongWork::CAvatarItemMgr* get_add_info()
{
@ -239,6 +424,17 @@ public:
{
return *(int*)(this + 0x7);
}
bool IsTradeLimitAttachTypeItem()
{
return CallT<bool>(base::Inven_Item::IsTradeLimitAttachTypeItem, this);
}
int GetItemSpace()
{
return CallT<int>(base::Inven_Item::GetItemSpace, this);
}
};
class CDataManager
@ -261,6 +457,7 @@ public:
class CInventory
{
public:
enum INVENTORY_TYPE : int
{
INVENTORY_TYPE_BODY = 0, //身上穿的装备
@ -276,10 +473,10 @@ public:
return ((__func)base::CInventory::GetAvatarItemMgrR)(this);
}
int delete_item(int a2, int a3, int a4, int a5, int a6)
int delete_item(INVENTORY_TYPE a2, int pos, int num, int a5, int a6 = 1)
{
typedef int (*__func)(CInventory* a1, int a2, int a3, int a4, int a5, int a6);
return ((__func)base::CInventory::delete_item)(this, a2, a3, a4, a5, a6);
typedef int (*__func)(CInventory* a1, INVENTORY_TYPE a2, int a3, int a4, int a5, int a6);
return ((__func)base::CInventory::delete_item)(this, a2, pos, num, a5, a6);
}
//使用金币
@ -302,6 +499,14 @@ public:
typedef Inven_Item* (*__func)(CInventory* a1, INVENTORY_TYPE a2, int a3);
return ((__func)base::CInventory::GetInvenRef)(this, a2, a3);
}
Inven_Item* GetInvenSlot(Inven_Item* a2, INVENTORY_TYPE a3, int a4)
{
typedef Inven_Item* (__attribute__((__stdcall__))* fnCInventory_GetInvenSlot)(Inven_Item* dest, CInventory* pThis, int space, int location);
static fnCInventory_GetInvenSlot CInventory_GetInvenSlot = (fnCInventory_GetInvenSlot)(base::CInventory::GetInvenSlot);
return CInventory_GetInvenSlot(a2, this, a3, a4);
}
};
class DB_UpdateAvatarJewelSlot
@ -321,6 +526,7 @@ public:
static PacketBuf* NewPacketBuf()
{
void* v62 = malloc(0x20000);
if (!v62) return NULL;
return CallT<PacketBuf*>(base::PacketBuf::PacketBuf_make, v62);
}
@ -447,6 +653,7 @@ public:
{
void* v62 = malloc(0x20000);
typedef int (*__func)(void* a1);
if (!v62) return NULL;
((__func)base::PacketGuard::PacketGuard_make)(v62);
return (PacketGuard*)v62;
}
@ -474,7 +681,67 @@ public:
}
};
class CSecu_ProtectionField
{
public:
static CSecu_ProtectionField* Get()
{
return (CSecu_ProtectionField*)(*(int*)base::GlobalData::s_pSecuProtectionField);
}
int Check(CUser* a2, int a3)
{
return CallT<int>(base::CSecu_ProtectionField::Check, this, a2, a3);
}
};
class stMoveItemParam
{
public:
static stMoveItemParam* NewstMoveItemParam()
{
void* v62 = malloc(0x20000);
if (!v62) return NULL;
CallT<int>(base::stMoveItemParam::stMoveItemParam_make, v62);
return (stMoveItemParam*)v62;
}
static void DelstMoveItemParam(stMoveItemParam* a1)
{
CallT<int>(base::stMoveItemParam::stMoveItemParam_destroy, a1);
free(a1);
}
static void DelstMoveItemParam2(stMoveItemParam* a1)
{
CallT<int>(base::stMoveItemParam::stMoveItemParam_del, a1);
}
};
class cUserHistoryLog
{
public:
};
class AvatarRechargeServer
{
public:
static AvatarRechargeServer* Get()
{
return CallT<AvatarRechargeServer*>(base::AvatarRechargeServer::Get);
}
char SendDurability(CUser* a2, char a3, short a4, char a5, int a6)
{
return CallT<char>(base::AvatarRechargeServer::SendDurability, this, a2, a3, a4, a5, a6);
}
};
#endif // __DXFBASE_H__

File diff suppressed because it is too large Load Diff