;;;QQ:67762207====
[@推广员主菜单]
{
#IF
!checkcmd ISTESTSERVER
#ACT
mov 用户检测ID ""
formatstr "where FLD_USERID = '%s'" %USERID
actcmd READSQL "TBL_Promoters" "FLD_USERID" "用户检测ID" %A9
#ELSEACT
break
#ELSESAY
内测暂不开放.\

#IF
EQUAL 用户检测ID ""
#ACT
FormatStr "'%s','','',0" %USERID
mov A8 %A9
FormatStr "FLD_USERID='%s'" %USERID
WriteValueSql "TBL_Promoters" %A9 "FLD_USERID,IntroCDKEY,SelfCDKEY,GetHorse" %A8
formatstr "where FLD_USERID = '%s'" %USERID
actcmd READSQL "TBL_Promoters" "FLD_USERID" "用户检测ID2" %A9

#IF
!EQUAL 用户检测ID2 ""
#SAY
欢迎光临推广大使.\\
在45级以前可以填写推广员给你的CDKEY,一经填写将无法改变\
当您到达75级时就会获得一匹非常好的{FCOLOR/10}绝影马{FCOLOR/12}.<了解决影马/@AboutHorse>\

您同样也可以申请一个CDKEY来发放给朋友,自己来做推广员\
{FCOLOR/14}当填写了您的CDKEY的玩家达到75级的时候就会给您增加30点推广积分.\
当填写了您的CDKEY的玩家购买了积分同样会给您增加与消费金额相同的推广积分.{FCOLOR/12}\
推广积分达到一定数量的时候可以兑换积分,比例如下\
____1000点推广积分可以兑换100个积分卷(1000积分起兑)\
____13000积分以上可以兑换RMB1000元来回报我们辛苦的推广人:)\

<申请CDKEY/@申请CDKEY>\\
<兑换推广积分/@兑换推广积分>\\

#IF
!EQUAL 用户检测ID2 ""
!Checklevel 45
#SAY
<填写CDKEY/@@填写CDKEY>

[@兑换推广积分]
#IF
#ACT
mov 推广员积分 0
formatstr "where FLD_USERID = '%s'" %USERID
actcmd READSQL "TBL_Promoters" "CDKEYPoint" "推广员积分" %A9
#SAY
您当前的推广员积分为<$OUTPUT(推广员积分)>.\\

#IF
ELARGE 推广员积分 1000
#SAY
<输入兑换密码/@@*推广积分换卷>\
注意个为数将忽略不计.\
#ELSESAY
1000积分以下不能兑换.\

[@@*推广积分换卷]
#IF
#ACT
mov 推广员积分 0
mov CDKEY密码 0
mov A0 %INPUTSTR
formatstr "where FLD_USERID = '%s'" %USERID
actcmd READSQL "TBL_Promoters" "CDKEYPoint,SelfCDKEYPass" "推广员积分,CDKEY密码" %A9


#IF
EQUAL CDKEY密码 %A0
#ELSEACT
break
#ELSESAY
对不起，密码错误，请重新输入.\

#IF
ELARGE 推广员积分 1000
#ACT
div 推广员积分 10
mov D0 %P9
give 积分卷 %D0
formatstr "where FLD_USERID = '%s'" %USERID
actcmd WRITESQL "TBL_Promoters" "CDKEYPoint" 0 %A9
#SAY
成功为您兑换了<$OUTPUT(D0)>个积分卷.\
#ELSEACT
break
#ELSESAY
1000积分以下不能兑换.\


[@AboutHorse]
#IF
#SAY
绝影马是一匹绝世神马,能够给您提升超强的属性.\
______{FCOLOR/10}负重+250\
______破坏+25\
______全系列魔法+22\
______体力恢复速度+7{FCOLOR/12}\\
{FCOLOR/14}还犹豫什么？千载难逢的好机会.只要您填写了推广CDKEY.\
在您75级时候马上就可以得到.{FCOLOR/12}\\
<返回/@推广员主菜单>



[@@填写CDKEY]
#IF
#ACT
mov A0 %INPUTSTR
formatstr "where fld_userid = '%s'" %USERID
actcmd READSQL "TBL_Promoters" "IntroCDKEY,SelfCDKEY" "IntroCDKEY,SelfCDKEY" %A9

#IF
EQUAL A0 ""
#ACT
break
#SAY
输入的CDKEY不能为空.\\

#IF
!EQUAL IntroCDKEY ""
#ACT
Sysmsg "<$OUTPUT(IntroCDKEY)> :请点击本行以获取CDKEY并复制"
break
#SAY
您已经填写过CDKEY了,您填写的CDKEY是:\
<$OUTPUT(IntroCDKEY)>\

#IF
EQUAL SelfCDKEY %A0
#ACT
break
#SAY
对不起,不能填写自己的CDKEY


#IF
#ACT
mov 查询CDKEY ""
mov 登陆ID ""
formatstr "where cdkey = '%s'" %A0
actcmd READSQL "TBL_CDKEY" "CDKEY,FLD_loginID" "查询CDKEY,登陆ID" %A9

#IF
!EQUAL 查询CDKEY ""
!EQUAL 登陆ID ""
!EQUAL 登陆ID %USERID
#ACT
FormatStr "'%s'" %A0
mov A8 %A9
FormatStr "where FLD_USERID='%s'" %USERID
actcmd WRITESQL "TBL_Promoters" "IntroCDKEY" %A8 %A9
#SAY
您的CDKEY已经填写好了.\
您输入的CDKEY为'<$OUTPUT(A0)>'\
#ELSEACT
break
#ELSESAY
对不起,您输入的CDKEY不存在.\
请仔细询问您的推荐人.获取CDKEY的详细信息.\\





[@申请CDKEY]

#IF
#ACT
mov selfCDKEY ""
formatstr "where fld_userid = '%s'" %USERID
actcmd READSQL "TBL_Promoters" "selfCDKEY" "selfCDKEY" %A9

#IF
!EQUAL selfCDKEY ""
#ACT
Sysmsg "<$OUTPUT(selfCDKEY)> :请点击本行以获取CDKEY并复制保留"
break
#SAY
您已经有CDKEY了,您当前的CDKEY是:\
<$OUTPUT(selfCDKEY)>\\
可以在游戏聊天窗口复制出CDKEY发放给您的朋友.\




#IF
#ACT
mov CDKEY ""
mov CDPASS ""
actcmd READSQL "TBL_CDKEY" "CDKEY,password" "CDKEY,CDPASS" "WHERE (FLD_LoginID IS NULL) OR (FLD_LoginID = '')"
;;读取没有使用过的CDKEY

#IF
!EQUAL CDKEY ""
#ELSEACT
break
#ELSESAY
CDKEY已经没有库存,请联系GM.\\

#IF
#ACT
formatstr "'%s','%s'" %CDKEY,%CDPASS
mov A8 %A9
formatstr "where fld_userid = '%s'" %USERID
actcmd WRITESQL "TBL_Promoters" "selfCDKEY,SelfCDKEYPASS" %A8 %A9
;;写入自己的数据 CDKEY和Password

formatstr "where CDKEY = '%s'" %CDKEY
mov A8 %A9
formatstr "'%s'" %USERID
actcmd WRITESQL "TBL_CDKEY" "FLD_loginID" %A9 %A8
;;更新CDKEY库,写入自己的ID

Sysmsg "<$OUTPUT(CDKEY)> :请点击本行以获取CDKEY并复制保留"
Sysmsg "<$OUTPUT(CDPASS)> :请点击本行以获取CDKEY密码并复制保留"
#SAY
恭喜您,获得了一个与您终身为伴的CDKEY.\\
您的CDKEY为:<$OUTPUT(CDKEY)>\
CDKEY密码为:<$OUTPUT(CDPASS)>\\
{FCOLOR/1}请牢记该密码,他将作为您在未来领取推广奖励的凭证.\\



[@升级累计]
#IF
checklevel 75
!checklevel 76
#ACT
mov 推广员CDKEY ""
formatstr "where fld_userid = '%s' and IntroCDKEY IS NOT NULL" %USERID
actcmd READSQL "TBL_Promoters" "IntroCDKEY" "推广员CDKEY" %A9
#ELSEACT
break


#IF
!EQUAL 推广员CDKEY ""
#ACT
formatstr "where selfCDKEY = '%s'" %推广员CDKEY
actcmd READSQL "TBL_Promoters" "CDKEYPoint" "推广员积分" %A9
inc 推广员积分 30
formatstr "where selfCDKEY = '%s'" %推广员CDKEY
actcmd WRITESQL "TBL_Promoters" "CDKEYPoint" %推广员积分 %A9
sysmsg "恭喜您达到75级,您的推广人得到了30推广积分的奖励,同时您也可以免费获得一只绝影马.请到马商义贤那里领取吧"

#ELSEACT
break



}
;;;QQ:67762207====
