苍炎高手发的修改代码希望哪位有爱心的高手 在每段函数后面加上注解 这段函数是做什么用的
对那些入了门的人来说可能很容易看懂可是对我们这些还在门槛前面徘徊的人而言就是天书了
当然嫌麻烦的话能改我发一份入门的基础教程我也是非常感谢
function drawname(x,y,name,size)
x=x-math.modf(size/2)
local namelen=string.len(name)/2
local zi={}
for i=1,namelen do
zi[i]=string.sub(name,i*2-1,i*2)
DrawString(x,y,zi[i],C_WHITE,size)
y=y+size
end
if JY.Person[92]["武功1"] == 85 then
JY.Person[92]["中毒程度"] = 0
JY.Person[92]["受伤程度"] = 0
end
end
function War_PersonTrainBook(pid)
local p=JY.Person[pid];
local thingid=p["修炼物品"];
if thingid<0 then
return ;
end
local wugongid=JY.Thing[thingid]["练出武功"];
local yes1,yes2,kfnum=false,false
while true do
local needpoint=TrainNeedExp(pid);
if p["修炼点数"]>=needpoint then
yes1=true
AddPersonAttrib(pid,"生命最大值",JY.Thing[thingid]["加生命最大值"]);
if JY.Thing[thingid]["改变内力性质"]==2 then
p["内力性质"]=2;
end
AddPersonAttrib(pid,"内力最大值",JY.Thing[thingid]["加内力最大值"]);
if pid== 92 and JY.Person[pid]["武功1"] == 97 then
AddPersonAttrib(pid,"攻击力",JY.Thing[thingid]["加攻击力"]);
AddPersonAttrib(pid,"轻功",JY.Thing[thingid]["加轻功"]);
AddPersonAttrib(pid,"防御力",JY.Thing[thingid]["加防御力"]);
else
end
AddPersonAttrib(pid,"攻击力",JY.Thing[thingid]["加攻击力"]);
AddPersonAttrib(pid,"轻功",JY.Thing[thingid]["加轻功"]);
AddPersonAttrib(pid,"防御力",JY.Thing[thingid]["加防御力"]);
AddPersonAttrib(pid,"医疗能力",JY.Thing[thingid]["加医疗能力"]);
AddPersonAttrib(pid,"用毒能力",JY.Thing[thingid]["加用毒能力"]);
AddPersonAttrib(pid,"解毒能力",JY.Thing[thingid]["加解毒能力"]);
AddPersonAttrib(pid,"抗毒能力",JY.Thing[thingid]["加抗毒能力"]);
if pid==56 or (pid== 92 and JY.Person[pid]["武功1"] == 43) then
AddPersonAttrib(pid,"拳掌功夫",JY.Thing[thingid]["加拳掌功夫"]);
AddPersonAttrib(pid,"御剑能力",JY.Thing[thingid]["加御剑能力"]);
AddPersonAttrib(pid,"耍刀技巧",JY.Thing[thingid]["加耍刀技巧"]);
AddPersonAttrib(pid,"特殊兵器",JY.Thing[thingid]["加特殊兵器"]);
else
end
AddPersonAttrib(pid,"拳掌功夫",JY.Thing[thingid]["加拳掌功夫"]);
AddPersonAttrib(pid,"御剑能力",JY.Thing[thingid]["加御剑能力"]);
AddPersonAttrib(pid,"耍刀技巧",JY.Thing[thingid]["加耍刀技巧"]);
AddPersonAttrib(pid,"特殊兵器",JY.Thing[thingid]["加特殊兵器"]);
AddPersonAttrib(pid,"暗器技巧",JY.Thing[thingid]["加暗器技巧"]);
AddPersonAttrib(pid,"武学常识",JY.Thing[thingid]["加武学常识"]);
AddPersonAttrib(pid,"品德",JY.Thing[thingid]["加品德"]);
AddPersonAttrib(pid,"攻击带毒",JY.Thing[thingid]["加攻击带毒"]);
if JY.Thing[thingid]["加攻击次数"]==1 then
p["左右互搏"]=1;
end
p["修炼点数"]=p["修炼点数"]-needpoint;
if wugongid>=0 then
yes2=true
local oldwugong=0;
for i =1,10 do
if p["武功" .. i]==wugongid then
oldwugong=1;
p["武功等级" .. i]=math.modf((p["武功等级" .. i]+100)/100)*100;
kfnum=i
break;
end
end
if oldwugong==0 then --新的武功
for i=1,10 do
if p["武功" .. i]==0 then
p["武功" .. i]=wugongid;
kfnum=i
break;
end
end
end
end
else
break
end
end
if yes1 then
DrawStrBoxWaitKey( string.format("%s 修炼 %s 成功",p["姓名"],JY.Thing[thingid]["名称"]),C_WHITE,CC.DefaultFont);
end
if yes2 then
DrawStrBoxWaitKey(string.format("%s 升为第%s级",JY.Wugong[wugongid]["名称"],math.modf(p["武功等级" ..kfnum]/100)+1),C_WHITE,CC.DefaultFont);
end
if GetS(0,0,0,3)==1 and JY.Thing[thingid]["练出物品需经验"] <=0 and yes1 and (yes2==false or p["武功等级" ..kfnum]>=900) then
JY.Person[pid]["修炼物品"]=-1;
JY.Thing[thingid]["使用人"]=-1;
end
end
function mm4R()
local r;
if JY.Thing[202][WZ7]==1 then
r=math.random(2)
else
r=math.random(4)
end
local bdnl={"姓名", "头像代号", "生命最大值", "内力最大值",
"内力性质", "攻击力", "轻功","防御力",
"拳掌功夫", "御剑能力", "耍刀技巧", "特殊兵器",
"资质","武功1" }
local mm4={};
mm4[1]={"周芷若",301,350,600,0,40,30,30,30,30,0,0,71,41};
mm4[2]={"赵敏",302,270,500,1,50,20,30,0,40,0,0,78,37};
mm4[3]={"郭襄",303,200,500,2,20,20,20,20,20,20,20,73,12};
mm4[4]={"陆无双",304,400,700,0,50,20,40,0,0,40,0,64,54};
for i=1,14 do
JY.Person[92][bdnl[i]]=mm4[r][i]
end
JY.Person[92]["等级"]=1
JY.Person[92]["资质"]=100-JY.Person[0]["资质"]
if JY.Person[92]["资质"] > 79 then
JY.Person[92]["拳掌功夫"] = JY.Person[92]["拳掌功夫"] +20
JY.Person[92]["御剑能力"] = JY.Person[92]["御剑能力"] +20
JY.Person[92]["耍刀技巧"] = JY.Person[92]["耍刀技巧"] +20
JY.Person[92]["特殊兵器"] = JY.Person[92]["特殊兵器"] +20
JY.Person[92]["武功1"] = 43
JY.Person[92]["武功等级1"] = 900
RWTFLB[92]="天资聪颖"
elseif JY.Person[92]["资质"] > 29 then
JY.Person[92]["武功1"] = 85
JY.Person[92]["武功等级1"] = 900
RWTFLB[92]="冰清玉洁"
else
JY.Person[92]["武功1"] = 97
JY.Person[92]["武功等级1"] = 900
RWTFLB[92]="明月映江"
end
for i=1,5 do
JY.Person[92]["出招动画帧数"..i]=0
JY.Person[92]["出招动画延迟"..i]=0
JY.Person[92]["武功音效延迟"..i]=0
end
local avi={ {14,6,7},{8,3,4},{0,0,0},{7,4,5}, }
JY.Person[92]["出招动画帧数1"]=avi[r][1]
JY.Person[92]["出招动画延迟1"]=avi[r][3]
JY.Person[92]["武功音效延迟1"]=avi[r][2]
if r==3 then
local s={ {0,0,0},{9,2,3},{8,3,4},{8,3,4},{9,5,6}, }
for i=1,5 do
JY.Person[92]["出招动画帧数"..i]=s[i][1]
JY.Person[92]["出招动画延迟"..i]=s[i][3]
JY.Person[92]["武功音效延迟"..i]=s[i][2]
end
end
end
QZXS("感恩,謝謝幫忙測試") |