[@master2]
{



#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
#SAY
________________{FCOLOR/1}[{FCOLOR/12} {FCOLOR/14}Mentor Features{FCOLOR/12} {FCOLOR/1}]{FCOLOR/12} \\
 <[Get Mentor]/@@GETTEACHER>\\

#IF
EQUAL USERSTFLAG 1
#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
#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>
}