你在加载萧中慧补丁后在加载一次
function War_AddPersonLVUP(pid)
local tmplevel = JY.Person[pid]["等级"]
if CC.Level <= tmplevel then
return false
end
if JY.Person[pid]["经验"] < CC.Exp[tmplevel] then
return false
end
while CC.Exp[tmplevel] <= JY.Person[pid]["经验"] do
tmplevel = tmplevel + 1
if CC.Level <= tmplevel then
break;
end
end
DrawStrBoxWaitKey(string.format(CC.WARS125, JY.Person[pid]["姓名"]), C_WHITE, CC.DefaultFont)
--计算提升的等级
local leveladd = tmplevel - JY.Person[pid]["等级"]
JY.Person[pid]["等级"] = JY.Person[pid]["等级"] + leveladd
--提高生命增长
AddPersonAttrib(pid, "生命最大值", (JY.Person[pid]["生命增长"] + Rnd(2) + 2) * leveladd * 4)
JY.Person[pid]["生命"] = JY.Person[pid]["生命最大值"]
JY.Person[pid]["体力"] = CC.PersonAttribMax["体力"]
JY.Person[pid]["受伤程度"] = 0
JY.Person[pid]["中毒程度"] = 0
--属性点资质加成
local function cleveradd()
local ca, rndnum = nil, nil
if CC.Debug then
rndnum = math.random(1)
else
rndnum = math.random(1)
end
ca = JY.Person[pid]["资质"] / (rndnum + 4)
return ca
end
local theadd = cleveradd()
--聪明人内力加少。。。
--增加内力的成长
AddPersonAttrib(pid, "内力最大值", math.modf(leveladd * ((16 - JY.Person[pid]["生命增长"]) * 7 + 210 / (theadd + 1))))
--天罡内力每级额外加50
if pid == 0 and GetS(4, 5, 5, 5) == 5 then
AddPersonAttrib(pid, "内力最大值", 50 * leveladd)
end
JY.Person[pid]["内力"] = JY.Person[pid]["内力最大值"]
--循环提升等级,累加属性
for i = 1, leveladd do
local ups = math.modf((JY.Person[pid]["资质"] - 1) / 15) + 1
--令狐冲 内伤回复前,每级3点
if pid == 35 and GetD(82, 1, 0) == 1 then
ups = 3
end
--郭靖 20级之后,每级6点
if pid == 55 and JY.Person[pid]["等级"] > 20 then
ups = 6
end
--零二七,每级8点
if T1LEQ(pid) then
ups = 8
end
--难度额外加成
if JY.Thing[202][WZ7] == 2 then
ups = ups + 1
end
if JY.Thing[202][WZ7] == 3 then
ups = ups + 2
end
AddPersonAttrib(pid, "攻击力", ups)
AddPersonAttrib(pid, "防御力", ups)
AddPersonAttrib(pid, "轻功", ups)
--修复医疗、用毒、解毒能力不与等级挂钩的问题
if JY.Person[pid]["医疗能力"] >= 20 then
AddPersonAttrib(pid, "医疗能力", math.random(2))
end
if JY.Person[pid]["用毒能力"] >= 20 then
AddPersonAttrib(pid, "用毒能力", math.random(2))
end
if JY.Person[pid]["解毒能力"] >= 20 then
AddPersonAttrib(pid, "解毒能力", math.random(2))
end
--陈家洛 升级加四围
if pid == 75 then
if JY.Person[pid]["拳掌功夫"] >= 0 then
AddPersonAttrib(pid, "拳掌功夫", math.random(3))
end
if JY.Person[pid]["御剑能力"] >= 0 then
AddPersonAttrib(pid, "御剑能力", (7 + math.random(0,1)))
end
if JY.Person[pid]["耍刀技巧"] >= 0 then
AddPersonAttrib(pid, "耍刀技巧", (7 + math.random(0,1)))
end
if JY.Person[pid]["特殊兵器"] >= 0 then
AddPersonAttrib(pid, "特殊兵器", (7 + math.random(0,1)))
end
end
--暗器每级提高
if JY.Person[pid]["暗器技巧"] >= 20 then
AddPersonAttrib(pid, "暗器技巧", math.random(2))
end
end
local ey = 1; --每级的随机点数
--难度额外加成
if JY.Thing[202][WZ7] > 1 then
ey = ey + 1;
end
if JY.Thing[202][WZ7] > 2 then
ey = ey + 1;
end
local n = ey*leveladd; --计算随机额外点数
local gj = JY.Person[pid]["攻击力"];
local fy = JY.Person[pid]["防御力"];
local qg = JY.Person[pid]["轻功"];
local tmpN = n;
repeat
Cls();
local title = JY.Person[pid]["姓名"].." 升级随机点分配";
local str = string.format("剩余的额外随机升级点数:%d 点*攻击:%d*防御:%d*轻功:%d",tmpN, gj, fy, qg);
local btn = {"加攻","加防","加轻","重置","确定"};
local num = #btn;
local r = JYMsgBox(title,str,btn,num);
local T = {}
for a = 0, 1000 do
local b = "" .. a
T[b] = a
end
if r == 1 then --输入攻击力
local r = GetPinyin1(32, CC.ScreenH - CC.Fontbig * 6)
if T[r] == 0 or r == "" then
elseif T[r] ~= nil and T[r] > -1 and T[r] <= tmpN then
gj = gj + T[r]
tmpN = tmpN-T[r];
else
DrawStrBoxWaitKey("对不起,你输入的攻击力数据不正确!", C_WHITE, 30)
end
elseif r == 2 then --输入防御力
local r = GetPinyin1(32, CC.ScreenH - CC.Fontbig * 6)
if T[r] == 0 or r == "" then
elseif T[r] ~= nil and T[r] > -1 and T[r] <= tmpN then
fy = fy + T[r]
tmpN = tmpN-T[r];
else
DrawStrBoxWaitKey("对不起,你输入的防御力数据不正确!", C_WHITE, 30)
end
elseif r == 3 then --输入轻功
local r = GetPinyin1(32, CC.ScreenH - CC.Fontbig * 6)
if T[r] == 0 or r == "" then
elseif T[r] ~= nil and T[r] > -1 and T[r] <= tmpN then
qg = qg + T[r]
tmpN = tmpN-T[r];
else
DrawStrBoxWaitKey("对不起,你输入的轻功数据不正确!", C_WHITE, 30)
end
elseif r == 4 then
gj = JY.Person[pid]["攻击力"];
fy = JY.Person[pid]["防御力"];
qg = JY.Person[pid]["轻功"];
tmpN = n;
elseif r == 5 then
if tmpN > 0 then
DrawStrBoxWaitKey("对不起,"..JY.Person[pid]["姓名"].."还有剩余的点数没加!", C_WHITE, 30)
else
JY.Person[pid]["攻击力"] = gj;
JY.Person[pid]["防御力"] = fy;
JY.Person[pid]["轻功"] = qg;
n = 0;
end
end
until n == 0
return true
end
或者吧这个函数保存成,XX.LUA。
再加载萧中慧补丁下面再加一行
dofile ".\\script\\xx.lua";
|