www.pudn.com > wap-wscs.rar > fighting.asp, change:2014-08-10,size:15762b


<% 
Function fighting() 
If act="attack" Then 
Call attack() 
End If  
End Function  
 
Sub attack() 
'Call echo("你正在进行普通攻击",1) 
				'Call echo("进入圆桌事件",1) 
				Call fightstart()'进入圆桌事件 
End Sub  
 
Sub fightstart 
				Call echo("<div style=""background:#FFFAF0; border-top:1px solid #ccc; "">",0) 
				Call ptom()'玩家攻击怪物 
				Call echo("</div>",0) 
				If fightinfo(userid,"mochp")<=0 Or fightinfo(userid,"mychp")<=0 Then Exit Sub 
				Call echo("<div style=""background:#FFFAF0; border-top:1px solid #ccc; "">",0) 
				Call mtop()'怪物攻击玩家 
				Call echo("</div>",0) 
End Sub  
 
Sub ptom()'玩家攻击怪物事件 
								'变量初始化 
				fightid=fightinfo(userid,"id")'战斗ID 
				moname=fightinfo(userid,"moname")'怪物名字 
				molvl=fightinfo(userid,"molvl")'怪物等级 
				mochp=fightinfo(userid,"mochp")'怪物剩余生命 
				mohp=fightinfo(userid,"mohp")'怪物总生命 
				monid=fightinfo(userid,"monid")'怪物ID 
				mychp=fightinfo(userid,"mychp")'玩家剩余生命 
				'molvl=13 
				If molvl=1000 Then  
				molvl=1000 
				Else 
				mcop=monster(monid,"cop")'是否副本怪物 
				If mcop Then 
				molvl=molvl+10 
				Else 
				molvl=molvl 
				End If 
				End If  
				mosb=molvl'怪物闪避率 常量0.3 
				mogd=molvl*2/5'怪物格挡率 
				mobj=(molvl*3)/6'怪物暴击率 
				moap=molvl*2 
				modp=molvl*3 
				mohp=(70+molvl*10)+molvl^2 
				Set usinfo =New userinfo 
				myname=usinfo.usinfo(gsid,"nickname")'玩家名字 
				mylvl=usinfo.usinfo(gsid,"lvl")'等级 
				myhp=usinfo.usinfo(gsid,"hp")'总生命值 
				mysb=usinfo.usinfo(gsid,"sb")'闪避率 
				myap=usinfo.usinfo(gsid,"ap")'攻击力 
				mydp=usinfo.usinfo(gsid,"dp")'防御力 
				mygd=usinfo.usinfo(gsid,"gd")'格挡率 
				mybj=usinfo.usinfo(gsid,"bj")'暴击率 
				wq=usinfo.usinfo(gsid,"wq")'武器 
				wqconlvl=getconsozb(wq,"lvl",userid)'强化等级 
				If wqconlvl>0 Then  
				wqconap=getconsozb(wq,"ap",userid)'武器强化攻击 
				'Call echo("强化攻击力:"&wqap,1) 
				wqcondp=getconsozb(wq,"dp",userid)'武器强化防御 
				'Call echo("强化攻击力:"&wqdp,1) 
				wqconhp=getconsozb(wq,"hp",userid)'武器强化生命 
				'Call echo("强化攻击力:"&wqhp,1) 
				wqconsb=getconsozb(wq,"sb",userid)'武器强化闪避 
				'Call echo("强化攻击力:"&wqsb,1) 
				wqcongd=getconsozb(wq,"gd",userid)'武器强化格挡 
				'Call echo("强化攻击力:"&wqgd,1) 
				wqconbj=getconsozb(wq,"bj",userid)'武器强化暴击 
				'Call echo("强化攻击力:"&wqbj,1) 
				End If  
				wqap=usinfo.zbinfo("wq",wq,"ap",userid)'武器攻击力 
				wqdp=usinfo.zbinfo("wq",wq,"dp",userid)'武器防御力 
				wqhp=usinfo.zbinfo("wq",wq,"hp",userid)'武器生命值 
				wqsb=usinfo.zbinfo("wq",wq,"sb",userid)'武器闪避 
				wqgd=usinfo.zbinfo("wq",wq,"gd",userid)'武器格挡 
				wqbj=usinfo.zbinfo("wq",wq,"bj",userid)'武器暴击 
				'If wq=0 Then wq="无" 
				yf=usinfo.usinfo(gsid,"yf")'衣服 
				yfconlvl=getconsozb(yf,"lvl",userid)'强化等级 
				If yfconlvl>0 Then  
				yfconap=getconsozb(yf,"ap",userid)'武器强化攻击 
				'Call echo("强化攻击力:"&wqap,1) 
				yfcondp=getconsozb(yf,"dp",userid)'武器强化防御 
				'Call echo("强化攻击力:"&wqdp,1) 
				yfconhp=getconsozb(yf,"hp",userid)'武器强化生命 
				'Call echo("强化攻击力:"&wqhp,1) 
				yfconsb=getconsozb(yf,"sb",userid)'武器强化闪避 
				'Call echo("强化攻击力:"&wqsb,1) 
				yfcongd=getconsozb(yf,"gd",userid)'武器强化格挡 
				'Call echo("强化攻击力:"&wqgd,1) 
				yfconbj=getconsozb(yf,"bj",userid)'武器强化暴击 
				'Call echo("强化攻击力:"&wqbj,1) 
				End If  
				yfap=usinfo.zbinfo("yf",yf,"ap",userid)'衣服攻击力 
				yfdp=usinfo.zbinfo("yf",yf,"dp",userid)'衣服防御力 
				yfhp=usinfo.zbinfo("yf",yf,"hp",userid)'衣服生命值 
				yfsb=usinfo.zbinfo("yf",yf,"sb",userid)'衣服闪避 
				yfgd=usinfo.zbinfo("yf",yf,"gd",userid)'衣服格挡 
				yfbj=usinfo.zbinfo("yf",yf,"bj",userid)'衣服暴击 
				'If yf=0 Then yf="无" 
				xz=usinfo.usinfo(gsid,"xz")'鞋子 
				xzconlvl=getconsozb(xz,"lvl",userid)'强化等级 
				If xzconlvl>0 Then  
				xzconap=getconsozb(xz,"ap",userid)'武器强化攻击 
				'Call echo("强化攻击力:"&wqap,1) 
				xzcondp=getconsozb(xz,"dp",userid)'武器强化防御 
				'Call echo("强化攻击力:"&wqdp,1) 
				xzconhp=getconsozb(xz,"hp",userid)'武器强化生命 
				'Call echo("强化攻击力:"&wqhp,1) 
				xzconsb=getconsozb(xz,"sb",userid)'武器强化闪避 
				'Call echo("强化攻击力:"&wqsb,1) 
				xzcongd=getconsozb(xz,"gd",userid)'武器强化格挡 
				'Call echo("强化攻击力:"&wqgd,1) 
				xzconbj=getconsozb(xz,"bj",userid)'武器强化暴击 
				'Call echo("强化攻击力:"&wqbj,1) 
				End If  
				xzap=usinfo.zbinfo("xz",xz,"ap",userid)'鞋子攻击力 
				xzdp=usinfo.zbinfo("xz",xz,"dp",userid)'鞋子防御力 
				xzhp=usinfo.zbinfo("xz",xz,"hp",userid)'鞋子生命值 
				xzsb=usinfo.zbinfo("xz",xz,"sb",userid)'鞋子闪避 
				xzgd=usinfo.zbinfo("xz",xz,"gd",userid)'鞋子格挡 
				xzbj=usinfo.zbinfo("xz",xz,"bj",userid)'鞋子暴击 
				'If xz=0 Then xz="无" 
				tk=usinfo.usinfo(gsid,"tk")'头盔 
				tkconlvl=getconsozb(tk,"lvl",userid)'强化等级 
				If tkconlvl>0 Then  
				tkconap=getconsozb(tk,"ap",userid)'武器强化攻击 
				'Call echo("强化攻击力:"&wqap,1) 
				tkcondp=getconsozb(tk,"dp",userid)'武器强化防御 
				'Call echo("强化攻击力:"&wqdp,1) 
				tkconhp=getconsozb(tk,"hp",userid)'武器强化生命 
				'Call echo("强化攻击力:"&wqhp,1) 
				tkconsb=getconsozb(tk,"sb",userid)'武器强化闪避 
				'Call echo("强化攻击力:"&wqsb,1) 
				tkcongd=getconsozb(tk,"gd",userid)'武器强化格挡 
				'Call echo("强化攻击力:"&wqgd,1) 
				tkconbj=getconsozb(tk,"bj",userid)'武器强化暴击 
				'Call echo("强化攻击力:"&wqbj,1) 
				End If  
				tkap=usinfo.zbinfo("tk",tk,"ap",userid)'头盔攻击力 
				tkdp=usinfo.zbinfo("tk",tk,"dp",userid)'头盔防御力 
				tkhp=usinfo.zbinfo("tk",tk,"hp",userid)'头盔生命值 
				tksb=usinfo.zbinfo("tk",tk,"sb",userid)'头盔闪避 
				tkgd=usinfo.zbinfo("tk",tk,"gd",userid)'头盔格挡 
				tkbj=usinfo.zbinfo("tk",tk,"bj",userid)'头盔暴击 
				'If tk=0 Then tk="无" 
				fq=usinfo.usinfo(gsid,"fq")'法器 
				fqconlvl=getconsozb(fq,"lvl",userid)'强化等级 
				If fqconlvl>0 Then  
				fqconap=getconsozb(fq,"ap",userid)'武器强化攻击 
				'Call echo("强化攻击力:"&wqap,1) 
				fqcondp=getconsozb(fq,"dp",userid)'武器强化防御 
				'Call echo("强化攻击力:"&wqdp,1) 
				fqconhp=getconsozb(fq,"hp",userid)'武器强化生命 
				'Call echo("强化攻击力:"&wqhp,1) 
				fqconsb=getconsozb(fq,"sb",userid)'武器强化闪避 
				'Call echo("强化攻击力:"&wqsb,1) 
				fqcongd=getconsozb(fq,"gd",userid)'武器强化格挡 
				'Call echo("强化攻击力:"&wqgd,1) 
				fqconbj=getconsozb(fq,"bj",userid)'武器强化暴击 
				'Call echo("强化攻击力:"&fqconbj,1) 
				End If  
				fqap=usinfo.zbinfo("fq",fq,"ap",userid)'法器攻击力 
				fqdp=usinfo.zbinfo("fq",fq,"dp",userid)'法器防御力 
				fqhp=usinfo.zbinfo("fq",fq,"hp",userid)'法器生命值 
				fqsb=usinfo.zbinfo("fq",fq,"sb",userid)'法器闪避 
				fqgd=usinfo.zbinfo("fq",fq,"gd",userid)'法器格挡 
				fqbj=usinfo.zbinfo("fq",fq,"bj",userid)'法器暴击 
 
				'If fq=0 Then fq="无" 
				zbap=wqap+yfap+xzap+tkap+fqap 
				zbdp=wqdp+yfdp+xzap+tkdp+fqdp 
				zbhp=wqhp+yfhp+xzhp+tkhp+fqhp 
				zbsb=wqsb+yfsb+xzsb+tksb+fqsb 
				zbgd=wqgd+yfgd+xzgd+tkgd+fqgd 
				zbbj=wqbj+yfbj+xzbj+tkbj+fqbj 
 
				buffap=usinfo.buffinfo(userid,"ap")'buff ap 
				buffdp=usinfo.buffinfo(userid,"dp")'buff dp 
				buffhp=usinfo.buffinfo(userid,"hp")'buff hp 
				buffsb=usinfo.buffinfo(userid,"sb")'buff sb 
				buffgd=usinfo.buffinfo(userid,"gd")'buff gd 
				buffbj=usinfo.buffinfo(userid,"bj")'buff bj 
 
 
				myap=myap+zbap 
				myap=myap+int((myap)*(buffap/100)) 
				myap=myap+int(((wqconap+yfconap+xzconap+tkconap+fqconap)*0.01)*myap) 
 
				mydp=mydp+zbdp 
				mydp=mydp+int((mydp)*(buffdp/100)) 
				mydp=mydp+int(((wqcondp+yfcondp+xzcondp+tkcondp+fqcondp)*0.01)*mydp) 
 
				myhp=myhp+zbhp 
				myhp=myhp+int((myhp)*(buffhp/100)) 
				myhp=myhp+int(((wqconhp+yfconhp+xzconhp+tkconhp+fqconhp)*0.01)*myhp) 
 
				mysb=mysb+zbsb 
				mysb=mysb+buffsb 
				mysb=mysb+wqconsb+yfconsb+xzconsb+tkconsb+fqconsb 
 
				mygd=mygd+zbgd 
				mygd=mygd+buffgd 
				mygd=mygd+wqcongd+yfcongd+xzcongd+tkcongd+fqcongd 
 
				mybj=mybj+zbbj 
				mybj=mybj+buffbj 
				mybj=mybj+wqconbj+yfconbj+xzconbj+tkconbj+fqconbj 
 
				Set usinfo=Nothing  
'Call echo("玩家等级:"&mylvl,1) 
'Call echo("玩家总生命:"&myhp,1) 
'Call echo("玩家闪避率:"&mysb,1) 
'Call echo("玩家攻击力:"&myap,1) 
'Call echo("玩家防御力:"&mydp,1) 
'Call echo("玩家暴击率:"&mybj,1) 
'Call echo("玩家格挡率:"&mygd,1) 
'Call echo("怪物等级:"&molvl,1) 
'Call echo("怪物总生命:"&mohp,1) 
'Call echo("怪物剩余生命"&mochp,1) 
'Call echo("怪物闪避率:"&mosb,1) 
'Call echo("怪物格挡率:"&mogd,1) 
'Call echo("怪物暴击率:"&mobj,1) 
'玩家攻击怪物的战斗事件列表 
'怪物格挡 怪物闪避 玩家暴击 玩家普攻 
Randomize '放置一个随机种子 
'Call echo("随机数:"&rnd,1) 
dim max,min 
max=100 
min=0.1 
mode=Int((max-min+1)*Rnd+min) 
mode1=Int((10-20+1)*Rnd+20) 
'Call echo("事件总概率:"&mogd + mosb + mybj,1) 
'Call echo("随机生产值:"&mode,1) 
'Call echo("怪物闪避TP:0-"&mosb,1) 
'Call echo("怪物格挡TP:"&mosb&"-"&(mogd + mosb),1) 
'Call echo("玩家暴击TP:"&(mogd + mosb)&"-"&(mogd + mosb + mybj),1) 
'Call echo("玩家普攻TP:"&(mogd + mosb + mybj)&"-",1) 
        if mode<=mogd Then'如果TP线位于怪物的格挡率 
            atkMode = "Block" '攻击模式为格挡 
			'Call echo("怪物闪避",1) 
			mhit=0 
			Call echo("【<font color=red>闪避</font>】"&myname&"发起攻击,但是"&moname&"轻轻一闪,躲过了",1) 
        ElseIf mode>mogd And mode<=(mogd + mybj) Then'如果TP线位于 怪物格挡 与 怪物暴击之间 
            atkMode = "Counter Attack" '暴击 
			'Call echo("玩家暴击",1) 
			mhit=int(((myap/2)-(modp/4)-mode1)*2) 
			If mhit<0 Then mhit=1 
			Call echo("【<font color=red>暴击</font>】"&myname&"抓住破绽,一击打中要害,"&moname&"受到"&mhit&"伤害",1) 
        ElseIf mode>(mogd + mybj) And mode<=(mogd + mosb + mybj) Then'闪避 
            atkMode = "Dodge" '攻击模式为闪避 
			'Call echo("怪物格挡",1) 
			mhit=int(((myap/2)-(modp/4)-mode1)/2) 
			If mhit<0 Then mhit=1 
			Call echo("【<font color=red>格挡</font>】"&myname&"发起攻击,"&moname&"死死地挡了下来,受到"&mhit&"伤害",1) 
        Else 
            atkMode = "Normal Attack" 
			'Call echo("玩家普攻",1) 
			mhit=int(((myap/2)-(modp/4)-mode1)) 
			If mhit<0 Then mhit=1 
			Call echo("【<font>普攻</font>】"&myname&"发起攻击,"&moname&"受到"&mhit&"伤害",1) 
		End If  
		Call upptom(mhit,mochp)'更新怪物血量 
End Sub  
 
Sub upptom(mhit,mochp) 
				set rs = server.createobject("adodb.recordset") 
				rs.open"select * from fight where id="&fightid,conn,1,3 
				if not (rs.bof and rs.eof) Then 
				If (mochp-mhit)>=0 Then  
				rs("mochp")=mochp-mhit 
				Else 
				rs("mochp")=0 
				End If 
				 
				rs.update 
				End If  
				rs.close 
				Set rs =Nothing  
End Sub  
 
Sub mtop()'怪物攻击玩家事件 
								'变量初始化 
				fightid=fightinfo(userid,"id")'战斗ID 
				moname=fightinfo(userid,"moname")'怪物名字 
				molvl=fightinfo(userid,"molvl")'怪物等级 
				mochp=fightinfo(userid,"mochp")'怪物剩余生命 
				mohp=fightinfo(userid,"mohp")'怪物总生命 
				monid=fightinfo(userid,"monid")'怪物ID 
				mychp=fightinfo(userid,"mychp")'玩家剩余生命 
				'molvl=13 
				If molvl=1000 Then  
				molvl=1000 
				Else 
				mcop=monster(monid,"cop")'是否副本怪物 
				If mcop Then 
				molvl=molvl+10 
				Else 
				molvl=molvl 
				End If 
				End If  
				mosb=molvl'怪物闪避率 常量0.3 
				mogd=molvl*2/5'怪物格挡率 
				mobj=(molvl*3)/6'怪物暴击率 
				If molvl=0 Then  
				moap=int(molvl+molvl^2+molvl*5) 
				modp=int(molvl+molvl^2-molvl*3) 
				Else 
				moap=int(molvl*(70/molvl)+molvl^2+molvl*5) 
				modp=int(molvl*(70/molvl)+molvl^2-molvl*3) 
				End If  
				mohp=(70+molvl*10)+molvl^2 
				Set usinfo =New userinfo 
				myname=usinfo.usinfo(gsid,"nickname")'玩家名字 
				mylvl=usinfo.usinfo(gsid,"lvl")'等级 
				myhp=usinfo.usinfo(gsid,"hp")'总生命值 
				mysb=usinfo.usinfo(gsid,"sb")'闪避率 
				myap=usinfo.usinfo(gsid,"ap")'攻击力 
				mydp=usinfo.usinfo(gsid,"dp")'防御力 
				mygd=usinfo.usinfo(gsid,"gd")'格挡率 
				mybj=usinfo.usinfo(gsid,"bj")'暴击率 
				Set usinfo=Nothing  
'Call echo("玩家等级:"&mylvl,1) 
'Call echo("玩家总生命:"&myhp,1) 
'Call echo("玩家剩余生命:"&mychp,1) 
'Call echo("玩家闪避率:"&mysb,1) 
'Call echo("玩家攻击力:"&myap,1) 
'Call echo("玩家防御力:"&mydp,1) 
'Call echo("玩家暴击率:"&mybj,1) 
'Call echo("玩家格挡率:"&mygd,1) 
'Call echo("怪物等级:"&molvl,1) 
'Call echo("怪物总生命:"&mohp,1) 
'Call echo("怪物剩余生命"&mochp,1) 
'Call echo("怪物闪避率:"&mosb,1) 
'Call echo("怪物格挡率:"&mogd,1) 
'Call echo("怪物暴击率:"&mobj,1) 
'玩家攻击怪物的战斗事件列表 
'怪物格挡 怪物闪避 玩家暴击 玩家普攻 
Randomize '放置一个随机种子 
'Call echo("随机数:"&rnd,1) 
dim max,min 
max=100 
min=0.1 
mode=Int((max-min+1)*Rnd+min) 
mode1=Int((10-20+1)*Rnd+20) 
'Call echo("事件总概率:"&mogd + mosb + mybj,1) 
'Call echo("随机生产值:"&mode,1) 
'Call echo("怪物闪避TP:"&mosb,1) 
'Call echo("怪物格挡TP:"&mosb&"-"&(mogd + mosb),1) 
'Call echo("玩家暴击TP:"&(mogd + mosb)&"-"&(mogd + mosb + mybj),1) 
'Call echo("玩家普攻TP:"&(mogd + mosb + mybj)&"-",1) 
        if mode<=mygd Then'如果TP线位于怪物的格挡率 
            atkMode = "Block" '攻击模式为格挡 
			'Call echo("怪物闪避",1) 
			phit=0 
			Call echo("【<font color=red>闪避</font>】"&moname&"发起攻击,但是"&myname&"轻轻一闪,躲过了",1) 
        ElseIf mode>mygd And mode<=(mygd + mosb) Then'如果TP线位于 怪物格挡 与 玩家闪避之间 
            atkMode = "Dodge" '攻击模式为闪避 
			'Call echo("怪物格挡",1) 
			phit=int(((moap/2)-(mydp/4)-mode1)/2) 
			If phit<0 Then phit=1 
			Call echo("【<font color=red>格挡</font>】"&moname&"发起攻击,"&myname&"死死地挡了下来,受到"&phit&"伤害",1) 
        ElseIf mode>(mygd + mosb) And mode<=(mygd+mobj+mysb) Then'暴击 
            atkMode = "Counter Attack" '暴击 
			'Call echo("玩家暴击",1) 
			phit=int(((moap/2)-(mydp/4)-mode1)*2) 
			If phit<0 Then phit=1 
			Call echo("【<font color=red>暴击</font>】"&moname&"抓住破绽,一击打中要害,"&myname&"受到"&phit&"伤害",1) 
        Else 
            atkMode = "Normal Attack" 
			'Call echo("玩家普攻",1) 
			phit=int(((moap/2)-(mydp/4)-mode1)) 
			If phit<0 Then phit=1 
			Call echo("【<font>普攻</font>】"&moname&"发起攻击,"&myname&"受到"&phit&"伤害",1) 
		End If  
		Call upmtop(phit,mychp)'更新怪物血量 
End Sub  
 
Sub upmtop(phit,mychp) 
				set rs = server.createobject("adodb.recordset") 
				rs.open"select * from fight where id="&fightid,conn,1,3 
				if not (rs.bof and rs.eof) Then 
				If (mychp-phit)>0 Then  
				rs("mychp")=mychp-phit 
				Else 
				rs("mychp")=0 
				End If  
				rs.update 
				End If  
				rs.close 
				Set rs =Nothing  
End Sub  
%>