frida实现宠物装备附魔
代码:
//宠物装备镶嵌卡片
function CreatureEh(user, account_id, charac_no) {
var CreatureEqu = CUserCharacInfo_getCurCharacInvenW(user); //获取背包
//获取卡片栏第一格
var cardZero = CInventory_GetInvenRef(CreatureEqu, INVENTORY_TYPE_ITEM, 201);
var itemId = Inven_Item_getKey(cardZero);//获取卡片ID
//获取宠物栏宠物装备第一个格子
var CreatureEquZero = CInventory_GetInvenRef(CreatureEqu, 3, 140);
var creatureId = Inven_Item_getKey(CreatureEquZero);//获取宠物装备ID
var charac_name = api_CUserCharacInfo_getCurCharacName(user);
if ( Inven_Item_isEmpty(CreatureEquZero) || Inven_Item_isEmpty(cardZero) ) {
//检查格子中的部位是否是空的
api_CUser_SendNotiPacketMessage(user, "附魔失败, 缺少适合条件的装备", 16);
api_CUser_AddItem(user, itemId, 1);//恢复附魔卡
} else {
var sql = "select creature_equ from creature_equ_eh where accout = '"+account_id+"' and creature_equ = '"+creatureId+"'";
var info = getInfo(mysql_taiwan_cain, sql, 0);
if(!info){
//添加数据
var value = {
charac_no: charac_no,
accout: account_id,
creature_equ: creatureId,
card_id: itemId
};
addData(mysql_taiwan_cain, "creature_equ_eh", value);
}else{
var data = {
card_id: itemId
};
var where = {
accout: account_id,
creature_equ: creatureId
};
updataData(mysql_taiwan_cain, "creature_equ_eh", data, where);
}
//附魔的卡片ID itemId
CreatureEquZero.add(13).writeU32(itemId);
CInventory_delete_item(CreatureEqu, 1, 201, 1, 20, 1);//删除卡片第一格
api_CUser_SendNotiPacketMessage(user, "恭喜玩家["+charac_name+"],宠物装备附魔卡片成功", 16);
}
CUser_send_itemspace(user, 7); //更新背包
CUser_SendUpdateItemList(user, 1, 0, 201);//通知客户端更新卡片栏第一格
}
其次在捕获游戏事件中,使用物品触发事件添加代码
if(game_event == 'Item-') {
if(3 == reason) {
//使用道具
if(item_id == 2020301509){
//宠物装备附魔
CreatureEh(user, account_id, charac_no);
}
}
} 你怎么啥都折腾,哈哈哈,6 大佬 牛皮
大佬,frida怎么能拿到宝珠里面的卡片指向ID,我想实现直接用宝珠附魔,想拿到宝珠里面的卡片指向 感谢 同理是不是宠物也能,但是我试了试会消失不知道怎么弄 牛逼 厉害 牛逼 要是有视频就好了 大佬,分享过期了~~~ 感谢大佬分享 大佬分享过期了 楼主大佬能分享下吗,具体操作步骤能不能教一下 这个位置这样对吗
页:
[1]