◆Comment:Variables 41, 42, and 43 are used to store the current gold of the NPCs.
◆Text:None, Window, Bottom
: :Pick the first player!
◆Show Choices:Orc, Elf, Goblin (Window, Right, #1, -)
:When Orc
◆Control Variables:#0031 Gambler ID 1 = 41
◆Control Variables:#0032 Gambler Name 1 = 'Orc'
◆
:When Elf
◆Control Variables:#0031 Gambler ID 1 = 42
◆Control Variables:#0032 Gambler Name 1 = 'Elf'
◆
:When Goblin
◆Control Variables:#0031 Gambler ID 1 = 43
◆Control Variables:#0032 Gambler Name 1 = 'Goblin'
◆
:When Cancel
◆Exit Event Processing
◆
:End
◆Text:None, Window, Bottom
: :Pick the second player!
◆Show Choices:Orc, Elf, Goblin (Window, Right, #1, -)
:When Orc
◆Control Variables:#0035 Gambler ID 2 = 41
◆Control Variables:#0036 Gambler Name 2 = 'Orc'
◆
:When Elf
◆Control Variables:#0035 Gambler ID 2 = 42
◆Control Variables:#0036 Gambler Name 2 = 'Elf'
◆
:When Goblin
◆Control Variables:#0035 Gambler ID 2 = 43
◆Control Variables:#0036 Gambler Name 2 = 'Goblin'
◆
:When Cancel
◆Exit Event Processing
◆
:End
◆If:#0030 = Gambler ID 1
◆Text:None, Window, Bottom
: :\v[32] can't play against themselves... >_>
◆
:Else
◆Control Variables:#0033 Gambler Roll 1 = Random 1..20
◆Control Variables:#0037 Gambler Roll 2 = Random 1..20
◆Text:None, Window, Bottom
: :\v[32] rolled a \v[33]!\!
: :\v[36] rolled a \v[37]!
◆If:Gambler Roll 1 > Gambler Roll 2
◆Text:None, Window, Bottom
: :\v[32] wins 10\G from \v[36]!
◆Script:var id1 = $gameVariables.value(31);
: :var id2 = $gameVariables.value(35);
: :var bet = 10;
: :$gameVariables.setValue(id1, $gameVariables.value(id1) + bet);
: :$gameVariables.setValue(id2, $gameVariables.value(id2) - bet);
◆
:Else
◆If:Gambler Roll 1 < Gambler Roll 2
◆Text:None, Window, Bottom
: :\v[36] wins 10\G from \v[32]!
◆Script:var id1 = $gameVariables.value(31);
: :var id2 = $gameVariables.value(35);
: :var bet = 10;
: :$gameVariables.setValue(id1, $gameVariables.value(id1) - bet);
: :$gameVariables.setValue(id2, $gameVariables.value(id2) + bet);
◆
:Else
◆Text:None, Window, Bottom
: :Tie! Nobody wins.
◆
:End
◆
:End
◆
:End
◆Control Variables:#0034 Gambler Gold 1 = $gameVariables.value($gameVariables.value(31))
◆Control Variables:#0038 Gambler Gold 2 = $gameVariables.value($gameVariables.value(35))
◆Text:None, Window, Bottom
: :\v[32] now has \v[34]\G.
: :\v[36] now has \v[38]\G.