;;Ҫɾ

[@AddPrefix]
{
#SAY
To add a prefix to an item you must use another\ 
character on the same account as the one wearing \
the items you wish to add a prefix to.\\
<Input Character Name That Is Wearing The Items/@@Engravesthenamecharacter>\
<Leave/@exit>

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

[@@Engravesthenamecharacter]
#ACT

mov  A0  %INPUTSTR
#IF

equal A0 %USERNAME
#SAY
{FCOLOR/1}You must use your other character to add a \
prefix to this characters items! {FCOLOR/12} \\
<Leave/@exit>
#ACT
break
#IF
#ACT

FormatStr "FLD_CHARACTER='%s'" %A0

ReadValueSql  "TBL_CHARACTER"  %A9  "FLD_CHARACTER,FLD_USERID"  [@Samenumberinspection]

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

[@Samenumberinspection()]
#IF
#ACT
mov A1 %ARG(1)   
mov A2 %ARG(2)   
#IF
equal A1 %A0
equal A2 %USERID    
#SAY
{FCOLOR/10}Select the item that you want to add a Prefix to:{FCOLOR/12}\\
<Weapon/@Engraves(1,Weapon)>\
<Helmet/@Engraves(4,Helmet)>\
<Necklace/@Engraves(3,Necklace)>\
<Clothes/@Engraves(0,Clothes)>\
<Shoes/@Engraves(10,Shoe)>\
<Left Bracelet/@Engraves(5,Bracelet(Right))>\
<Right Bracelet/@Engraves(6,Bracelet(Left))>\
<Left Ring/@Engraves(7,Ring(Left))>\
<Right Ring/@Engraves(8,Ring(Right))>\\
<Leave/@exit>\
#ELSESAY
{FCOLOR/1}This character is not on the same account as <$USERNAME>! {FCOLOR/12} \\
<Leave/@exit>\

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

[@Engraves()]
#ACT
Mov D0 %ARG(1)
Mov A3 %ARG(2)
Delaygoto [local] 5 @Carriesonthecocoa

#SAY
{FCOLOR/10}Please Wait...{FCOLOR/12} \

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

[@Carriesonthecocoa]
#ACT

FormatStr "FLD_CHARACTER='%s' AND FLD_TYPE='%s'" %A1 %D0

ReadValueSql  "TBL_ITEM"  %A9 "FLD_CHARACTER,FLD_TYPE,FLD_NAMEPREFIX"  [@Equipmenttypeexamination]

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

[@Equipmenttypeexamination()]
#ACT

mov A4 %ARG(1)

mov D9 %ARG(2)

mov A8 %ARG(3)

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

#IF
equal A4 ""
#SAY
{FCOLOR/1} <$OUTPUT(A1)> is not wearing a <$OUTPUT(A3)>! {FCOLOR/12} \\
<Leave/@exit>

#ACT

break

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


#IF
equal A8 "marriagering"

#SAY
{FCOLOR/1} the marriage ring may not engrave the name! {FCOLOR/12} \\
<Leave/@exit>

#ACT

break

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

#IF
#SAY
{FCOLOR/10}Please Input the Prefix that you want to add to your: <$OUTPUT(A3)>: {FCOLOR/12} \\
<Please Input the Prefix/@@Newname>

#ACT

break

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

[@@Newname]
#ACT

mov  A0  %INPUTSTR
#IF

equal A0 "marriagering"
#SAY
{FCOLOR/10} You can not name an item "marriagering"! {FCOLOR/12} \\
<Leave/@exit>
#ACT
break

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

#IF

equal A0 ""
#SAY
{FCOLOR/10}Spaces are not allowed in the prefix! {FCOLOR/12} \\
<Leave/@exit>
#ACT
break

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

#IF
#SAY
The prefix that you have chosn for {FCOLOR/10}<$OUTPUT(A3)>{FCOLOR/12} is:\
{FCOLOR/10}<$OUTPUT(A0)>{FCOLOR/12}\\
Please confirm this is correct:\
<Yes this is correct/@This>\
<No Please let me change it/@@Newname>
<Leave/@exit>\
#ACT
break

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

[@This]
#ACT
Delaygoto [local] 5 @This1
#SAY
{FCOLOR/10}Please Wait...{FCOLOR/12}\

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

[@This1]
#ACT
FormatStr "FLD_USERID='%s'" %USERID
ReadValueSql  "TBL_RELATPOINT"  %A9  "FLD_POINT,FLD_USERID"  [@Engravesthefamousspotexamination]

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

[@Engravesthefamousspotexamination()]
#ACT
mov D1 %ARG(1)
mov A4 %ARG(2)

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

;#IF
;Equal  A4   ""       
;#ACT
;goto @Integralinquiry
;break
;#IF
;elarge D1 5
;#ACT
;FormatStr "FLD_USERID='%s'" %USERID

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


mov   A6       %A9

DEC   D1       5

mov   D8       %D1

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


;FormatStr "FLD_POINT='%s'" %D8

;UPDATEVALUESQL "TBL_RELATPOINT" %A6 %A9

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


FormatStr "FLD_CHARACTER='%s' AND FLD_TYPE='%s'" %A1 %D0

ReadValueSql  "TBL_ITEM"  %A9 "FLD_CHARACTER,FLD_TYPE,FLD_NAMEPREFIX"  [@Onthisname]

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

[@Onthisname()]

#ACT

FormatStr "FLD_CHARACTER='%s' AND FLD_TYPE='%s'" %A1 %D0

mov   A6       %A9

FormatStr "FLD_NAMEPREFIX='%s'" %A0

UPDATEVALUESQL "TBL_ITEM" %A6 %A9
#SAY
Prefix Engrave Complete:\\
Your other characters {FCOLOR/10}<$OUTPUT(A3)>{FCOLOR/12} \
was engraved with {FCOLOR/10}<$OUTPUT(A0)>{FCOLOR/12}\\
<Leave/@exit>
}

;;Ҫɾ
