;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[@Ma31]
{
#IF
check [390] 0
#ACT
breaktimerecall
#SAY
Welcome to the Room of Death!!!!!! Survive 1 Minute...\
Enter at your Peril!!!!\
<[ Lets Try ]/@Ma31_game>\
#ELSEACT
goto @Ma31_race

[@Ma31_game]
#IF
#ACT
set [390] 1
TimeRecall 1
map D1702_042

[@Ma31_race]
#IF
checkitem GambleChip 1
#ACT
set [390] 0
take GambleChip 1
movr d0 6
inc d0 1
playdice 1 @Ma31_cube
#SAY
Rolls the Dice...\\
#ELSEACT
Map 10_000

[@Ma31_cube]
#IF
equal d0 1 
#ACT
mapmove D1701_032 10 16
break

#IF
equal d0 2 
#ACT
mapmove D1701_033 10 16
break

#IF
equal d0 3 
#ACT
mapmove D1701_034 10 16
break

#IF
equal d0 4 
#ACT
mapmove D1701_035 10 16
break

#IF
equal d0 5
#ACT
mapmove D1701_036 10 16
break

#IF
equal d0 6 
#ACT
mapmove D1701_037 10 16
break
}

[@Ma32]
{
#IF
check [390] 0
#ACT
breaktimerecall
#SAY
Welcome to the Room of Rush...  Survive 3 Minutes...\
<[ Lets Try ]/@Ma32_game>\
#ELSEACT
goto @Ma32_race

[@Ma32_game]
#IF
#ACT
set [390] 1
TimeRecall 3
map D1702_032

[@Ma32_race]
#IF
checkitem GambleChip 1
#ACT
set [390] 0
take GambleChip 1
movr d0 6
inc d0 1
playdice 1 @Ma32_cube
#SAY
Rolls the Dice...\\
#ELSEACT
Map 10_000

[@Ma32_cube]
#IF
equal d0 1 
#ACT
mapmove D1701_033 10 16
break

#IF
equal d0 2 
#ACT
mapmove D1701_034 10 16
break

#IF
equal d0 3 
#ACT
mapmove D1701_035 10 16
break

#IF
equal d0 4 
#ACT
mapmove D1701_036 10 16
break

#IF
equal d0 5
#ACT
mapmove D1701_037 10 16
break

#IF
equal d0 6 
#ACT
mapmove D1701_038 10 16
break
}

[@Ma33]
{
#IF
#ACT
breaktimerecall
#SAY
Welcome to the Room of the Wind.\
Roll a 4 or below and move back 10 Rooms!\
Roll a 5 or 6 and move back that number\
of rooms\\
<[ Shake the dice ]/@Ma33_cube>\

#ELSEACT
Map 10_000

[@Ma33_cube]
#IF
checkitem GambleChip 1
#ACT
movr d0 6
inc d0 1
playdice 1 @Ma33_move
#SAY
Rolls the Dice...\\
#ELSEACT
Map 10_000

[@Ma33_move]
#IF
small d0 5
#ACT
mapmove D1701_023 10 16
#ELSEACT
goto @Ma33_cubemove

[@Ma33_cubemove]
#IF
equal d0 5 
#ACT
mapmove D1701_028 10 16
break

#IF
equal d0 6 
#ACT
mapmove D1701_027 10 16
break
}

[@Ma34]
{
#ACT
breaktimerecall
#SAY
Welcome to the Room of Patience.\
Roll 3 Die, the total must be greater than 16!\
You get 3 attempt's per Chip\\
<[ Lets go ]/@Ma34_game>\

[@Ma34_game]
#IF
checkitem GambleChip 1
#SAY
Thanks for the chip, you have 3 attempts\
<[ Roll Em! ]/@Ma34_dicestart>\

#ACT
take GambleChip 1
mov n1 0
#ELSEACT
Map 10_000

[@Ma34_dicestart]
#IF
small n1 3
#ACT
movr d0 6
inc d0 1
movr d1 6
inc d1 1
movr d2 6
inc d2 1
inc n1 1
sum d0 d1
sum p9 d2
mov d9 %p9
playdice 3 @Ma34_result
#SAY
Rolls the Dice...\\
#ELSEACT
goto @Ma34_game

[@Ma34_result]
#IF
large d9 16
#ACT
goto @Ma34_pre_cube
#ELSEACT
goto @Ma34_dicestart

[@Ma34_pre_cube]
#IF
checkitem GambleChip 1
#ACT
take GambleChip 1
movr d0 6
inc d0 1
playdice 1 @Ma34_cube
#SAY
Rolls the Dice...\\
#ELSEACT
Map 10_000

[@Ma34_cube]
#IF
equal d0 1 
#ACT
mapmove D1701_035 10 16
break

#IF
equal d0 2 
#ACT
mapmove D1701_036 10 16
break

#IF
equal d0 3 
#ACT
mapmove D1701_037 10 16
break

#IF
equal d0 4 
#ACT
mapmove D1701_038 10 16
break

#IF
equal d0 5
#ACT
mapmove D1701_039 10 16
break

#IF
equal d0 6 
#ACT
mapmove D1701_040 10 16
break
}

[@Ma35]
{
#ACT
breaktimerecall
movr d0 3
#SAY
Welcome to my room. This room is a migration trap\\
<[ Hmm.. where will I go? ]/@Ma35_game>\

[@Ma35_game]
#IF
equal d0 0
#ACT
give GambleChip 1
mapmove D1701_034 10 16
break

#IF
equal d0 1
#ACT
give GambleChip 2
mapmove D1701_033 10 16
break

#IF
equal d0 2
#ACT
give GambleChip 3
mapmove D1701_032 10 16
break
}

[@Ma36]
{
#ACT
breaktimerecall
#SAY
Welcome to the Friendship room.  You cannot leave this room\
until there are 2 people in here.\
<[ I give up - Send me back to the Town]/@SendtoLobby>\
<[ 2 People here! ]/@Ma36_game>\

[@Ma36_game]
#IF
checkhum D1701_036 2
#ACT
goto @Ma36_pre_cube
#ELSESAY
Sorry, still not enough people\\
<[ I give up - Send me back to the Town ]/@SendtoLobby>\
<[ Exit ]/@exit>\

[@SendtoLobby]
#ACT
Map 10_000
break


[@Ma36_pre_cube]
#IF
checkitem GambleChip 1
#ACT
take GambleChip 1
movr d0 6
inc d0 1
playdice 1 @Ma36_cube
#SAY
Rolls the Dice...\\
#ELSEACT
Map 10_000

[@Ma36_cube]
#IF
equal d0 1 
#ACT
mapmove D1701_037 10 16
break

#IF
equal d0 2 
#ACT
mapmove D1701_038 10 16
break

#IF
equal d0 3 
#ACT
mapmove D1701_039 10 16
break

#IF
equal d0 4 
#ACT
mapmove D1701_040 10 16
break

#IF
equal d0 5
#ACT
mapmove D1701_001 10 16
break

#IF
equal d0 6 
#ACT
mapmove D1701_002 10 16
break
}

[@Ma37]
{
#IF
#ACT
breaktimerecall
movr d0 4
#SAY
Welcome to the Lucky Room, shall we find the result?\
<[ OK then.. ]/@Ma37_game>\

[@Ma37_game]
#IF
equal d0 0
#ACT
take GambleChip 6
goto @Ma37_race
break

#IF
equal d0 1
#ACT
give GambleChip 6
goto @Ma37_race
break

#IF
equal d0 2
#ACT
take GambleChip 9
goto @Ma37_race
break

#IF
equal d0 3
#ACT
Give Gold 250000
goto @Ma37_race
break

[@Ma37_race]
#IF
checkitem GambleChip 1
#ACT
take GambleChip 1
movr d0 6
inc d0 1
playdice 1 @Ma37_cube
#SAY
Rolls the Dice...\\
#ELSEACT
Map 10_000

[@Ma37_cube]
#IF
equal d0 1 
#ACT
mapmove D1701_038 10 16
break

#IF
equal d0 2 
#ACT
mapmove D1701_039 10 16
break

#IF
equal d0 3 
#ACT
mapmove D1701_040 10 16
break

#IF
equal d0 4 
#ACT
mapmove D1701_001 10 16
break

#IF
equal d0 5
#ACT
mapmove D1701_002 10 16
break

#IF
equal d0 6 
#ACT
mapmove D1701_003 10 16
break
}

[@Ma38]
{
#ACT
breaktimerecall
#SAY
Welcome to the Room of the Wind, from here we move backwards\
<[ Shake the dice ]/@Ma38_pre_cube>\

[@Ma38_pre_cube]
#IF
checkitem GambleChip 1
#ACT
take GambleChip 1
movr d0 6
inc d0 1
playdice 1 @Ma38_cube
#SAY
Rolls the Dice...\\
#ELSEACT
Map 10_000

[@Ma38_cube]
#IF
equal d0 1 
#ACT
mapmove D1701_037 10 16
break

#IF
equal d0 2 
#ACT
mapmove D1701_036 10 16
break

#IF
equal d0 3 
#ACT
mapmove D1701_035 10 16
break

#IF
equal d0 4 
#ACT
mapmove D1701_034 10 16
break

#IF
equal d0 5
#ACT
mapmove D1701_033 10 16
break

#IF
equal d0 6 
#ACT
mapmove D1701_032 10 16
break
}

[@Ma39]
{
#IF
check [390] 0
#ACT
breaktimerecall
#SAY
Welcome to the Room of Trial.. Survive for 3 Minutes\\
<[ I can.. and will.. ]/@Ma39_game>\
#ELSEACT
goto @Ma39_race

[@Ma39_game]
#IF
#ACT
set [390] 1
TimeRecall 3
mapmove D1702_041 18 25

[@Ma39_race]
#IF
checkitem GambleChip 1
#ACT
set [390] 0
take GambleChip 1
movr d0 6
inc d0 1
playdice 1 @Ma39_cube
#SAY
Rolls the Dice...\\
#ELSEACT
Map 10_000

[@Ma39_cube]
#IF
equal d0 1 
#ACT
mapmove D1701_040 10 16
break

#IF
equal d0 2 
#ACT
mapmove D1701_001 10 16
break

#IF
equal d0 3 
#ACT
mapmove D1701_002 10 16
break

#IF
equal d0 4 
#ACT
mapmove D1701_003 10 16
break

#IF
equal d0 5
#ACT
mapmove D1701_004 10 16
break

#IF
equal d0 6 
#ACT
mapmove D1701_005 10 16
break
}

[@Ma40]
{
#ACT
breaktimerecall
#SAY
Welcome to the Room of Success!!!  You made it!!!!\
Now.. what would you like?\\
<[ StingsTransparentRing(Gamble) ]/@GiveGift(StingsTransparentRing(Gamble))> - 2 Days\
<[ StingsParalysisRing(Gamble) ]/@GiveGift(StingsParalysisRing(Gamble))> - 2 Days\
<[ StingsProtectionRing(Gamble) ]/@GiveGift(StingsProtectionRing(Gamble))> - 2 Days\
<[ StingsMuscularRing(Gamble) ]/@GiveGift(StingsMuscularRing(Gamble))> - 2 Days\
<[ StingsSkillNecklace(Gamble) ]/@GiveGift(StingsSkillNecklace(Gamble))> - 2 Days\
<[ StingsEdgeShadeDemon(Gamble) ]/@GiveGift(StingsEdgeShadeDemon(Gamble))> - 2 Days\
<[ StingsGambleArmour(Gamble)(M) ]/@GiveGift(StingsGambleArmour(Gamble)(M))> - 2 Days\
<[ StingsGambleArmour(Gamble)(F) ]/@GiveGift(StingsGambleArmour(Gamble)(F))> - 2 Days\
<[ 1000 Integral ]/@GiveGift(Integral(500))>\
<[ Benediction ]/@GiveGift(Benediction)>\
<[ RevivalWater ]/@GiveGift(RevivalWater)>\
<[ RefineStone ]/@GiveGift(RefineStone)>\

[@GiveGift()]
#ACT
MOV  A1  %ARG(1)
AddStr  A7 %USERNAME
AddStr  A7 ","
AddStr  A7 %A1
AddStr  A7 ",Mabangjin"
Savelog "QuestDiary\Mabangjin\MabangjinLog.txt" %A7

#IF
Equal A1 "Integral(500)"
#ACT
Give Integral(500) 2
#ELSEACT
Give  %A1  1
#IF
#ACT
EventMsg [grobal] "The Casino Maze has been beaton by <$USERNAME>"

Map 10_000
}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;