|
楼主 |
发表于 2024-10-9 07:32:06
|
显示全部楼层
var CUserCharacInfo_getCurCharacInvenW = new NativeFunction(ptr(0x80DA28E), 'pointer', ['pointer'], {"abi":"sysv"});
var CInventory_GetInvenRef = new NativeFunction(ptr(0x84FC1DE), 'pointer', ['pointer', 'int', 'int'], {"abi":"sysv"});
var Inven_Item_isEmpty = new NativeFunction(ptr(0x811ED66), 'int', ['pointer'], {"abi":"sysv"});
var CUser_send_itemspace = new NativeFunction(ptr(0x865DB6C), 'int', ['pointer', 'int'], {"abi":"sysv"});
function CreatureEh(user){
var CreatureEqu = CUserCharacInfo_getCurCharacInvenW(user);//获取背包
var CreatureEquZero = CInventory_GetInvenRef(CreatureEqu, 3, 140);//获取宠物栏宠物装备第一个格子
if(Inven_Item_isEmpty(CreatureEquZero))//检查格子中的部位是否是空的
{
api_CUser_SendNotiPacketMessage(user, "附魔失败, 缺少适合条件的装备", 3);
}else{
CreatureEquZero.add(13).writeU32(2550098);//附魔的卡片ID(徽章ID同样适用)
api_CUser_SendNotiPacketMessage(user, "附魔成功。", 3);
}
CUser_send_itemspace(user, 7);//更新背包
} |
|