local is_skill_t = { [1010] = 1, [1011] = 1, [1012] = 1, [1013] = 1, [1020] = 1, [1021] = 1, [1022] = 1, [1023] = 1, [1030] = 1, [1031] = 1, [1032] = 1, [1033] = 1, [1040] = 1, [1041] = 1, [1042] = 1, [1043] = 1, [1050] = 1, [1051] = 1, [1052] = 1, [1053] = 1, [1060] = 1, [1061] = 1, [1062] = 1, [1063] = 1, [25] = 1, } --这个table中的技能释放时可触发麻痹效果 lualib:AddTrigger("0", 302, "on_post_equip") --加在system.lua on_system_start函数中 function on_login(player) --上线触发回调函数 for i = 10, 11 do local item = lualib:Player_GetItemGuid(player, i) if item ~= "" then on_post_equip(player, item) end end end function on_post_equip(player, item) local itemName = lualib:KeyName(item) if itemName == "麻痹戒指" then lualib:AddTrigger(player, lua_trigger_damage_process, "damage_process") elseif itemName == "隐身戒指" then lualib:AddBuff(player, "隐身戒指", 20000000) end return true end function damage_process(self, target, skill_id) local ringGuid1, ringGuid2 = lualib:Player_GetItemGuid(self, 10), lualib:Player_GetItemGuid(self, 11) local ringName1, ringName2 = "", "" if ringGuid1 ~= "" then ringName1 = lualib:KeyName(ringGuid1) end if ringGuid2 ~= "" then ringName2 = lualib:KeyName(ringGuid2) end --判断戒指位置是否有麻痹,有走麻痹流程,没有则删除触发器 if ringName1 == "麻痹戒指" or ringName2 == "麻痹戒指" then --增加麻痹buff几率计算 if is_skill_t[skill_id] == 1 then if math.random(1, 100) > 70 then lualib:AddBuff(target, "怪物麻痹3秒", 0) end end else lualib:RemoveTrigger(self, lua_trigger_damage_process, "") end return true end