下面这个是修复装备的函数,我根据吧里的老哥的做了改进,可以修复快捷道具栏和身上穿戴的装备
先把这下面一大段复制到FRIDA里面
var CEquipItem_get_endurance = new NativeFunction(ptr(0x0811ED98), 'int', ['pointer'], { 'abi': 'sysv' });
function repair_equ(user) {
//遍历身上的装备
var inven = CUserCharacInfo_getCurCharacInvenW(user);
for (var slot = 10; slot <= 21; slot++) {
var item = CInventory_GetInvenRef(inven, INVENTORY_TYPE_BODY, slot);
var item_id = Inven_Item_getKey(item);
if (item_id) {
var item_data = CDataManager_find_item(G_CDataManager(), item_id);
var durability_max = CEquipItem_get_endurance(item_data);
item.add(11).writeU16(durability_max);
CUser_SendUpdateItemList(user, 1, 3, slot)
}
}
for (var slot = 3; slot <= 8; slot++) {
var item = CInventory_GetInvenRef(inven, INVENTORY_TYPE_ITEM, slot);
var item_id = Inven_Item_getKey(item);
if (item_id) {
var item_data = CDataManager_find_item(G_CDataManager(), item_id);
var durability_max = CEquipItem_get_endurance(item_data);
item.add(11).writeU16(durability_max);
}
}
api_CUser_SendNotiPacketMessage(user, '通知 : 装备已经修复', 6);
CUser_send_itemspace(user, ENUM_ITEMSPACE_INVENTORY);
}
找到 function hook_history_log() 函数
然后在下面这个判断里面加上 repair_equ(user); 如下所示
else if(game_event == 'DungeonLeave')
{
//离开副本
//刷完副本后, 重置异界+极限祭坛次数
// CUser_DimensionInoutUpdate(user, 1, 1);
repair_equ(user);
即可实现回城后自动修复装备
先把这下面一大段复制到FRIDA里面
var CEquipItem_get_endurance = new NativeFunction(ptr(0x0811ED98), 'int', ['pointer'], { 'abi': 'sysv' });
function repair_equ(user) {
//遍历身上的装备
var inven = CUserCharacInfo_getCurCharacInvenW(user);
for (var slot = 10; slot <= 21; slot++) {
var item = CInventory_GetInvenRef(inven, INVENTORY_TYPE_BODY, slot);
var item_id = Inven_Item_getKey(item);
if (item_id) {
var item_data = CDataManager_find_item(G_CDataManager(), item_id);
var durability_max = CEquipItem_get_endurance(item_data);
item.add(11).writeU16(durability_max);
CUser_SendUpdateItemList(user, 1, 3, slot)
}
}
for (var slot = 3; slot <= 8; slot++) {
var item = CInventory_GetInvenRef(inven, INVENTORY_TYPE_ITEM, slot);
var item_id = Inven_Item_getKey(item);
if (item_id) {
var item_data = CDataManager_find_item(G_CDataManager(), item_id);
var durability_max = CEquipItem_get_endurance(item_data);
item.add(11).writeU16(durability_max);
}
}
api_CUser_SendNotiPacketMessage(user, '通知 : 装备已经修复', 6);
CUser_send_itemspace(user, ENUM_ITEMSPACE_INVENTORY);
}
找到 function hook_history_log() 函数
然后在下面这个判断里面加上 repair_equ(user); 如下所示
else if(game_event == 'DungeonLeave')
{
//离开副本
//刷完副本后, 重置异界+极限祭坛次数
// CUser_DimensionInoutUpdate(user, 1, 1);
repair_equ(user);
即可实现回城后自动修复装备