|
楼主 |
发表于 2011-9-27 16:20
|
显示全部楼层
- function War_PersonTrainBook(pid) --战斗后修炼秘籍是否成功
- local p=JY.Person[pid];
- local thingid=p["修炼物品"];
- if thingid<0 then
- return ;
- end
- local wugongid=JY.Thing[thingid]["练出武功"];
- local wg=0;
- if JY.Person[pid]["武功10"]>0 and wugongid > 0 then
- for i=1,10 do
- if JY.Thing[thingid]["练出武功"]==JY.Person[pid]["武功"..i] then
- wg=1
- break;
- end
- end
- if wg==0 then return end
- end
- 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 thingid==139 then
- AddPersonAttrib(pid,"生命最大值",-15)
- AddPersonAttrib(pid,"生命",-15)
- if JY.Person[pid]["生命最大值"]<1 then JY.Person[pid]["生命最大值"]=1 end
- if JY.Person[pid]["生命"]<1 then JY.Person[pid]["生命"]=1 end
- end
- if JY.Thing[thingid]["改变内力性质"]==2 then
- p["内力性质"]=2;
- 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 pid==56 then
- AddPersonAttrib(pid,"拳掌功夫",JY.Thing[thingid]["加拳掌功夫"]*2);
- AddPersonAttrib(pid,"御剑能力",JY.Thing[thingid]["加御剑能力"]*2);
- AddPersonAttrib(pid,"耍刀技巧",JY.Thing[thingid]["加耍刀技巧"]*2);
- AddPersonAttrib(pid,"特殊兵器",JY.Thing[thingid]["加特殊兵器"]*2);
- else
- AddPersonAttrib(pid,"拳掌功夫",JY.Thing[thingid]["加拳掌功夫"]);
- AddPersonAttrib(pid,"御剑能力",JY.Thing[thingid]["加御剑能力"]);
- AddPersonAttrib(pid,"耍刀技巧",JY.Thing[thingid]["加耍刀技巧"]);
- AddPersonAttrib(pid,"特殊兵器",JY.Thing[thingid]["加特殊兵器"]);
- end
- 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
- if pid == 0 then
- AddPersonAttrib(pid,"攻击力",JY.Thing[thingid]["加御剑能力"]);
- AddPersonAttrib(pid,"轻功",JY.Thing[thingid]["加御剑能力"]);
- AddPersonAttrib(pid,"防御力",JY.Thing[thingid]["加御剑能力"]);
- 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
- end
复制代码 |
|