搜索
查看: 243|回复: 3

穿戴重复装备禁止移动

[复制链接]
发表于 2024-7-2 19:55:41 | 显示全部楼层 |阅读模式
1.限制一些特殊首饰穿戴多件造成属性太高。大概理解就是你想某些特殊物品只能穿戴其中1个,穿戴2个将禁止移动。
取下来后恢复正常!
2.主号和英雄有效
3.我自己试了下,时装手镯戒指,主装备手镯戒指都可以测试。

本帖子中包含更多资源

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

x
发表于 2024-7-8 16:45:00 | 显示全部楼层
不是有穿戴前触发段吗,检测重复的,直接不给穿戴,就好了,返回return false
 楼主| 发表于 2024-7-8 21:41:56 | 显示全部楼层
参谋长 发表于 2024-7-8 16:45
不是有穿戴前触发段吗,检测重复的,直接不给穿戴,就好了,返回return false ...

你已经写出来了么,我是写完了才想到,算了,防止卡背包卡上去,暂时就这样了
发表于 2024-7-11 20:02:25 | 显示全部楼层

local bwxz_ATT = {
                "邪眼指环","邪眼戒指[天]","邪眼戒指[地]","邪眼戒指[玄]","邪眼戒指[黄]","邪眼戒指[神]","嗜血之戒LV1","嗜血之戒LV2","嗜血之戒LV3","复活戒指",
                "复活护腕","复活护腕[天]","复活护腕[地]","复活护腕[玄]","复活护腕[黄]","复活护腕[神]","暴力手镯LV1","暴力手镯LV2","暴力手镯LV3"
                }

local bw_ATT = {
                [5] = {bw=6,s={"复活护腕","复活护腕[天]","复活护腕[地]","复活护腕[玄]","复活护腕[黄]","复活护腕[神]"}},
                [6] = {bw=5,s={"复活护腕","复活护腕[天]","复活护腕[地]","复活护腕[玄]","复活护腕[黄]","复活护腕[神]"}},
                [7] = {bw=8,s={"复活戒指","邪眼指环","邪眼戒指[天]","邪眼戒指[地]","邪眼戒指[玄]","邪眼戒指[黄]","邪眼戒指[神]"}},
                [8] = {bw=7,s={"复活戒指","邪眼指环","邪眼戒指[天]","邪眼戒指[地]","邪眼戒指[玄]","邪眼戒指[黄]","邪眼戒指[神]"}},
                [56] = {bw=57,s={"暴力手镯LV1","暴力手镯LV2","暴力手镯LV3"}},
                [57] = {bw=56,s={"暴力手镯LV1","暴力手镯LV2","暴力手镯LV3"}},
                [58] = {bw=59,s={"嗜血之戒LV1","嗜血之戒LV2","嗜血之戒LV3"}},
                [59] = {bw=58,s={"嗜血之戒LV1","嗜血之戒LV2","嗜血之戒LV3"}},
                [99] = {bw=99,s=""},
                }


--穿装备之前回调(item:将穿上的物品)
function on_TakeOnItemsBegin(Actor, item, where)
        if Actor:getAIType() == 0 and (Actor:getRace() == 0 or Actor:getRace() == 66) then

                if in_array(where, {5,6,7,8,56,57,58,59}) and in_array(item:getName(), bwxz_ATT) then
                        local itemx = Actor:getUseItem(bw_ATT[where].bw)
                        if itemx then
                                if in_array(itemx:getName(), bw_ATT[where].s) then
                                        return false
                                else
                                        return true
                                end
                        end
                end
        end
end
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|HGEM2论坛

GMT+8, 2024-11-22 00:22 , Processed in 0.542004 second(s), 15 queries .

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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