台服dnf吧 关注:116,797贴子:1,839,325

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

只看楼主收藏回复

有开盒ui弹窗,可公告,开启道具记录,保底道具,



IP属地:河北1楼2024-09-18 10:54回复
    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;


    IP属地:河北2楼2024-09-18 10:56
    回复
      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[i].weight;
      }
      var randomNumber = Math.random() * totalWeight;
      var currentWeight = 0;
      for (var i = 0; i < items.length; i++) {
      currentWeight += items[i].weight;
      if (randomNumber < currentWeight) {
      return items[i];
      }
      }
      }
      function api_CUser_Add_Item_list(user, item_list) {
      for (var i = 0; i < item_list.length; i++) {
      api_CUser_AddItem(user, item_list[i][0], item_list[i][1]);
      }
      SendItemWindowNotification(user, item_list);
      }


      IP属地:河北3楼2024-09-18 10:56
      回复
        多谢分享,以后开局就送十连抽


        IP属地:广东来自Android客户端4楼2024-09-18 11:07
        回复
          感谢分享


          IP属地:山东来自Android客户端5楼2024-09-18 11:17
          回复
            大佬这个怎么添加呀


            IP属地:广东来自iPhone客户端6楼2024-09-18 11:45
            回复
              前排收藏


              IP属地:山东来自Android客户端7楼2024-09-18 11:57
              回复
                高端贴


                IP属地:广东来自Android客户端8楼2024-09-18 12:46
                回复


                  IP属地:湖南来自Android客户端9楼2024-09-18 12:49
                  回复
                    牛逼大佬,但是看不懂,支持


                    IP属地:黑龙江来自Android客户端10楼2024-09-18 14:05
                    回复
                      魔盒里的代码不得一个一个加


                      IP属地:湖南来自Android客户端11楼2024-09-18 14:32
                      收起回复
                        高端


                        IP属地:辽宁来自Android客户端12楼2024-09-18 16:17
                        回复
                          资讯长度有误


                          IP属地:湖南来自Android客户端13楼2024-09-19 11:17
                          回复
                            if (hasEnoughInventorySpace(user, 10)) {
                            大佬 这个判断背包格子的,我背包满了还能开,是不是我的js里缺少东西


                            IP属地:山东14楼2024-09-19 12:11
                            回复


                              IP属地:湖北15楼2024-09-19 15:04
                              回复