;;;QQ:67762207
[@main]
#IF
#ACT
loadvalue D1 "PlayerParam\PK赛记录.ini" [状态] [状态]
loadvalue A3 "PlayerParam\PK赛记录.ini" [用户] [申请人]

#IF
EQUAL A3 %USERNAME
#ELSEACT
break
#ELSESAY
Only the applicant can challenge.

#IF
EQUAL D1 2
#ACT
goto @Main_1
break


#IF
EQUAL D1 1
#ACT
mov 挑战积分卷 10
mov 允许吃药 "Off"
goto @Main_0

#ELSESAY
The two sides have accepted the competition.\

[@Main_1]
#IF
#Say
<Cancel Application/@取消申请>\

[@取消申请]
#act
savevalue "PlayerParam\PK赛记录.ini" [用户] [应战人] ""
savevalue "PlayerParam\PK赛记录.ini" [金额] [积分卷] 0
savevalue "PlayerParam\PK赛记录.ini" [状态] [状态] 1
#SAY
Abolition of success, please re-apply for the challenges\\

[@Main_0]
#IF
#SAY
<Enter Amount to Bet/@@挑战金额> (<$OUTPUT(挑战积分卷)> Gamepoints)\
<On/@ALLOWDRUG>  <Off/@NODRUG> (The use of potions = <$OUTPUT(允许吃药)>)\
<Enter opponents name/@@发起挑战>


[@ALLOWDRUG]
#ACT
mov 允许吃药 "On"
goto @Main_0

[@NODRUG]
#ACT
mov 允许吃药 "Off"
goto @Main_0

[@@挑战金额]
#IF
checkCMD checkuserjf %INPUTNUM
#ACT
mov 挑战积分卷 %INPUTNUM
#ELSEACT
break
#ELSESAY
You do not have enough Gamepoints.\

#IF
#ELSEACT
break
#ELSESAY
Must be at least 10 Gamepoints.\

#IF
#ACT
goto @Main_0

[@@发起挑战]
#IF
#ELSEACT
break
#ELSESAY
Can not be launched in less than 10 points the challenges of volume or volumes you do not have enough points\

#IF
checkcmd ISONLINE %INPUTSTR
#ACT
FormatStr "@_挑战对象(%s,%s,%s)" %USERNAME %挑战积分卷 %允许吃药
actcmd RUNSCRIPTLABEL %INPUTSTR %A9
mov A3 %INPUTSTR
savevalue "PlayerParam\PK赛记录.ini" [用户] [应战人] %INPUTSTR
savevalue "PlayerParam\PK赛记录.ini" [状态] [状态] 2
savevalue "PlayerParam\PK赛记录.ini" [状态] [允许吃药] %允许吃药
savevalue "PlayerParam\PK赛记录.ini" [金额] [积分卷] %挑战积分卷
#SAY
Challenge has been successfully challenge, please wait for response ... ...
#ELSESAY
Player not online.\\

#IF
checkcmd CHECKUSERJF %应战积分卷
#ACT
loadvalue D5 "PlayerParam\PK赛记录.ini" [挑战次数] [次数]
mov P1 %D5
mov P2 2
mul P1 P2
mov D6 %P9

#IF
!EQUAL D6 0
checkcmd CHECKUSERJF %D6
#ACT
actcmd SETUSERJF - %D6 发起挑战
inc D5 1
savevalue "PlayerParam\PK赛记录.ini" [挑战次数] [次数] %D5
sysmsg "<$OUTPUT(D5)> has challenged you to fight for <$OUTPUT(D6)> gamepoints!"
#ELSEACT
savevalue "PlayerParam\PK赛记录.ini" [挑战次数] [次数] 1
sysmsg "第1次发起挑战,收取积分0点"

[@_挑战对象()]
#ACT
mov A0 %ARG(1)
mov 应战积分卷 %ARG(2)
mov 允许吃药 %ARG(3)
#SAY
{FCOLOR/10}'<$OUTPUT(A0)>'{FCOLOR/12} has challenged you to fight for <$OUTPUT(应战积分卷)>Gamepoints.\
Potions are: <$OUTPUT(允许吃药)> \
Do you want to accept challenge?\\
<Accept/@~~acceptpk> <Refuse/@~~Refusepk>

[@~~Refusepk]
#ACT
close
actcmd RUNSCRIPTLABEL %A0 "@_拒绝挑战"   ;;主动拒绝

[@_拒绝挑战]
#ACT
savevalue "PlayerParam\PK赛记录.ini" [用户] [应战人] ""
savevalue "PlayerParam\PK赛记录.ini" [金额] [积分卷] 0
savevalue "PlayerParam\PK赛记录.ini" [状态] [状态] 1
#SAY
'<$OUTPUT(A3)>' rejected your challenge.\
<Exit/@exit>

[@~~acceptpk]
#ACT
loadvalue D1 "PlayerParam\PK赛记录.ini" [状态] [状态]
loadvalue A1 "PlayerParam\PK赛记录.ini" [用户] [应战人]
#IF
EQUAL D1 2
EQUAL A1 %USERNAME
#ELSEACT
sysmsg "Other person has canceled the application"
break

#IF
checkcmd CHECKUSERJF %应战积分卷
#ACT
savevalue "PlayerParam\PK赛记录.ini" [状态] [状态] 3
actcmd RUNSCRIPTLABEL %A0 "@_开始PK"   ;;接受
ACTCMD setuserjf - %应战积分卷
#ELSEACT
actcmd RUNSCRIPTLABEL %A0 "@_接受挑战失败"   ;;接受
#ELSESAY
You do not have <$OUTPUT(应战积分卷)> gamepoints.\

[@_接受挑战失败]  ;;发起者执行
#ACT
savevalue "PlayerParam\PK赛记录.ini" [用户] [应战人] ""
loadvalue D0 "PlayerParam\PK赛记录.ini" [金额] [积分卷]
savevalue "PlayerParam\PK赛记录.ini" [金额] [积分卷] 0
savevalue "PlayerParam\PK赛记录.ini" [状态] [状态] 1
#SAY
You have less points then asked please ask to re-apply.\

[@_开始PK] ;;发起者执行
#IF
checkcmd CHECKUSERJF %应战积分卷
#ELSEACT
actcmd RUNSCRIPTLABEL %A3 "@_发起者无积分"   ;;接受
break
#ELSESAY
Sorry, Lack of gamepoints.\

#IF
EQUAL 允许吃药 "Off"
#ACT
actcmd SETPKMODE 1 1
actcmd RUNSCRIPTLABEL %A3 "@_开始PK_2"   ;;接受
sysmsg "Fight is now in preperation time, If you leave or die you will lose the bet!"
#ELSEACT
actcmd SETPKMODE 1 0
actcmd RUNSCRIPTLABEL %A3 "@_开始PK_2"   ;;接受
sysmsg "Fight is now in preperation time, If you leave or die you will lose the bet!"

[@_发起者无积分]  ;;应战者执行
#IF
#SAY
The other person will have the gamepoints removed.\

[@_开始PK_2]   ;;应战者执行
#IF
checkcmd CHECKUSERJF %应战积分卷
#ELSEACT
break
#ACT
savevalue "PlayerParam\PK赛记录.ini" [状态] [状态] 3
loadvalue A1 "PlayerParam\PK赛记录.ini" [用户] [申请人]
ACTCMD setuserjf - %应战积分卷
mapmove E007,40,40

#IF
EQUAL 允许吃药 "Off"
#ACT
actcmd SETPKMODE 1 1
mov N1 5
delaygoto [grobal] 1 @PK系统消息
sysmsg "Fight is now in preperation time, If you leave or die you will lose the bet!"
linemsg [grobal] "'<$OUTPUT(A1)>' has challenged '<$USERNAME>' for '<$OUTPUT(应战积分卷)>'gamepoints! You can watch this fight at the PVP NPC in Bichon."
#ELSEACT
actcmd SETPKMODE 1 0
mov N1 5
delaygoto [grobal] 1 @PK系统消息
sysmsg "Fight is now in preperation time, If you leave or die you will lose the bet!"
linemsg [grobal] "'<$OUTPUT(A1)>' has challenged '<$USERNAME>' for '<$OUTPUT(应战积分卷)>'gamepoints! You can watch this fight at the PVP NPC in Bichon."

[@PK系统消息]
#IF
#ACT
loadvalue D7 "PlayerParam\PK赛记录.ini" [状态] [状态]
#IF
EQUAL D7 3
#ELSEACT
break

#IF
Large N1 0
#ACT
loadvalue A1 "PlayerParam\PK赛记录.ini" [用户] [申请人]
linemsg [grobal] "'<$OUTPUT(A1)>' has challenged '<$USERNAME>' for '<$OUTPUT(应战积分卷)>'gamepoints! Fight will start in <$OUTPUT(N1)> minutes，You can watch this fight at the PVP NPC in Bichon."
dec N1 1
delaygoto [grobal] 60 @PK系统消息
#ELSEACT
savevalue "PlayerParam\PK赛记录.ini" [状态] [状态] 4
SetAreaAttr "E007,40,40,200" "CLEAR"
linemsg [grobal] "'<$OUTPUT(A1)>' and '<$USERNAME>' fight for '<$OUTPUT(应战积分卷)>'gamepoints! You can watch this fight at the PVP NPC in Bichon."
delaygoto [grobal] 600 @强制结束 10033

[@强制结束]
#ACT
loadvalue D0 "PlayerParam\PK赛记录.ini" [金额] [积分卷]
loadvalue A0 "PlayerParam\PK赛记录.ini" [用户] [申请人]
loadvalue A1 "PlayerParam\PK赛记录.ini" [用户] [应战人]
actcmd RUNSCRIPTLABEL %A0 "@_PK超时"   ;;接受
actcmd RUNSCRIPTLABEL %A1 "@_PK超时"   ;;接受
actcmd delfile "envir\PlayerParam\PK赛记录.ini"
mapting E007 1 405 117
SetAreaAttr "E007,40,40,200" "SAFE"

[@_PK超时]
#ACT
loadvalue D0 "PlayerParam\PK赛记录.ini" [金额] [积分卷]
mov P1 %D0
mul P1 9
div P9 10
#IF
Large P9 0
#ACT
mov D0 %P9
actcmd setuserjf + %D0
sysmsg "Overtime game, the return of 90% of the volume of betting points, a total of <$OUTPUT(D0)> months."
;;;QQ:67762207=