--------经验卷
local jingyanjuan_t = {
["1万经验卷"] = 10000,["12万经验卷"] = 120000,["50万经验卷"] = 500000,
}
local xiaohaoshouhun = {["12万经验卷"] = 5,["50万经验卷"] = 20}
function stdmodefunc203(actor,item)
if getlevel(actor) >= 75 then
sendmsg9(actor,"75级以下才可使用")
return false
end
if getitemname(actor,item) == "1万经验卷" then
local diejia = getiteminfo(actor,item,5) --叠加数量
delitem(actor,item)
changeexp(actor,"+",10000*diejia,false)
getexp(actor,10000*diejia) --获取经验触发
return false
end
setplaydef(actor,"N53",1)
shiyongzhanshi(actor,getitemname(actor,item))
return false
end
function shiyongzhanshi(actor,iname)
if itemcount(actor,iname) < 1 then
close()
return
end
local msg = ""
if iname == "12万经验卷" or iname == "50万经验卷" then
msg = [[
<Img|width=400|height=250|reset=1|bg=1|scale9r=20|scale9l=20|show=4|scale9b=20|esc=1|move=0|img=public/bg_npc_04.jpg|loadDelay=1|scale9t=20>
<Button|x=400.0|y=1.0|nimg=public/1900000510.png|pimg=public/1900000511.png|link=@exit>
<Img|x=97.0|y=48.0|width=200|esc=0|img=zhangheng/99.png>
<Img|x=32.0|y=66.0|width=50|height=50|esc=0|img=zhangheng/231.png>
<Img|x=11.0|y=161.0|width=380|esc=0|img=zhangheng/99.png>
<Text|ax=0.5|ay=0.5|x=201.0|y=72.5|color=255|size=14|text=已选择:$STM(SLIDERV_N53)个>
<Text|x=28.0|y=208.0|color=149|size=16|text=兽魂值可通过土城NPC珍禽异兽获得>
]]
if getplaydef(actor,"N53") > itemcount(actor,iname) then
setplaydef(actor,"N53",itemcount(actor,iname))
end
msg=msg.."<Button|x=105.0|y=56.0|color=255|size=18|nimg=zh/88.png|link=@jiajian,1,".. iname ..">"
msg=msg.."<Button|x=258.0|y=55.0|color=255|size=18|nimg=zh/89.png|link=@jiajian,2,".. iname ..">"
msg=msg.."<Text|ax=0.5|ay=0.5|x=199.0|y=30.5|color=251|size=18|text="..iname..">"
msg=msg.."<ItemShow|x=24.0|y=58.0|width=70|height=70|itemid=".. getidbyname(iname) .."|itemcount=".. itemcount(actor,iname) .."|showtips=1|bgtype=0>"
--sendmsg9(actor,""..getplaydef(actor,"N53"))
msg=msg.."<Slider|x=110.0|y=102.0|width=180|height=14|ballimg=public/bg_szjm_02_1.png|defvalue=".. getplaydef(actor,"N53") .."|maxvalue=10|bgimg=public/bg_szjm_01.png|sliderid=N53|barimg=public/bg_szjm_02.png|link=@ladongchufa,"..iname..">"
msg=msg.."<Button|x=293.0|y=199.0|color=10051|size=18|nimg=zhangheng/13.png|text=确定使用|link=@shiyongjingyanjuan,"..iname..">"
----下面是加的文字
msg=msg.."<Text|x=28.0|y=133.0|size=16|color=255|text=消耗兽魂值可使经验翻倍>"
msg=msg.."<Text|x=28.0|y=172.0|color=254|size=16|text=你当前拥有兽魂值:".. getshouhunzhi(actor) ..">"
if getint(actor,"经验卷经验翻倍") == 0 then
msg=msg.."<Text|x=218.0|y=133.0|color=253|size=16|text=当前消耗点数:0>"
msg=msg.."<Img|x=249.0|y=167.0|img=zh/77.png|link=@jingyanxuanze,"..iname..">"
else
msg=msg.."<Text|x=218.0|y=133.0|color=253|size=16|text=当前消耗点数:".. xiaohaoshouhun[iname] * getplaydef(actor,"N53") ..">"
msg=msg.."<Img|x=249.0|y=167.0|img=zh/78.png|link=@jingyanxuanze,"..iname..">"
end
msg=msg.."<Text|x=284.0|y=172.0|color=255|size=16|text=开启经验翻倍>"
end
say(actor,msg)
end
function shiyongjingyanjuan(actor,iname)
if getlevel(actor) >= 75 then
sendmsg9(actor,"75级以下才可使用")
return false
end
local sl = getplaydef(actor,"N53")
if sl < 1 then
return false
end
if sl > 10 then
sl = 10
end
local jyz = jingyanjuan_t[iname] * sl
if itemcount(actor,iname) < sl then
sendmsg9(actor,iname.."数量不足")
return shiyongzhanshi(actor,iname)
end
if iname ~= "1万经验卷" and getint(actor,"经验卷经验翻倍") == 1 then
if iname == "12万经验卷" or iname == "50万经验卷" then
if getshouhunzhi(actor) < xiaohaoshouhun[iname] * getplaydef(actor,"N53") then
sendmsg9(actor,"兽魂值不足")
return shiyongzhanshi(actor,iname)
end
subshouhunzhi(actor,xiaohaoshouhun[iname] * getplaydef(actor,"N53"))
jyz = jyz * 2
end
end
takeitem(actor,iname,sl)
changeexp(actor,"+",jyz,false)
getexp(actor,jyz) --获取经验触发
recalcabilitys(actor)
return shiyongzhanshi(actor,iname)
end
function jiajian(actor,caozuo,iname)
if caozuo == "1" then --减
if getplaydef(actor,"N53") <= 1 then
return
end
setplaydef(actor,"N53",getplaydef(actor,"N53")-1)
else
if getplaydef(actor,"N53") >= 10 then
return
end
setplaydef(actor,"N53",getplaydef(actor,"N53")+1)
end
return shiyongzhanshi(actor,iname)
end
function ladongchufa(actor,iname)
if getplaydef(actor,"N53") == 0 then
setplaydef(actor,"N53",1)
end
--sendmsg9(actor,""..getplaydef(actor,"N53"))
return shiyongzhanshi(actor,iname)
end
function jingyanxuanze(actor,iname)
if getint(actor,"经验卷经验翻倍") == 0 then
setint(actor,"经验卷经验翻倍",1)
else
setint(actor,"经验卷经验翻倍",0)
end
return shiyongzhanshi(actor,iname)
end