; ===================================
; Market Def NPC File : 8Ega-B111
; Patientroom
; -----------------------------------
; Name: GambleWoman
; Job: 
; Map No: B111
; Pos X 10
; Pos Y 6
; File name: *removed*
; Comment: Patientroom

;================================================= =
;

[@main]
#IF
equal p9 0
#ACT
goto @main-1
BreakTimeRecall 
break

#IF
equal p9 1
#ACT
goto @main-3
BreakTimeRecall 
break

#IF
equal p9 2
#ACT
goto @next2
BreakTimeRecall 
break

#IF
equal p9 3
#ACT
goto @cube
BreakTimeRecall 
break

#IF
equal p9 9
#ACT
goto @quit
BreakTimeRecall 
break

[@main-1]
#IF
#ACT
mov p9 0
#SAY
Hello <$USERNAME>.\
Welcome to Room 13. Here you must be patient\
You may role 3 which must total 13 or more\
You will get 5 goes per chip\
You must win to conitue\\
<Continue/@main-2>

[@Quit]
#IF
#ACT
map B011

[@main-2]
#IF
checkitem gamblechip 1
#ACT
take gamblechip 1
mov p2 0
mov p9 1
goto @main-3
#ELSESAY
<$USERNAME>, you haven't any chips!\
Go get some if you want to gamble\ \
<Silly Me/@Quit>
#ELSEACT
mov p9 9

[@main-3]
Ok, Role the dice\ \
<Role/@dicestart>

[@dicestart]
#IF
small p2 5
#ACT
mov p9 2
movr d0 6
movr d1 6
movr d2 6
inc d0 1
inc d1 1
inc d2 1
inc p2 1
playdice 3 @next
#SAY
Coninue...\
<Yeah!/@next>
#ELSEACT
goto @main-2

[@next]
#IF
#ACT
mov d9 0
sum d0 d1
sum d2
goto @next1

[@next1]
#IF
large d9 13
#SAY
You roled <$STR(P2)>
YOu win, well done\
Now you can role the dice to continue\ \
<OK/@pre_cube>
#ELSESAY
You roled <$STR(P2)>
Haha, you loose\
Try Again\\
<Bah/@dicestart>

[@pre_cube]
#IF
checkitem gamblechip 1
#ACT
take gamblechip 1
mov p9 3
movr d0 6
inc d0 1
playdice 1 @cube
#SAY
Continue\ \
<Ok/@cube>
#ELSESAY
<$USERNAME>, you haven't got any chips!\
Go get some if you want to gamble\ \
<Silly Me/@Quit>
#ELSEACT
mov p9 9

[@cube]
Hey, you roled a <$STR(D0)>\
You can now move <$STR(D0)> rooms forward.\ \
<Sweet, lets move!/@next_cube>

[@next_cube]
#IF
equal d0 1 
#ACT
goto @posi1
break

#IF
equal d0 2 
#ACT
goto @posi2
break

#IF
equal d0 3 
#ACT
goto @posi3
break

#IF
equal d0 4 
#ACT
goto @posi4
break

#IF
equal d0 5
#ACT
goto @posi5
break

#IF
equal d0 6 
#ACT
goto @posi6
break

[@back]
#IF
#ACT
batchDelay 1
addbatch B110
addbatch B109
addbatch B108
addbatch B107
batchmove

[@forward]
#IF
#ACT
batchDelay 1
addbatch B112
addbatch B113
addbatch B114
batchmove

[@Posi1]
#IF
#ACT
batchDelay 1
addbatch B112
batchmove

[@Posi2]
#IF
#ACT
batchDelay 1
addbatch B112
addbatch B113
batchmove

[@Posi3]
#IF
#ACT
batchDelay 1
addbatch B112
addbatch B113
addbatch B114
batchmove

[@Posi4]
#IF
#ACT
batchDelay 1
addbatch B112
addbatch B113
addbatch B114
addbatch B115
batchmove

[@Posi5]
#IF
#ACT
batchDelay 1
addbatch B112
addbatch B113
addbatch B114
addbatch B115
addbatch B116
batchmove

[@Posi6]
#IF
#ACT
batchDelay 1
addbatch B112
addbatch B113
addbatch B114
addbatch B115
addbatch B116
addbatch B117
batchmove


