;;不要删掉此行

[@Main]
#IF
IsAdmin
#ACT
GoTo @MainNPC
#ELSEACT
GoTo @Main2

[@Main2]
#ACT
FormatStr "FLD_CHARACTER='%s'" %USERNAME
ReadValueSql  "TBL_ABILITY"  %A9  "FLD_CHARACTER,FLD_LEVEL" [@CheckPlayerClass]

[@CheckPlayerClass()]
#ACT
mov A1 %ARG(1)
mov D2 %ARG(2)

#IF
CheckJob Warrior
#ACT
GoTO @CheckWarrior
BREAK

#IF
CheckJob Wizard
#ACT
GoTO @CheckWizard
BREAK

#IF
CheckJob Taoist
#ACT
GoTO @CheckTaoist

;------------------------------------------

[@CheckWarrior]
#ACT
Loadvalue A5 "QuestDiary\HighLevel.txt" [TopLevel] [Warrior]
#ELSEACT
GoTo @MainNPC
BREAK

#IF
Large D2 %A5
#ACT
SaveValue "QuestDiary\HighLevel.txt" [TopPlayers] [Warrior] %Username
SaveValue "QuestDiary\HighLevel.txt" [TopLevel] [Warrior] %D2
#ACT
GoTo @MainNPC
#ELSEACT
GoTo @MainNPC

;------------------------------------------

[@CheckWizard]
#ACT
Loadvalue A4 "QuestDiary\HighLevel.txt" [TopLevel] [Wizard]
#ELSEACT
GoTo @MainNPC
BREAK

#IF
Large D2 %A4
#ACT
SaveValue "QuestDiary\HighLevel.txt" [TopPlayers] [Wizard] %Username
SaveValue "QuestDiary\HighLevel.txt" [TopLevel] [Wizard] %D2
#ACT
GoTo @MainNPC
#ELSEACT
GoTo @MainNPC

;------------------------------------------

[@CheckTaoist]
#ACT
Loadvalue A6 "QuestDiary\HighLevel.txt" [TopLevel] [Taoist]
#ELSEACT
GoTo @MainNPC
BREAK

#IF
Large D2 %A6
#ACT
SaveValue "QuestDiary\HighLevel.txt" [TopPlayers] [Taoist] %Username
SaveValue "QuestDiary\HighLevel.txt" [TopLevel] [Taoist] %D2
#ACT
GoTo @MainNPC
#ELSEACT
GoTo @MainNPC

;------------------------------------------

[@MainNPC]
#SAY
Player Statics:\\
<Highest Level/@High_Level> {FCOLOR/1} (TESTING){FCOLOR/12}\
<Check Player Infomation/@@CheckPlayerLevel>\\
<Leave/@Exit>\

;------------------------------------------

[@High_Level]
#ACT
Loadvalue A1 "QuestDiary\HighLevel.txt" [TopPlayers] [Wizard]
Loadvalue A2 "QuestDiary\HighLevel.txt" [TopPlayers] [Warrior]
Loadvalue A3 "QuestDiary\HighLevel.txt" [TopPlayers] [Taoist]

Loadvalue A4 "QuestDiary\HighLevel.txt" [TopLevel] [Wizard]
Loadvalue A5 "QuestDiary\HighLevel.txt" [TopLevel] [Warrior]
Loadvalue A6 "QuestDiary\HighLevel.txt" [TopLevel] [Taoist]
#SAY
Top Players:\\
Wizard: {FCOLOR/10}<$OUTPUT(A1)>{FCOLOR/12} Level: {FCOLOR/10}<$OUTPUT(A4)>{FCOLOR/12}\
Warrior: {FCOLOR/10}<$OUTPUT(A2)>{FCOLOR/12} Level: {FCOLOR/10}<$OUTPUT(A5)>{FCOLOR/12}\
Taoist: {FCOLOR/10}<$OUTPUT(A3)>{FCOLOR/12} Level: {FCOLOR/10}<$OUTPUT(A6)>{FCOLOR/12}\\
{FCOLOR/1}Note: This is only a guide and will update from\
the database only if someone a higher level than shown\
here talks to this npc...\\{FCOLOR/12}
<Leave/@Exit>

;------------------------------------------

[@@CheckPlayerLevel]
#ACT
mov  A0  %INPUTSTR
FormatStr "FLD_CHARACTER='%s'" %A0
ReadValueSql  "TBL_CHARACTER"  %A9  "FLD_LEVEL,FLD_JOB,FLD_SEX,FLD_GOLD,FLD_CHARACTER,FLD_UPDATEDATETIME" [@CheckPlayerLevel2]

[@CheckPlayerLevel2()]
#ACT
mov D1 %ARG(1)
mov D2 %ARG(2)
mov D3 %ARG(3)
mov D4 %ARG(4)
mov A5 %ARG(5)
mov A6 %ARG(6)

#IF
Equal A5 ""
#ACT
GoTo @NoChar
BREAK

#IF
Equal A5 "Vamp"
#ACT
GoTo @GMChar
BREAK

#IF
Equal A5 "Tipsy"
#ACT
GoTo @GMChar
BREAK

#ELSEACT
GoTo @CheckPlayerLevelNext

;------------------------------------------

[@CheckPlayerLevelNext]
#ACT
FormatStr "FLD_CHARACTER='%s'" %A5
ReadValueSql  "TBL_ABILITY"  %A9  "FLD_EXP,FLD_MAXEXP" [@CheckPlayerLevelNext2]

[@CheckPlayerLevelNext2()]
#ACT
mov D6 %ARG(1)
mov D7 %ARG(2)
#SAY
Results:\\
Character Name: {FCOLOR/10}<$OUTPUT(A5)>{FCOLOR/12} \
Character Level: {FCOLOR/10}<$OUTPUT(D1)>{FCOLOR/12}\
Character Class: {FCOLOR/10}<$@GetCharClass>{FCOLOR/12}\
Character Gender: {FCOLOR/10}<$@GetCharSex>{FCOLOR/12}\
Character Gold: {FCOLOR/10}<$@GetCharGold>{FCOLOR/12}\
Character Exp: {FCOLOR/10}<$OUTPUT(D6)>{FCOLOR/12}/{FCOLOR/10}<$OUTPUT(D7)>{FCOLOR/12}\
Character Last Active: {FCOLOR/10}<$OUTPUT(A6)>{FCOLOR/12}\
<Leave/@Exit>

;------------------------------------------

[@NoChar]
#SAY
{FCOLOR/1}Player Not Found{FCOLOR/12} \\
<Leave/@Exit>

;------------------------------------------

[@GMChar]
#SAY
{FCOLOR/1}Server Admin Infomation Hidden{FCOLOR/12}\\
<Leave/@Exit>

;------------------------------------------

[@GetCharGold]
#IF
IsAdmin
#SAY
<$OUTPUT(D4)>
#ELSESAY
Admin Only

;------------------------------------------

[@GetCharSex]
#IF
Equal D3 0
#SAY
Male
#ELSESAY
Female

;------------------------------------------

[@GetCharClass]
#IF
Equal D2 0
#SAY
Warrior
#ACT
break

#IF
Equal D2 1
#SAY
Wizard
#ACT
break

#IF
Equal D2 2
#SAY
Taoist
#ACT
break

;------------------------------------------

;;不要删掉此行
