找回密码
 register

QQ登录

只需一步,快速开始

查看: 23|回复: 1

[修改笔记] 源端复古64位: 一键三孔Lua脚本 一键打孔

[复制链接]

[修改笔记] 源端复古64位: 一键三孔Lua脚本 一键打孔

[复制链接]
  • 打卡等级:热心大叔
  • 打卡总天数:229
  • 打卡月天数:6
  • 打卡总奖励:227
  • 最近打卡:2025-07-07 00:45:13
Waylee

主题

0

回帖

2万

积分

仙帝

积分
23725
Waylee 2025-7-7 11:00 | 显示全部楼层 |阅读模式 | Google Chrome | Windows 10

马上注册,查看网站隐藏内容!!

您需要 登录 才可以下载或查看,没有账号?register

×
--**********************************
-- 一键打孔
--**********************************
function x000110_OneKey3Slot( sceneId, selfId,isTips )
    local tEquipGemTable = {0,1,2,3,4,5,6,7,11,12,13,14,15,17,18}
    local bagbegin = GetBasicBagStartPos(sceneId, selfId)
    local bagend = GetBasicBagEndPos(sceneId, selfId)
    for i= bagbegin, bagend do
        local itemIndex = LuaFnGetItemTableIndexByIndex( sceneId, selfId, i )   
        if itemIndex > 0 then
            local ret = LuaFnIsItemLocked( sceneId, selfId, i )
            if ret ~= 0 then
                return
            end 
            local EquipType = LuaFnGetBagEquipType( sceneId, selfId, i )    
            local Find = 0
            for j, gem in tEquipGemTable do
                if gem == EquipType then
                    Find = 1
                end
            end
            if Find == 1 then
                LuaFnSetEquipSlot(sceneId, selfId, i,3)
            end
        end
    end

    if isTips == 1 then
        BeginEvent(sceneId)                     
            AddText(sceneId,"恭喜您,您包裹所有装备已经成功三孔打孔")
        EndEvent(sceneId)
        DispatchEventList(sceneId,selfId,targetId)
        --特效
        LuaFnSendSpecificImpactToUnit(sceneId, selfId, selfId, selfId, 18, 0)
    end
end
  • 打卡等级:热心大叔
  • 打卡总天数:229
  • 打卡月天数:6
  • 打卡总奖励:227
  • 最近打卡:2025-07-07 00:45:13
楼主
Waylee 楼主

主题

0

回帖

2万

积分

仙帝

积分
23725
Waylee 2025-7-7 11:15 | 显示全部楼层 | Google Chrome | Windows 10

优化版:

--允许打孔位置
x000110_g_EquipGemSet = { 
    [0] = 1, [1] = 1, [2] = 1, [3] = 1, [4] = 1, 
    [5] = 1, [6] = 1, [7] = 1, [11] = 1, [12] = 1, 
    [13] = 1, [14] = 1, [15] = 1, [17] = 1, [18] = 1 
}

--**********************************
-- 一键打孔
--**********************************
function x000110_OneKey3Slot( sceneId, selfId,isTips )
    local tEquipGemTable = {0,1,2,3,4,5,6,7,11,12,13,14,15,17,18}
    local bagbegin = GetBasicBagStartPos(sceneId, selfId)
    local bagend = GetBasicBagEndPos(sceneId, selfId)
    -- 遍历背包中的物品
    for i= bagbegin, bagend do
        local itemIndex = LuaFnGetItemTableIndexByIndex( sceneId, selfId, i )   
        -- 检查物品是否存在且未锁定
        if itemIndex > 0 then
            local ret = LuaFnIsItemLocked( sceneId, selfId, i )
            if ret ~= 0 then
                return
            end 
            -- 获取装备类型并检查
            local EquipType = LuaFnGetBagEquipType( sceneId, selfId, i )    
            if x000110_g_EquipGemSet[EquipType] then
                LuaFnSetEquipSlot(sceneId, selfId, i,3)
            end
        end
    end

    if isTips == 1 then
        BeginEvent(sceneId)                     
            AddText(sceneId,"恭喜您,您包裹所有装备已经成功三孔打孔")
        EndEvent(sceneId)
        DispatchEventList(sceneId,selfId,targetId)
        --特效
        LuaFnSendSpecificImpactToUnit(sceneId, selfId, selfId, selfId, 18, 0)
    end
end
您需要登录后才可以回帖 登录 | register

本版积分规则

雪舞知识库 | 浙ICP备15015590号-1 | 萌ICP备20232229号|浙公网安备33048102000118号 |网站地图|天天打卡

GMT+8, 2025-7-8 04:00 , Processed in 0.099478 second(s), 6 queries , Redis On.

Powered by XueWu Licensed

Copyright © Tencent Cloud.

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