;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[@ConvertRootinBook]
{
#DEFINE A0{BOOKNAME} A0
#DEFINE A1{CONVERTBOOKNAME} A1
#DEFINE S0{BOOKLEVEL} S0

#IF
#ACT
Mov A0{BOOKNAME} ""
Mov A1{CONVERTBOOKNAME} ""
Mov S0{BOOKLEVEL} 0
Mov D0{BOOKPRICE} 0

#IF
#ACT
Mov A0{BOOKNAME} %ARG(1)
AddStr A1{CONVERTBOOKNAME} %A0
AddStr A1{CONVERTBOOKNAME} "£¨ÃØ¼®£©"
Mov S0{BOOKLEVEL} %ARG(2)
Mov P1 %S0{BOOKLEVEL}
Mov P2 100
Mul P1 P2
Mov D0{BOOKPRICE} %P9
goto @ConvertRootinBook_Step1

[@ConvertRootinBook_Step1]

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\System\BookConvertRootin.txt] @Convert_BookConvertRootin_0

[@ConvertRootinBook_Step2]
#IF
checkitem %A0{BOOKNAME} 1
#ACT
goto @ConvertRootinBook_Step3

#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\System\BookConvertRootin.txt] @Convert_BookConvertRootin_1

[@ConvertRootinBook_Step3]
#IF
checkgold %D0{BOOKPRICE}
checkitem %A0{BOOKNAME} 1
#ACT
goto @ConvertRootinBook_Step4

#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\System\BookConvertRootin.txt] @Convert_BookConvertRootin_2

[@ConvertRootinBook_Step4]
#IF
checkitem %A0{BOOKNAME} 1
Random 3
#ACT
take %A0{BOOKNAME} 1
#ELSEACT
take %A0{BOOKNAME} 1
take ½ð±Ò %D0{BOOKPRICE}
give %A1{CONVERTBOOKNAME} 1

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\System\BookConvertRootin.txt] @Convert_BookConvertRootin_3


#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\System\BookConvertRootin.txt] @Convert_BookConvertRootin_4

}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;