[@master2]
{
#IF
#ACT
MOV D0 0
loadvalue D0 "ϵͳ.INI"  ʦͽnpcʱ


#IF
!checkcmd IsTestServer
#say
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/13}1: {FCOLOR/2}You can Mentor at 72\
{FCOLOR/13}2: {FCOLOR/2}Students below 65 can Mentored\\

{FCOLOR/13}Mentor Rewards:\
{FCOLOR/13}Both will get 30% Experience bonus\\

________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Command{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
________________{FCOLOR/1}<[Allow Master]/@ͽ>{FCOLOR/12}\\

#ELSESAY
{FCOLOR/2}Open Zone <$OUTPUT(D0)> hours after the apprenticeship system are opened!\\



#IF
!checklevel 66
EQUAL USERSTFLAG 0
Esmall D0 %CURHOUR
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Features{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
 <[Get Mentor]/@@GETTEACHER>\\

#IF
EQUAL USERSTFLAG 1
Esmall D0 %CURHOUR
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Features{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2} <[Expel]/@ʦ> your Student <$OUTPUT(USERSTNAME)>\\

#IF
EQUAL USERSTFLAG 2
Esmall D0 %CURHOUR
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Features{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2} <[Expel]/@ʦ> your Mentor <$OUTPUT(USERSTNAME)>\\

#IF
EQUAL USERSTFLAG 6
Esmall D0 %CURHOUR
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Features{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2} <[Removing Relationship]/@ʦϵ> for you and <$OUTPUT(USERSTNAME)> \
_ {FCOLOR/2}Has reached apprenticeship level, but not from the master and apprentice relationship with you\\

#IF
EQUAL USERSTFLAG 7
Esmall D0 %CURHOUR
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
 {FCOLOR/2}<Removing Relationship/@ͽܽϵ> for you and <$OUTPUT(USERSTNAME)>\
_ {FCOLOR/2}Has reached apprenticeship level, but not from the master and apprentice relationship with you\\


#IF
Esmall D0 %CURHOUR
#SAY
_________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Token{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} {FCOLOR/2}\\
 <[Buy Mentor Token]/@ʦͽ>\\
{FCOLOR/13}(Teleport to each other like a Wedding Ring)\
{FCOLOR/13}You can use once every 30 seconds.\\
 <Close/@exit>
#ACT
break
 
#elsesay
{FCOLOR/2}Open Zone <$OUTPUT(D0)> hours after the apprenticeship system are opened!\\
<Close/@EXIT>\

[@@GETTEACHER]
#IF
!checklevel 66  ;;1.ͽܵȼ
#ELSESAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}65 below (including 65) can be apprentice!\
<Close/@EXIT>
#ELSEACT
break

#IF
checkjob wizard
#ACT
mov A6 "Wizard"
#IF
checkjob warrior
#ACT
mov A6 "Warrior"
#ELSEACT
mov A6 "Taoist"

#IF
checkcmd CHECKALLOWST %INPUTSTR  ;;2.ʦ 3.ʦʦ
checklevel
#act
FormatStr "@_ShowtoTea(%s,%s,%s)" %USERNAME %P9 %A1
actcmd RUNSCRIPTLABEL %INPUTSTR %A9
mov A3 %INPUTSTR
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}Mentor Invitation has been successfully sent, please wait for a response.
#ELSESAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}The other player is not online or are not allowed apprentice.\\


[@_ShowtoTea()]
#IF
!EQUAL USERSTFLAG 0 ;;4.ʦûͽ
#ACT
actcmd RUNSCRIPTLABEL %A0 "@_ShowtoStu_3"   ;;Ѿͽ
break

#IF
checklevel 72  ;;5.ʦȼ
#ACT
mov A0 %ARG(1) ;;ͽ
mov D0 %ARG(2) ;;ͽܵȼ
mov A2 %ARG(2) ;;ͽְҵ
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}Player: {FCOLOR/10}'<$OUTPUT(A0)>'{FCOLOR/12}\ 
{FCOLOR/2}Level: {FCOLOR/10}'<$OUTPUT(D0)>'{FCOLOR/12}\ 
{FCOLOR/2}Has asked to be your Student.\
<Accept/@~~acceptst> <Refuse/@~~Refuse>
#ELSEACT
actcmd RUNSCRIPTLABEL %A0 "@_ShowtoStu_2"   ;;ȼ
break

[@~~acceptst]
#ACT
actcmd RUNSCRIPTLABEL %A0 "@_ShowtoStu_4"   ;;

#IF
checkcmd ISONLINE %A0
#ACT
actcmd SETSTFLAG 1 %A0  ;;趨Լ״̬Ϊ1 ͽ%A0
actcmd SETSTFLAG 2 %USERNAME %A0 ;;趨ͽ%A0״̬Ϊ2 ͽܵʦͽϵΪԼ
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}Congratulations!\
{FCOLOR/2}Successfully received '<$OUTPUT(A0)>' as your Student.\
<Close/@exit>
#ELSESAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}Sorry, the player has gone offline.\
<Close/@exit>


[@~~Refuse]
#ACT
actcmd RUNSCRIPTLABEL %A0 "@_ShowtoStu_1"   ;;ܾ


[@_ShowtoStu_1]
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}'<$OUTPUT(A3)>' Refused your Mentor Request.\
<Close/@exit>

[@_ShowtoStu_2]
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}'<$OUTPUT(A3)>' do not do the Mentors Level.\
<Close/@exit>

[@_ShowtoStu_3]
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}'<$OUTPUT(A3)>' Is still someone eles Mentor.\
<Close/@exit>

[@_ShowtoStu_4]
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}Congratulations! \
Successfully recieved '<$OUTPUT(A3)>' as your Mentor.\
<Close/@exit>


;;======================================================================

[@ʦ]
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}Are you sure make disciples out of the division of your door?\\
<Accept/@ʦ1>  <Cancel/@exit>

[@ʦ1]
#IF
EQUAL USERSTFLAG 1
#ELSEACT
break
#ELSESAY
{FCOLOR/2}You do not have a student.\
<Return/@back>

#IF
checkcmd ISONLINE %USERSTNAME
#ACT
actcmd SETSTFLAG 0 %USERNAME %USERSTNAME
actcmd RUNSCRIPTLABEL %USERSTNAME "@_ʦ"  ;;ߵʾ
#ELSEACT
actcmd SETSTFLAG 3 %USERNAME %USERSTNAME   ;;趨Ϊ3

#IF
#act
actcmd SETSTFLAG 0 ""
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}You have kicked your student from Mentorship.\
<Close/@exit>

[@_ʦ]
#IF
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}Your Mentor <$USERSTNAME> has been removed from training you.\\
<Close/@exit>
#IF
#ACT
actcmd SETSTFLAG 0 ""

;;======================================================================
[@ʦ]
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}Are you sure you want to leave your Mentor?\\
<Accept/@ʦ1>  <Cancel/@exit>

[@ʦ1]
#if 
EQUAL USERSTFLAG 2
#ELSEACT
break
#ELSESAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}You have not got a Mentor.\
<Return/@back>

#IF
checkcmd ISONLINE %USERSTNAME
#ACT
actcmd SETSTFLAG 0 %USERNAME %USERSTNAME
actcmd RUNSCRIPTLABEL %USERSTNAME "@_ʦ"

#IF
#act
actcmd SETSTFLAG 0 ""
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}You have left your Mentor.\
<Close/@exit>


[@_ʦ]
#IF
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
Your Student <$USERSTNAME> has left you.\\
<Close/@exit>
#IF
#ACT
actcmd SETSTFLAG 0 ""

;;======================================================================
[@ʦϵ]
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}Are you sure you want to remove your mentoring with '<$USERSTNAME>'?\\
<Accept/@ʦϵ1>  <Cancel/@exit>

[@ʦϵ1]
#IF
EQUAL USERSTFLAG 6
#ACT
mov A0 %USERSTNAME

#ELSEACT
break
#ELSESAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}You do not have a mentor.\
<Close/@main>

#IF
checkcmd ISONLINE %USERSTNAME
#ACT
actcmd SETSTFLAG 0 %USERNAME %USERSTNAME
actcmd RUNSCRIPTLABEL %USERSTNAME "@_ʦʦ"
#ELSEACT
actcmd SETSTFLAG 10 %USERNAME %USERSTNAME

#IF
#act
actcmd SETSTFLAG 0 ""
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}Are you sure you want to remove your mentoring with '<$OUTPUT(A0)>'?\
<Close/@exit>

[@_ʦʦ]
#IF
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}Your Master <$USERSTNAME> removed the mentoring system.\\
<Close/@exit>

#IF
#ACT
actcmd SETSTFLAG 0 ""

;;======================================================================
[@ͽܽϵ]
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}Are you sure you want to remove '<$USERSTNAME>' from mentoring?\\
<Accept/@ͽܽϵ1>  <Cancel/@exit>

[@ͽܽϵ1]
#IF
EQUAL USERSTFLAG 7
#ACT
mov A0 %USERSTNAME

#ELSEACT
break
#ELSESAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}You are not the mentor...\
<return/@back>

#IF
checkcmd ISONLINE %USERSTNAME
#ACT
actcmd SETSTFLAG 0 %USERNAME %USERSTNAME
actcmd RUNSCRIPTLABEL %USERSTNAME "@_ͽܽʦ"

#IF
!checkcmd ISONLINE %USERSTNAME
checkcmd CHECKSTFLAG 6 %USERNAME %USERSTNAME 
#ACT
actcmd SETSTFLAG 9 %USERNAME %USERSTNAME

#IF
!checkcmd ISONLINE %USERSTNAME
checkcmd CHECKSTFLAG 8 %USERNAME %USERSTNAME 
#ACT
actcmd SETSTFLAG 4 %USERNAME %USERSTNAME

#IF
#act
actcmd SETSTFLAG 0 ""
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}you have removed '<$OUTPUT(A0)>' from the mentoring system.\
<Close/@exit>


[@_ͽܽʦ]
#IF
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}Your student '<$USERSTNAME>'has ended the mentoring with you.\\
<Close/@exit>

#IF
#ACT
actcmd SETSTFLAG 0 ""
;;=====================================================================


[@ʦͽ]
#if
checkgold 100000
#act
take Gold 100000
give MentorToken
#say
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}You purchased a mentoring token.\
<Close/@exit>
#elsesay
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Functions{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
{FCOLOR/2}You do not have enough Gold.\
<Close/@exit>
}