找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 434|回复: 14

【分享】分享个小东西,frida十连开魔盒,热重载实时控制

[复制链接]

1431

主题

1万

回帖

3万

积分

登峰造极

积分
39303
发表于 2025-1-14 20:47:20 | 显示全部楼层 |阅读模式
有开盒ui弹窗,可公告,开启道具记录,保底道具,




本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
回复

使用道具 举报

1431

主题

1万

回帖

3万

积分

登峰造极

积分
39303
 楼主| 发表于 2025-1-14 20:47:47 | 显示全部楼层
var INVENTORY_TYPE_ITEM = 1;
var ENUM_ITEMSPACE_INVENTORY = 0;
var mysteryBoxItems = [
{ name: "特级邪念结晶*1", id: 3248, count: 1, weight: 5000, announce: 0 },
{ name: "异次元碎片*1", id: 3311, count: 1, weight: 2000, announce: 0 },
{ name: "一百万金币x1", id: 3340, count: 1, weight: 500, announce: 0 },
{ name: "结晶碎片x1", id: 24082302, count: 1, weight: 1000, announce: 0 },
{ name: "神圣的战神女神防具随机礼盒x1", id: 24082303, count: 1, weight: 50, announce: 0 },
{ name: "神圣稀有克隆装扮单件礼盒(可交易)x1", id: 8327, count: 1, weight: 50, announce: 0 },
{ name: "装备保护券x1", id: 8050, count: 1, weight: 100, announce: 0 },
{ name: "冰龙斯卡萨的宝珠x1", id: 2021458869, count: 1, weight: 20, announce: 0 },
{ name: "黑色瘟疫狄瑞吉的宝珠x1", id: 2600422, count: 1, weight: 20, announce: 0 },
{ name: "烈焰彼诺修的宝珠x1", id: 2600298, count: 1, weight: 20, announce: 0 },
{ name: "光之城主赛格哈特的宝珠x1", id: 2600294, count: 1, weight: 20, announce: 0 },
{ name: "2011国庆炫彩宝珠x1", id: 2682041, count: 1, weight: 20, announce: 0 },
{ name: "奇幻宝珠x1", id: 2682207, count: 1, weight: 20, announce: 0 },
{ name: "龙年智力宝珠x1", id: 2682164, count: 1, weight: 20, announce: 0 },
{ name: "龙年力量宝珠x1", id: 2682163, count: 1, weight: 20, announce: 0 },
{ name: "龙年福泽宝珠x1", id: 2682165, count: 1, weight: 20, announce: 0 },
{ name: "精-御魔之灵宝珠x1", id: 2682859, count: 1, weight: 20, announce: 0 },
{ name: "精-御魔之魂宝珠x1", id: 2682857, count: 1, weight: 20, announce: 0 },
{ name: "童话王国-艾丽斯(白金版)x1", id: 2681503, count: 1, weight: 50, announce: 0 },
{ name: "使徒的命运x1", id: 2747557, count: 1, weight: 20, announce: 0 },
{ name: "明日之洗礼-春华x1", id: 100330792, count: 1, weight: 10, announce: 0 },
{ name: "哥特绮梦(圣羽)x1", id: 400330033, count: 1, weight: 5, announce: 1 },
{ name: "天选之人x1", id: 400330106, count: 1, weight: 5, announce: 1 },
{ name: "羊小咩(心悦1)x1", id: 20222207, count: 1, weight: 20, announce: 0 },
{ name: "羊小咩(心悦2)x1", id: 20222208, count: 1, weight: 10, announce: 0 },
{ name: "羊小咩(心悦3)x1", id: 20222209, count: 1, weight: 5, announce: 1 },
{ name: "lv55史诗武器自选礼盒x1", id: 8385, count: 1, weight: 5, announce: 1 },
{ name: "稀有宝珠随机罐x1", id: 24083001, count: 1, weight: 100, announce: 0 },
{ name: "神器宝珠随机罐x1", id: 24083002, count: 1, weight: 20, announce: 0 },
{ name: "史诗宝珠随机罐x1", id: 24083003, count: 1, weight: 5, announce: 1 },
{ name: "精炼的泰拉石随机礼盒x1", id: 24083010, count: 1, weight: 50, announce: 0 },
{ name: "朦胧记忆中的故事随机礼盒x1", id: 24083011, count: 1, weight: 50, announce: 0 },
{ name: "格拉西亚家族的印章随机礼盒x1", id: 24083104, count: 1, weight: 50, announce: 0 },
{ name: "+10白银增幅券x1", id: 8313, count: 1, weight: 500, announce: 0 },
{ name: "+10黄金增幅券x1", id: 8316, count: 1, weight: 240, announce: 0 },
{ name: "+10铂金增幅券x1", id: 8319, count: 1, weight: 120, announce: 0 },
{ name: "+10增幅券x1", id: 8236, count: 1, weight: 90, announce: 0 },
{ name: "+11青铜增幅券x1", id: 8311, count: 1, weight: 240, announce: 0 },
{ name: "+11黄金增幅券x1", id: 8317, count: 1, weight: 120, announce: 0 },
{ name: "+11铂金增幅券x1", id: 8320, count: 1, weight: 90, announce: 0 },
{ name: "+11增幅券x1", id: 8237, count: 1, weight: 60, announce: 0 },
{ name: "+12青铜增幅券x1", id: 24083101, count: 1, weight: 120, announce: 0 },
{ name: "+12黄金增幅券x1", id: 24083102, count: 1, weight: 90, announce: 0 },
{ name: "+12铂金增幅券x1", id: 24083103, count: 1, weight: 60, announce: 0 },
{ name: "+12增幅券x1", id: 8324, count: 1, weight: 30, announce: 0 },
{ name: "精致的装备保护券x1", id: 8239, count: 1, weight: 400, announce: 0 },
{ name: "神圣的装备保护券x1", id: 8240, count: 1, weight: 200, announce: 0 },
{ name: "无双的装备保护券x1", id: 8326, count: 1, weight: 100, announce: 0 },
{ name: "RE光环礼盒x1", id: 490703795, count: 1, weight: 2, announce: 1 },
{ name: "雾神-球球宠物礼盒x1", id: 24090101, count: 1, weight: 2, announce: 1 },
{ name: "全职业武器装扮礼盒x1", id: 20223004, count: 1, weight: 50, announce: 0 },
{ name: "宠物装备自选礼盒x1", id: 490703798, count: 1, weight: 100, announce: 0 },
{ name: "疲劳药剂x1", id: 10000541, count: 1, weight: 500, announce: 0 },
{ name: "鬼剑士毕业武器随机礼盒x1", id: 24083004, count: 1, weight: 50, announce: 0 },
{ name: "神枪手毕业武器随机礼盒x1", id: 24083005, count: 1, weight: 50, announce: 0 },
{ name: "格斗家毕业武器随机礼盒x1", id: 24083006, count: 1, weight: 50, announce: 0 },
{ name: "魔法师毕业武器随机礼盒x1", id: 24083007, count: 1, weight: 50, announce: 0 },
{ name: "圣职者毕业武器随机礼盒x1", id: 24083008, count: 1, weight: 50, announce: 0 },
{ name: "全职业毕业首饰随机礼盒x1", id: 24083009, count: 1, weight: 50, announce: 0 },
{ name: "魔法石随机礼盒x1", id: 24083015, count: 1, weight: 100, announce: 0 },
{ name: "辅助装备随机礼盒x1", id: 24083016, count: 1, weight: 100, announce: 0 },
{ name: "全职业个性皮肤礼盒x1", id: 478887, count: 1, weight: 20, announce: 0 },
{ name: "特级邪念结晶x6", id: 3248, count: 6, weight: 1000, announce: 0 },
{ name: "异次元碎片x6", id: 3311, count: 6, weight: 500, announce: 0 },
{ name: "3期勇者防具单件自选礼盒x1", id: 24090601, count: 1, weight: 20, announce: 0 },
{ name: "3期勇者首饰单件自选礼盒x1", id: 24090602, count: 1, weight: 20, announce: 0 },
{ name: "神器克隆皮肤自选礼盒x1", id: 490002046, count: 1, weight: 10, announce: 0 },
{ name: "神器克隆装扮单件礼盒x1", id: 490002046, count: 1, weight: 40, announce: 0 },
{ name: "神兽神器装扮单件礼盒x1", id: 490002031, count: 1, weight: 40, announce: 0 },
{ name: "机甲神兽神器装扮单件礼盒x1", id: 20206111, count: 1, weight: 40, announce: 0 },
{ name: "镇魂之石x1", id: 10000204, count: 1, weight: 1000, announce: 0 },
{ name: "镇魂之石x3", id: 10000204, count: 3, weight: 350, announce: 0 },
{ name: "艾丽丝之歌", id: 4830, count: 1, weight: 300, announce: 0 },
{ name: "跨界石", id: 123001, count: 1, weight: 100, announce: 0 },
{ name: "继承卷", id: 123007, count: 1, weight: 200, announce: 0 },
];
var insufficientSpaceReward = { name: "安慰奖", id: 123019, count: 1, announce: 0 };
var MYSTERY_BOX_ID = 123019;
var guaranteedItemId = 2749403;
var guaranteedItemCount = 1;
回复

使用道具 举报

1431

主题

1万

回帖

3万

积分

登峰造极

积分
39303
 楼主| 发表于 2025-1-14 20:48:43 | 显示全部楼层
function UserUseItemEvent(user, item_id) {
if (MYSTERY_BOX_ID == item_id) {
if (hasEnoughInventorySpace(user, 10)) {
var rewardItems = {};
var announceMessage = '玩家[' + api_CUserCharacInfo_getCurCharacName(user) + ']使用了烟花,获得了'; // 用于全服公告的消息
var shouldAnnounce = false;
for (var i = 0; i < 10; i++) {
var rewardItem = getRandomItemByWeight(mysteryBoxItems);
if (rewardItems[rewardItem.id]) {
rewardItems[rewardItem.id] += rewardItem.count;
} else {
rewardItems[rewardItem.id] = rewardItem.count;
}
if (rewardItem.announce === 1) {
shouldAnnounce = true;
announceMessage += '[' + rewardItem.name + '*' + rewardItems[rewardItem.id] + ']';
if (i < 9) {
announceMessage += '、';
}
}
}
rewardItems[guaranteedItemId] = (rewardItems[guaranteedItemId] || 0) + 10 * guaranteedItemCount;
var message = '玩家[' + api_CUserCharacInfo_getCurCharacName(user) + ']使用了烟花,获得了';
for (var itemId in rewardItems) {
message += '[' + api_CItem_getItemName(parseInt(itemId)) + '*' + rewardItems[itemId] + ']';
if (itemId != guaranteedItemId) {
message += '、';
}
}
message += '!';
var rewardList = [];
for (var itemId in rewardItems) {
rewardList.push([parseInt(itemId), rewardItems[itemId]]);
}
api_CUser_Add_Item_list(user, rewardList);
api_CUser_SendNotiPacketMessage(user, message, 1);
if (shouldAnnounce) {
api_gameWorld_SendNotiPacketMessage(announceMessage + '!', 14);
}
} else {
api_CUser_AddItem(user, MYSTERY_BOX_ID, 1);
api_CUser_SendNotiPacketMessage(user, '\n您的消耗品或材料栏位不足10个空位,请清理后再使用!', 1);
}
}
}
function hasEnoughInventorySpace(user, requiredSlots) {
var inven = CUserCharacInfo_getCurCharacInvenW(user);
return countEmptySlots(inven, 57, 104) >= requiredSlots && countEmptySlots(inven, 105, 152) >= requiredSlots;
}
function countEmptySlots(inven, startSlot, endSlot) {
var emptyCount = 0;
for (var slot = startSlot; slot <= endSlot; slot++) {
var item = CInventory_GetInvenRef(inven, INVENTORY_TYPE_ITEM, slot);
if (Inven_Item_isEmpty(item)) {
emptyCount++;
}
}
return emptyCount;
}
function getRandomItemByWeight(items) {
var totalWeight = 0;
for (var i = 0; i < items.length; i++) {
totalWeight += items.weight;
}
var randomNumber = Math.random() * totalWeight;
var currentWeight = 0;
for (var i = 0; i < items.length; i++) {
currentWeight += items.weight;
if (randomNumber < currentWeight) {
return items;
}
}
}
function api_CUser_Add_Item_list(user, item_list) {
for (var i = 0; i < item_list.length; i++) {
api_CUser_AddItem(user, item_list[0], item_list[1]);
}
SendItemWindowNotification(user, item_list);
}
回复

使用道具 举报

1484

主题

1万

回帖

3万

积分

登峰造极

积分
39617
发表于 2025-1-14 20:49:32 | 显示全部楼层
多谢分享,以后开局就送十连抽

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
回复

使用道具 举报

1309

主题

9862

回帖

3万

积分

管理员

积分
34974
发表于 2025-1-14 20:50:19 | 显示全部楼层
感谢分享

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
回复

使用道具 举报

1474

主题

1万

回帖

3万

积分

登峰造极

积分
39067
发表于 2025-1-14 20:50:47 | 显示全部楼层
大佬这个怎么添加呀
回复

使用道具 举报

1474

主题

1万

回帖

4万

积分

登峰造极

积分
40084
发表于 2025-1-14 20:51:43 | 显示全部楼层
前排收藏
回复

使用道具 举报

发表于 2025-1-14 20:52:26 | 显示全部楼层
高端贴

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
回复

使用道具 举报

1453

主题

1万

回帖

3万

积分

登峰造极

积分
39286
发表于 2025-1-14 20:52:33 | 显示全部楼层

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
回复

使用道具 举报

869

主题

7803

回帖

2万

积分

登峰造极

积分
26843
发表于 2025-1-14 20:52:55 | 显示全部楼层
牛逼大佬,但是看不懂,支持
回复

使用道具 举报

847

主题

7740

回帖

2万

积分

登峰造极

积分
26542
发表于 2025-1-14 20:53:06 | 显示全部楼层
魔盒里的代码不得一个一个加

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
回复

使用道具 举报

1309

主题

9862

回帖

3万

积分

管理员

积分
34974
发表于 2025-1-14 20:53:23 | 显示全部楼层
高端
回复

使用道具 举报

869

主题

7803

回帖

2万

积分

登峰造极

积分
26843
发表于 2025-1-14 20:53:50 | 显示全部楼层
资讯长度有误
回复

使用道具 举报

772

主题

7427

回帖

2万

积分

登峰造极

积分
25333
发表于 2025-1-14 20:54:29 | 显示全部楼层
if (hasEnoughInventorySpace(user, 10)) {
大佬 这个判断背包格子的,我背包满了还能开,是不是我的js里缺少东西
回复

使用道具 举报

772

主题

7427

回帖

2万

积分

登峰造极

积分
25333
发表于 2025-1-14 20:55:09 | 显示全部楼层
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表