;NPC Release 1 (2003) By Geoff
;99% Translated NPCs Including Quests

[@main]
#IF
#SAY
Welcome to the Bichon Wall game market.\
What would you like to do?\ \
<Play the game/@play_dice>\
<Not play/@exit>\
#ACT
mov p2 0

[@play_dice]
#IF
#SAY
<$USERNAME> to gamble you need at least 3000 gold\
It costs 1000 gold to play and 2000 gold minimum bet\
to a maximum of 100000 gold.\ \
<I have 3000 gold or more/@event1>\
<I'd rather not play/@exit>


[@event1]
#IF
#ACT
mov p2 1
goto @play_dice1

[@play_dice1]
#IF
checkgold 3000
#ACT
take gold 1000
#SAY
How much would you like to bet?\ \
<2000 gold/@M2000>\
<5000 gold/@M5000>\
<10000 gold/@M10000>\
<20000 gold/@M20000>\
<50000 gold/@M50000>\
<100000 gold/@M100000>\
#ELSESAY
You don't have enough cash to play.\ \
<Ok/@exit>

[@M2000]
#IF
checkgold 2000
#SAY
You have bet 2000 gold\ \
 
<Roll the dice/@play_dice2>
#ACT
take gold 2000
mov p0 0
#ELSESAY
You need 2000 gold to bet\ \
<Rules/@play_dice>

[@M5000]
#IF
checkgold 5000
#SAY
You have bet 5000 gold\ \ 

<Roll the dice/@play_dice2>
#ACT
take gold 5000
mov p0 1
#ELSESAY
You need 5000 gold to bet\ \
<Rules/@play_dice>


[@M10000]
#IF
checkgold 10000
#SAY
You have bet 10000 gold\ \ 

<Roll the dice/@play_dice2>
#ACT
take gold 10000
mov p0 2
#ELSESAY
You need 10000 gold to bet\ \
<Rules/@play_dice>

[@M20000]
#IF
checkgold 20000
#SAY
You have bet 20000 gold\ \ 

<Roll the dice/@play_dice2>
#ACT
take gold 20000
mov p0 3
#ELSESAY
You need 20000 gold to bet\ \
<Rules/@play_dice>

[@M50000]
#IF
checkgold 50000
#SAY
You have bet 50000 gold\ \ 

<Roll the dice/@play_dice2>
#ACT
take gold 50000
mov p0 4
#ELSESAY
You need 50000 gold to bet\ \ 
<Rules/@play_dice>

[@M100000]
#IF
checkgold 100000
#SAY
You have bet 100000 gold\ \ 

<Roll the dice/@play_dice2>
#ACT
take gold 100000
mov p0 5
#ELSESAY
You need 100000 gold to bet\ \
<Rules/@play_dice>

[@play_dice2]
#IF
#ACT
movr d0 6
movr d1 6
movr d2 6
inc d0 1
inc d1 1
inc d2 1
mov d9 0
sum d0 d1
sum d2
playdice 3 @check_event

[@check_event]
#IF
equal p2 1
#ACT
goto @event_next
#ELSEACT
goto @check_gold

[@event_next]
#IF
check d0 9
check d1 9
check d2 9
#ACT
goto @event_result
#ELSEACT
goto @check_gold

[@check_gold]
#IF
large d9 9
#ACT
dec d9 10
goto @play_dice3
#ELSEACT
goto @play_dice3

[@play_dice3]
#IF
equal d9 0
#ACT
mov p1 0
goto @check_message
break

#IF
equal d9 1
#ACT
mov p1 1
goto @check_message
break

#IF
equal d9 2
#ACT
mov p1 2
goto @check_message
break

#IF
equal d9 3
#ACT
mov p1 3
goto @check_message
break

#IF
equal d9 4
#ACT
mov p1 4
goto @check_message
break

#IF
equal d9 5
#ACT
mov p1 5
goto @check_message
break

#IF
equal d9 6
#ACT
mov p1 6
goto @check_message
break

#IF
equal d9 7
#ACT
mov p1 7
goto @check_message
break

#IF
equal d9 8
#ACT
mov p1 8
goto @check_message
break

#IF
equal d9 9
#ACT
mov p1 9
goto @check_message
break

[@check_message]
#IF
#SAY
You score is <$STR(P1)>\ \
<Roll again/@play_dice4>

[@play_dice4]
#IF
#SAY
My turn. \ \
#ACT
movr d0 6
movr d1 6
movr d2 6
inc d0 1
inc d1 1
inc d2 1
mov d9 0
sum d0 d1
sum d2
playdice 3 @play_dice5

[@play_dice5]
#IF
large d9 9
#ACT
dec d9 10
goto @play_dice6
#ELSEACT
goto @play_dice6

[@play_dice6]
#IF
equal d9 0
#ACT
goto @result0
break

#IF
equal d9 1
#ACT
goto @result1
break

#IF
equal d9 2
#ACT
goto @result2
break

#IF
equal d9 3
#ACT
goto @result3
break

#IF
equal d9 4
#ACT
goto @result4
break

#IF
equal d9 5
#ACT
goto @result5
break

#IF
equal d9 6
#ACT
goto @result6
break

#IF
equal d9 7
#ACT
goto @result7
break

#IF
equal d9 8
#ACT
goto @result8
break

#IF
equal d9 9
#ACT
goto @result9
break

[@result0]
#IF
equal p0 0
#ACT
goto @draw
break

#IF
large p0 0
#ACT
goto @win 
#ELSEACT
goto @defeat

[@result1]
#IF
equal p1 1
#ACT
goto @draw
break

#IF
large p1 1
#ACT
goto @win 
#ELSEACT
goto @defeat

[@result2]
#IF
equal p1 2
#ACT
goto @draw
break

#IF
large p1 2
#ACT
goto @win 
#ELSEACT
goto @defeat

[@result3]
#IF
equal p1 3
#ACT
goto @draw
break

#IF
large p1 3
#ACT
goto @win 
#ELSEACT
goto @defeat

[@result4]
#IF
equal p1 4
#ACT
goto @draw
break

#IF
large p1 4
#ACT
goto @win 
#ELSEACT
goto @defeat

[@result5]
#IF
equal p1 5
#ACT
goto @draw
break

#IF
large p1 5
#ACT
goto @win 
#ELSEACT
goto @defeat

[@result6]
#IF
equal p1 6
#ACT
goto @draw
break

#IF
large p1 6
#ACT
goto @win 
#ELSEACT
goto @defeat

[@result7]
#IF
equal p1 7
#ACT
goto @draw
break

#IF
large p1 7
#ACT
goto @win 
#ELSEACT
goto @defeat

[@result8]
#IF
equal p1 8
#ACT
goto @draw
break

#IF
large p1 8
#ACT
goto @win 
#ELSEACT
goto @defeat

[@result9]
#IF
equal p1 9
#ACT
goto @draw
break

#IF
large p1 9
#ACT
goto @win 
#ELSEACT
goto @defeat

[@draw]
#IF
equal p0 0
#ACT
give gold 2000
break
#SAY
You got <$STR(P1)>, and I scored <$STR(D9)>. \
It's a draw you win 2000 gold. \ \
<Play Again/@play_dice> \
<Exit./@exit>

#IF
equal p0 1
#ACT
give gold 5000
break
#SAY
You got <$STR(P1)>, and I scored <$STR(D9)>. \
It's a draw you win 5000 gold. \ \ 
<Play again./@play_dice> \
<Exit./@exit>

#IF
equal p0 2
#ACT
give gold 10000
break
#SAY
You got <$STR(P1)>, and I scored  <$STR(D9)>. \
It's a draw you win 10000 gold. \ \
<Play again/@play_dice> \
<Exit/@exit>

#IF
equal p0 3
#ACT
give gold 20000
break
#SAY
You got <$STR(P1)>, and I scored <$STR(D9)> . \
It's a draw you win 20000 gold. \ \ 
<Play again/@play_dice> \
<Exit/@exit>

#IF
equal p0 4
#ACT
give gold 50000
break
#SAY
You got <$STR(P1)>, and I scored <$STR(D9)> . \
It's a draw you win 50000 gold. \ \
<Play again/@play_dice> \
<Exit./@exit>

#IF
equal p0 5
#ACT
give gold 100000
break
#SAY
You got <$STR(P1)>, and I scored <$STR(D9)> . \
It's a draw you win 100000 gold. \ \
<Play Again/@play_dice> \
<Exit/@exit>

[@win]
#IF
equal p0 0
#ACT
goto @win0
break

#IF
equal p0 1
#ACT
goto @win1
break

#IF
equal p0 2
#ACT
goto @win2

#IF
equal p0 3
#ACT
goto @win3

#IF
equal p0 4
#ACT
goto @win4

#IF
equal p0 5
#ACT
goto @win5

[@defeat]
#IF
equal p0 0
#ACT
goto @defeat0
break

#IF
equal p0 1
#ACT
goto @defeat1
break

#IF
equal p0 2
#ACT
goto @defeat2

#IF
equal p0 3
#ACT
goto @defeat3

#IF
equal p0 4
#ACT
goto @defeat4

#IF
equal p0 5
#ACT
goto @defeat5

[@win0]
#IF
equal p1 9
#SAY
You got <$STR(P1)>, And I scored <$STR(D9)>. \
You win 6000 gold. \ \
<Play again./@play_dice> \
<Exit./@exit>
#ACT
give gold 4000
give gold 2000
#ELSESAY
You got <$STR(P1)>, and I scored <$STR(D9)>. \
You win 4000 gold. \ \
<Play again/@play_dice> \
<Exit/@exit>
#ELSEACT
give gold 4000

[@win1]
#IF
equal p1 9
#SAY
You got <$STR(P1)>, And I scored <$STR(D9)>. \
You win 15000 gold. \ \
<Play again./@play_dice> \
<Exit./@exit>
#ACT
give gold 10000
give gold 5000
#ELSESAY
You got <$STR(P1)>, And I scored <$STR(D9)>. \
You win 10000 gold. \ \
<Play again./@play_dice> \
<Exit./@exit>
#ELSEACT
give gold 10000

[@win2]
#IF
equal p1 9
#SAY
You got <$STR(P1)>, And I scored <$STR(D9)>. \
You win 30000 gold. \ \
<Play again./@play_dice> \
<Exit./@exit>
#ACT
give gold 20000
give gold 10000
#ELSESAY
You got <$STR(P1)>, And I scored <$STR(D9)>. \
You win 20000 gold. \ \
<Play again./@play_dice> \
<Exit./@exit>
#ELSEACT
give gold 20000

[@win3]
#IF
equal p1 9
#SAY
You got <$STR(P1)>, And I scored <$STR(D9)>. \
You win 60000 gold. \ \
<Play again./@play_dice> \
<Exit./@exit>
#ACT
give gold 40000
give gold 20000
#ELSESAY
You got <$STR(P1)>, And I scored <$STR(D9)>. \
You win 40000 gold. \ \
<Play again./@play_dice> \
<Exit./@exit>
#ELSEACT
give gold 40000

[@win4]
#IF
equal p1 9
#SAY
You got <$STR(P1)>, And I scored <$STR(D9)>. \
You win 150000 gold. \ \
<Play again./@play_dice> \
<Exit./@exit>
#ACT
give gold 100000
give gold 50000
#ELSESAY
You got <$STR(P1)>, And I scored <$STR(D9)>. \
You win 100000 gold. \ \
<Play again./@play_dice> \
<Exit./@exit>
#ELSEACT
give gold 100000

[@win5]
#IF
equal p1 9
#SAY
You got <$STR(P1)>, And I scored <$STR(D9)>. \
You win 300000 gold. \ \
<Play again./@play_dice> \
<Exit./@exit>
#ACT
give gold 200000
give gold 100000
#ELSESAY
You got <$STR(P1)>, And I scored <$STR(D9)>. \
You win 200000 gold. \ \
<Play again./@play_dice> \
<Exit./@exit>
#ELSEACT
give gold 200000

[@defeat0]
#IF
equal d9 9
#SAY
You loose 2000 gold. \\
<Play again/@play_dice> \
<Exit/@exit>
#ACT
take gold 2000
#ELSESAY
You got <$STR(P1)>, And I scored <$STR(D9)>. \
You loose...\ \
<Play again/@play_dice> \
<Exit/@exit>

[@defeat1]
#IF
equal d9 9
#SAY
You loose 5000 gold. \ \
<Play again/@play_dice> \
<Exit/@exit>
#ACT
take gold 5000
#ELSESAY
You got <$STR(P1)>, And I scored <$STR(D9)>. \
You loose...\ \
<Play again/@play_dice> \
<Exit/@exit>

[@defeat2]
#IF
equal d9 9
#SAY
You loose 10000 gold. \ \
<Play again/@play_dice> \
<Exit/@exit>
#ACT
take gold 10000
#ELSESAY
You got <$STR(P1)>, And I scored <$STR(D9)>. \
You loose...\ \
<Play again/@play_dice> \
<Exit/@exit>

[@defeat3]
#IF
equal d9 9
#SAY
You loose 20000 gold. \ \
<Play again/@play_dice> \
<Exit/@exit>
#ACT
take gold 20000
#ELSESAY
You got <$STR(P1)>, And I scored <$STR(D9)>. \
You loose...\\
<Play again/@play_dice> \
<Exit/@exit>

[@defeat4]
#IF
equal d9 9
#SAY
You loose 50000 gold. \ \
<Play again/@play_dice> \
<Exit/@exit>
#ACT
take gold 50000
#ELSESAY
You got <$STR(P1)>, And I scored <$STR(D9)>. \
You loose...\\
<Play again/@play_dice> \
<Exit/@exit>

[@defeat5]
#IF
equal d9 9
#SAY
You loose 100000 gold. \ \
<Play again/@play_dice> \
<Exit/@exit>
#ACT
take gold 100000
#ELSESAY
You got <$STR(P1)>, And I scored <$STR(D9)>. \
You loose...\ \
<Play again/@play_dice> \
<Exit/@exit>

[@event_result]
#IF
equal p0 0
#ACT
give gold 10000
break
#SAY
You win 10000 gold. \ \
<Play again/@play_dice> \
<exit/@exit>

#IF
equal p0 1
#ACT
give gold 25000
break
#SAY
You win 25000 gold. \ \
<Play again/@play_dice> \
<exit/@exit>


#IF
equal p0 2
#ACT
give gold 50000
break
#SAY
You win 50000 gold. \ \
<Play again/@play_dice> \
<exit/@exit>


#IF
equal p0 3
#ACT
give gold 100000
break
#SAY
You win 100000 gold. \ \
<Play again/@play_dice> \
<exit/@exit>


#IF
equal p0 4
#ACT
give gold 250000
break
#SAY
You win 250000 gold. \ \
<Play again/@play_dice> \
<exit/@exit>

#IF
equal p0 5
#ACT
give gold 500000
break
#SAY
You win 500000 gold. \ \
<Play again/@play_dice> \
<exit/@exit>
