diff --git a/Mirserver/Mir200/Envir/QuestDiary/游戏功能/A2_二大陆/九秘珠合成.lua b/Mirserver/Mir200/Envir/QuestDiary/游戏功能/A2_二大陆/九秘珠合成.lua index 6c3b7d56..b8a04b7b 100644 --- a/Mirserver/Mir200/Envir/QuestDiary/游戏功能/A2_二大陆/九秘珠合成.lua +++ b/Mirserver/Mir200/Envir/QuestDiary/游戏功能/A2_二大陆/九秘珠合成.lua @@ -28,6 +28,15 @@ JiuMiZhuOBJ.cfg = { gem = 5000, }, attributeSet = { + { name = "", Attribute = "3#13#5" }, + { name = "", Attribute = "3#82#300" }, + { name = "", Attribute = "3#83#500" }, + { name = "", Attribute = "3#36#500" }, + { name = "", Attribute = "3#73#300" }, + { name = "", Attribute = "3#75#500" }, + { name = "", Attribute = "3#214#3" }, + { name = "ǰ", Attribute = "3#60#500" }, + { name = "", Attribute = "3#219#5" }, }, reset = { { "ǧʯ", 2000, 0 }, @@ -44,7 +53,7 @@ Player.sycCfg[JiuMiZhuOBJ._name] = JiuMiZhuOBJ.cfg JiuMiZhuOBJ.CaChe = {} ---* ǰ˵õĺ -JiuMiZhuOBJ.allowFunc = { "main","hecheng", "reset" } +JiuMiZhuOBJ.allowFunc = { "main", "hecheng", "reset" } function JiuMiZhuOBJ:hecheng(actor, p1, p2, p3, data) @@ -68,36 +77,52 @@ function JiuMiZhuOBJ:hecheng(actor, p1, p2, p3, data) end function JiuMiZhuOBJ:settingAttr(actor, itemobj) - if not itemobj then return end - - delitemattr(actor, itemobj, 6, 0) + local attr = self.cfg.attributeSet or {} + if #attr <= 0 then + return + end - local attr = {} - for i, v in ipairs(JiuMiOBJ.cfg.up or {}) do - table.insert(attr, { v.attrId, v.addatt }) + local randomStr = {} + for i, v in ipairs(attr or {}) do + table.insert(randomStr, string.format("%d#1", i)) + end + + local function addAttribute(get_att, Attribute) + if type(Attribute) ~= "string" then + return + end + for attrGroup, attrId, value in string.gmatch(Attribute, "(%d+)#(%d+)#(%d+)") do + attrId = tonumber(attrId) + value = tonumber(value) + if attrId and value and value > 0 then + get_att[attrId] = (get_att[attrId] or 0) + value + end + end end local remaining = nil local get_att = {} - for i = 1, 5, 1 do - local result1, result2 = ransjstr(remaining and remaining or "1#1|2#1|3#1|4#1|5#1|6#1|7#1|8#1|9#1", 1, 3) + local count = math.min(5, #attr) + for i = 1, count, 1 do + local result1, result2 = ransjstr(remaining and remaining or table.concat(randomStr, "|"), 1, 3) remaining = result2 - get_att[attr[tonumber(result1)][1]] = self:getattValue(actor, attr[tonumber(result1)][1], - attr[tonumber(result1)][2]) + local cfg = attr[tonumber(result1)] + if cfg then + LOGDump(cfg.Attribute) + addAttribute(get_att, cfg.Attribute) + end end additemattrEX(actor, itemobj, 6, 3, get_att) end - function JiuMiZhuOBJ:reset(actor) - if not Npc.CheckNPCRange(actor, 190) then return end @@ -123,6 +148,4 @@ function JiuMiZhuOBJ:reset(actor) -- body end - - return JiuMiZhuOBJ diff --git a/client/env.json b/client/env.json index e457df0a..fed46f6b 100644 --- a/client/env.json +++ b/client/env.json @@ -1 +1 @@ -{"gm":0,"signkey":"634eff98723b31da43ed35f0dd4edf36","oper_mode":1,"modlist":"http://list.dhsf.xqhuyu.com/testmodlist/modlist_tool_16934.txt","resolution":"1024x768","channel":1} +{"gm":0,"signkey":"634eff98723b31da43ed35f0dd4edf36","oper_mode":1,"modlist":"http://list.dhsf.xqhuyu.com/testmodlist/modlist_tool_11557.txt","resolution":"1024x768","channel":1}