本帖最后由 诗水蛇山神庙 于 2011-9-21 10:09 编辑
高手帮忙做的:
function CanUseThing(id,personid)
local str="";
if JY.Thing[id]["仅修炼人物"] >= 0 and JY.Thing[id]["仅修炼人物"] ~= personid then
return false;
end
if JY.Thing[id]["需内力性质"] ~=2 and JY.Person[personid]["内力性质"] ~=2 then
if JY.Thing[id]["需内力性质"] ~= JY.Person[personid]["内力性质"] then
return false
elseif JY.Thing[id]["需内力"] > JY.Person[personid]["内力最大值"] then
return false;
elseif JY.Thing[id]["需攻击力"] > JY.Person[personid]["攻击力"] then
return false;
elseif JY.Thing[id]["需轻功"] > JY.Person[personid]["轻功"] then
return false;
elseif JY.Thing[id]["需拳掌功夫"] > JY.Person[personid]["拳掌功夫"] then
return false;
elseif JY.Thing[id]["需御剑能力"] > JY.Person[personid]["御剑能力"] then
return false;
elseif JY.Thing[id]["需耍刀技巧"] > JY.Person[personid]["耍刀技巧"] then
return false;
elseif JY.Thing[id]["需特殊兵器"] > JY.Person[personid]["特殊兵器"] then
return false;
elseif JY.Thing[id]["需暗器技巧"] > JY.Person[personid]["暗器技巧"] then
return false;
end
end
if JY.Thing[id]["需内力"] > JY.Person[personid]["内力最大值"] then
return false;
end
if JY.Thing[id]["需攻击力"] > JY.Person[personid]["攻击力"] then
return false;
end
if JY.Thing[id]["需轻功"] > JY.Person[personid]["轻功"] then
return false;
end
if JY.Thing[id]["需用毒能力"] > JY.Person[personid]["用毒能力"] then
return false;
end
if JY.Thing[id]["需医疗能力"] > JY.Person[personid]["医疗能力"] then
return false;
end
if JY.Thing[id]["需解毒能力"] > JY.Person[personid]["解毒能力"] then
return false;
end
if JY.Thing[id]["需拳掌功夫"] > JY.Person[personid]["拳掌功夫"] then
return false;
end
if JY.Thing[id]["需御剑能力"] > JY.Person[personid]["御剑能力"] then
return false;
end
if JY.Thing[id]["需耍刀技巧"] > JY.Person[personid]["耍刀技巧"] then
return false;
end
if JY.Thing[id]["需特殊兵器"] > JY.Person[personid]["特殊兵器"] then
return false;
end
if JY.Thing[id]["需暗器技巧"] > JY.Person[personid]["暗器技巧"] then
return false;
end
if JY.Thing[id]["需资质"] >= 0 then
if JY.Thing[id]["需资质"] > JY.Person[personid]["资质"] then
return false;
end
else
if -JY.Thing[id]["需资质"] < JY.Person[personid]["资质"] then
return false;
end
end
if personid == 76 and id > 63 then
return true
elseif (id == 220 or id == 221) and personid == 0 then
return true
elseif id > 186 and id < 194 and personid == 44 then
return true
elseif id == 114 and personid == 0 and GetS(4, 5, 5, 5) == 2 and JY.Person[0]["御剑能力"] > 99 then
return true
elseif id == 86 and personid == 0 and GetS(4, 5, 5, 5) == 1 and JY.Person[0]["拳掌功夫"] > 119 then
return true
end
return true
end
AddPersonAttrib = function(id, str, value)
local oldvalue = JY.Person[id][str]
local attribmax = math.huge
if str == "生命" then
attribmax = JY.Person[id]["生命最大值"]
elseif str == "内力" then
attribmax = JY.Person[id]["内力最大值"]
else
if CC.PersonAttribMax[str] ~= nil then
attribmax = CC.PersonAttribMax[str]
end
if str == "内力最大值" then
local nlmax = math.modf((JY.Person[id]["资质"] - 1) / 15)
attribmax = 9500 - nlmax * 750
if T1LEQ(id) or id == 53 then
attribmax = 10000
end
for i = 1, 10 do
if JY.Person[id]["武功" .. i] == 85 or JY.Person[id]["武功" .. i] == 88 then
attribmax = attribmax + 750
end
end
if id == 58 then
attribmax = attribmax - JY.Person[300]["声望"] * 100
end
local nanshan = 0
local duaoyi = 0
for i = 1, 10 do
if JY.Person[id]["武功" .. i] == 53
or JY.Person[id]["武功" .. i] == 73 then
if JY.Person[id]["武功等级" .. i] == 999 then
nanshan = nanshan + 1
end
end
if nanshan == 2
attribmax = attribmax + 1000
RWWH[id] = "南山雅士"
JY.Person[id]["外号"] = "南山雅士"
end
if JY.Person[id]["武功" .. i] == 5
or JY.Person[id]["武功" .. i] == 19
or JY.Person[id]["武功" .. i] == 21
or JY.Person[id]["武功" .. i] == 69 then
if JY.Person[id]["武功等级" .. i] == 999 then
duaoyi = duaoyi + 1
end
end
if duaoyi == 4 and JY.Person[id]["外号"] ~= "毒之奥义" then
JY.Person[id]["攻击带毒"] = JY.Person[id]["攻击带毒"] + 200
RWWH[id] = "毒之奥义"
JY.Person[id]["外号"] = "毒之奥义"
end
end
if id == 0 then
if GetD(70, 3, 5) == 2612 and JY.Person[0]["武功1"] < 109 and JY.Person[0]["武功1"] ~= 88 and JY.Person[0]["姓名"] ~= "零二七" then
attribmax = attribmax + 1000
end
end
if attribmax < 500 then
attribmax = 500
end
if attribmax > 10000 then
attribmax = 10000
end
end
if str == "用毒能力" and id == 2 then
attribmax = 500
end
if str == "用毒能力" and (id == 25 or id == 83 or id == 17) then
attribmax = 400
end
if str == "医疗能力" and (id == 16 or id == 28 or id == 45) then
attribmax = 500
end
if str == "医疗能力" and id == 85 then
attribmax = 400
end
if str ~= "医疗能力" and str ~= "用毒能力" then
end
if str ~= "医疗能力" then
end
end
if id == 0 and GetS(4, 5, 5, 5) == 7 then
attribmax = 400
end
local newvalue = limitX(oldvalue + value, 0, attribmax)
JY.Person[id][str] = newvalue
local add = newvalue - oldvalue
local showstr = ""
if add > 0 then
showstr = string.format("%s 增加 %d", str, add)
elseif add < 0 then
showstr = string.format("%s 减少 %d", str, -add)
end
return add, showstr
end
以上,实现了你要求的10.11组合技
未经测试,实用前你可以检查下语法
|