修改九秘珠合成/重置获得的属性
This commit is contained in:
parent
1f5a72b0a5
commit
ae9b77e69e
2 changed files with 39 additions and 16 deletions
|
|
@ -28,6 +28,15 @@ JiuMiZhuOBJ.cfg = {
|
||||||
gem = 5000,
|
gem = 5000,
|
||||||
},
|
},
|
||||||
attributeSet = {
|
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 = {
|
reset = {
|
||||||
{ "千年玄石", 2000, 0 },
|
{ "千年玄石", 2000, 0 },
|
||||||
|
|
@ -44,7 +53,7 @@ Player.sycCfg[JiuMiZhuOBJ._name] = JiuMiZhuOBJ.cfg
|
||||||
JiuMiZhuOBJ.CaChe = {}
|
JiuMiZhuOBJ.CaChe = {}
|
||||||
|
|
||||||
---* 允许前端调用的函数
|
---* 允许前端调用的函数
|
||||||
JiuMiZhuOBJ.allowFunc = { "main","hecheng", "reset" }
|
JiuMiZhuOBJ.allowFunc = { "main", "hecheng", "reset" }
|
||||||
|
|
||||||
|
|
||||||
function JiuMiZhuOBJ:hecheng(actor, p1, p2, p3, data)
|
function JiuMiZhuOBJ:hecheng(actor, p1, p2, p3, data)
|
||||||
|
|
@ -68,36 +77,52 @@ function JiuMiZhuOBJ:hecheng(actor, p1, p2, p3, data)
|
||||||
end
|
end
|
||||||
|
|
||||||
function JiuMiZhuOBJ:settingAttr(actor, itemobj)
|
function JiuMiZhuOBJ:settingAttr(actor, itemobj)
|
||||||
|
|
||||||
if not itemobj then
|
if not itemobj then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
delitemattr(actor, itemobj, 6, 0)
|
delitemattr(actor, itemobj, 6, 0)
|
||||||
|
|
||||||
|
local attr = self.cfg.attributeSet or {}
|
||||||
|
if #attr <= 0 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local attr = {}
|
local randomStr = {}
|
||||||
for i, v in ipairs(JiuMiOBJ.cfg.up or {}) do
|
for i, v in ipairs(attr or {}) do
|
||||||
table.insert(attr, { v.attrId, v.addatt })
|
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
|
end
|
||||||
|
|
||||||
local remaining = nil
|
local remaining = nil
|
||||||
local get_att = {}
|
local get_att = {}
|
||||||
for i = 1, 5, 1 do
|
local count = math.min(5, #attr)
|
||||||
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)
|
for i = 1, count, 1 do
|
||||||
|
local result1, result2 = ransjstr(remaining and remaining or table.concat(randomStr, "|"), 1, 3)
|
||||||
remaining = result2
|
remaining = result2
|
||||||
get_att[attr[tonumber(result1)][1]] = self:getattValue(actor, attr[tonumber(result1)][1],
|
local cfg = attr[tonumber(result1)]
|
||||||
attr[tonumber(result1)][2])
|
if cfg then
|
||||||
|
LOGDump(cfg.Attribute)
|
||||||
|
addAttribute(get_att, cfg.Attribute)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
additemattrEX(actor, itemobj, 6, 3, get_att)
|
additemattrEX(actor, itemobj, 6, 3, get_att)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function JiuMiZhuOBJ:reset(actor)
|
function JiuMiZhuOBJ:reset(actor)
|
||||||
|
|
||||||
if not Npc.CheckNPCRange(actor, 190) then
|
if not Npc.CheckNPCRange(actor, 190) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -123,6 +148,4 @@ function JiuMiZhuOBJ:reset(actor)
|
||||||
-- body
|
-- body
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return JiuMiZhuOBJ
|
return JiuMiZhuOBJ
|
||||||
|
|
|
||||||
|
|
@ -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}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue