传奇挂机页游自定义怪物属性与掉落脚本分享 传奇
夜 2小时前

传奇挂机页游自定义怪物属性与掉落脚本

游戏为网页文字版的传奇挂机摸鱼类型。

游戏来源:坛子里 https://www.52pojie.cn/thread-2093484-1-1.html 发布的另外一个游戏挂机脚本中的游戏界面下面的链接进入,名字就叫“传奇挂机”。

游戏自带挂机功能,且无消耗,虽然没有自己写的效率高,但是用了该脚本后就无所谓了。

🔥 脚本功能

  1. 修改掉落物品及爆率(默认所有怪物都会掉落除装备外的所有物品,装备默认掉落最高级的,通过修改掉落装备类型为 equipment 的项目中 tier 的值来决定掉落哪个地图的装备)
  2. 修改怪物基本属性:生命值、攻击力、防御、魔防
  3. 修改杀死怪物所得经验
  4. 修改金币掉落数值
💡 脚本中有明确的注释,需要的自己看着改吧。

脚本如下:

// ==UserScript==
// @name         CQ176自定义生成怪物
// @namespace    http://tampermonkey.net/
// @version      2026-03-03
// @description  HOOK怪物生成函数重置怪物属性、掉落、爆率
// @author       leeairw
// @match        http://119.91.123.78/cq/*
// @require      https://code.jquery.com/jquery-3.6.0.min.js
// @grant        GM_setValue
// @grant        GM_getValue
// ==/UserScript==

(function() {
    'use strict';

    // 使用 unsafeWindow 访问页面上的全局变量和函数
    const win = unsafeWindow;

    // 怪物掉落物品,type:special 特殊(经验卷、祝福油);skillBook 技能书;equipment 装备{category:部位};potion 药水
    // chance 爆率 count 掉落数量 tier 装备等级(和地图对应)
    const dropRatesNew = [
        {
            "type": "special",
            "name": "special101",
            "chance": 25,
            "count": 1
        },
        {
            "type": "special",
            "name": "special301",
            "chance": 1,
            "count": 1
        },
        {
            "type": "special",
            "name": "special302",
            "chance": 50,
            "count": 1
        },
        {
            "type": "skillBook",
            "skill": "bookhalfMoon",
            "chance": 0
        },
        {
            "type": "skillBook",
            "skill": "bookstab",
            "chance": 0
        },
        {
            "type": "skillBook",
            "skill": "bookfire",
            "chance": 0
        },
        {
            "type": "equipment",
            "category": "helmets",
            "tier": 8,
            "chance": 20
        },
        {
            "type": "equipment",
            "category": "armors",
            "tier": 8,
            "chance": 20
        },
        {
            "type": "equipment",
            "category": "handAccessories",
            "tier": 8,
            "chance": 20
        },
        {
            "type": "equipment",
            "category": "necklaces",
            "tier": 8,
            "chance": 20
        },
        {
            "type": "equipment",
            "category": "rings",
            "tier": 8,
            "chance": 20
        },
        {
            "type": "equipment",
            "category": "weapons",
            "tier": 8,
            "chance": 30
        },
        {
            "type": "potion",
            "itemId": "shop101",
            "chance": 60,
            "count": 1
        },
        {
            "type": "potion",
            "itemId": "shop201",
            "chance": 60,
            "count": 1
        },
        {
            "type": "potion",
            "itemId": "shop102",
            "chance": 60,
            "count": 1
        },
        {
            "type": "potion",
            "itemId": "shop202",
            "chance": 60,
            "count": 1
        },
        {
            "type": "potion",
            "itemId": "shop103",
            "chance": 60,
            "count": 1
        },
        {
            "type": "potion",
            "itemId": "shop203",
            "chance": 60,
            "count": 1
        }
    ];

    function initialize() {
        console.log('怪物修改器: 游戏核心功能已加载,开始Hook...');

        // 物品掉落率
        gameData.dropRate = 10;
        // 极品装备属性倍率
        gameData.supremeRate = 100;
        // 普通属性倍数
        gameData.dropRate = 10;
        // 暴击率(因为怪物血量降低了.所以改成0了,因为有的怪一下秒不给结算)
        gameData.critRate = 0;

        // 1. 保存原始的 spawnMonster 函数
        const originalSpawnMonster = win.spawnMonster;

        //const currentMap = maps.find(map => map.id === gameData.player.currentMap);

        // 2. 创建我们自己的“增强版”函数
        const customSpawnMonster = function(...args) {
            // 首先,必须调用原始函数,让游戏正常生成一个怪物并设置好所有数据
            originalSpawnMonster.apply(this, args);

            // 然后,在怪物生成后(即 gameData.currentMonster 被赋值后),我们再来修改它的属性
            if (gameData.currentMonster && gameData.currentMonster.hp > 0) {
                const monster = gameData.currentMonster;

                console.log('name:' + monster.name);
                // 将核心战斗属性设置为 1
                monster.hp = 250;
                monster.maxHp = 250;
                monster.attack = 1;
                monster.defense = 1;
                monster.magicDefense = 1;

                // (可选) 如果您也想修改经验和金币,可以取消下面两行的注释
                monster.exp = 500000;
                monster.gold = 500000;
                // 替换为修改后的掉落物
                monster.dropRates = dropRatesNew;

                // 在游戏日志中添加一条消息,增加趣味性
                if (typeof win.addLog === 'function') {
                    // 使用一个微小的延迟,确保我们的日志出现在游戏默认日志之后
                    setTimeout(() => {
                        win.addLog(`【${monster.id}:${monster.name}】被神秘力量削弱了!`, 'system');
                    }, 50);
                }
            }
        };

        // 3. 用我们的版本替换游戏中的原始函数
        win.spawnMonster = customSpawnMonster;

        console.log('怪物修改器: Hook成功!所有新生成的怪物都将被削弱。');
    }

    function loopWithDelay() {
        if (gameData.player.name != '')
        {
            console.log('name:' + gameData.player.name);
            initialize();
            return;
        }

        setTimeout(loopWithDelay, 100); // 递归调用
    }

    loopWithDelay();
})();

⚠️ 提示:脚本中的怪物血量、攻击、经验、金币等数值均可按需自行调整,修改前建议先备份原脚本。

[[HTML]]

最新回复 (0)
返回