summaryrefslogtreecommitdiff
path: root/npc/017-3
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2018-12-14 00:59:24 -0200
committerJesusaves <cpntb1@ymail.com>2018-12-14 00:59:24 -0200
commitc0d3f7049e6bb1b1a66a3a9d14d1b5e8ad05f9e9 (patch)
treee2802b730bb5fb509f05ea2c62151acd35e943cd /npc/017-3
parentd95b7707c57c8697dd523370dcab163947a60c84 (diff)
downloadserverdata-c0d3f7049e6bb1b1a66a3a9d14d1b5e8ad05f9e9.tar.gz
serverdata-c0d3f7049e6bb1b1a66a3a9d14d1b5e8ad05f9e9.tar.bz2
serverdata-c0d3f7049e6bb1b1a66a3a9d14d1b5e8ad05f9e9.tar.xz
serverdata-c0d3f7049e6bb1b1a66a3a9d14d1b5e8ad05f9e9.zip
Slot Machine to Dimond's Cove. And what better prize than [Diamond]?
Requires two coins for each spin.
Diffstat (limited to 'npc/017-3')
-rw-r--r--npc/017-3/_import.txt1
-rw-r--r--npc/017-3/slots.txt137
2 files changed, 138 insertions, 0 deletions
diff --git a/npc/017-3/_import.txt b/npc/017-3/_import.txt
index 1dff8d16d..0d514e54a 100644
--- a/npc/017-3/_import.txt
+++ b/npc/017-3/_import.txt
@@ -6,5 +6,6 @@
"npc/017-3/doctor.txt",
"npc/017-3/doug.txt",
"npc/017-3/loratay.txt",
+"npc/017-3/slots.txt",
"npc/017-3/vault.txt",
"npc/017-3/workers.txt",
diff --git a/npc/017-3/slots.txt b/npc/017-3/slots.txt
new file mode 100644
index 000000000..785848899
--- /dev/null
+++ b/npc/017-3/slots.txt
@@ -0,0 +1,137 @@
+// TMW2 Scripts
+// Author:
+// Jesusalva
+// Description:
+// Slot Machine for bets
+
+017-3,84,67,0 script Slot Machine#003-10a NPC_SLOTMACHINE,{
+ function symbol{
+ switch (getarg(0)) {
+ case 1:
+ mesn "%%A";
+ break;
+ case 2:
+ mesn "%%B";
+ break;
+ case 3:
+ mesn "%%C";
+ break;
+ case 4:
+ mesn "%%D";
+ break;
+ case 5:
+ mesn "%%E";
+ break;
+ case 6:
+ mesn "%%F";
+ break;
+ case 7:
+ mesn "7";
+ break;
+ default:
+ mesn "%%@";
+ break;
+ }
+ }
+
+L_Menu:
+ mesn;
+ mesc l("Spin three symbols, and jackpot great rewards!");
+ mesc l("Just two coins for spin.");
+ next;
+ menu
+ rif(countitem(CasinoCoins) >= 2, l("Spin!")), L_Spin,
+ l("Prizes"), L_Info,
+ l("Trade"), L_Trade,
+ l("Leave"), L_Quit;
+
+L_Info:
+ mes "";
+ mesc l("Prizes:");
+ mes l("##9 777: @@.", getitemlink(Bloodstone));
+ mes l("##9 %%A%%A%%A: @@.", getitemlink(Sapphire));
+ mes l("##9 %%B%%B%%B: @@.", getitemlink(Amethyst));
+ mes l("##9 %%C%%C%%C: @@.", getitemlink(Diamond));
+ mes l("##9 %%D%%D%%D: @@.", getitemlink(Emerald));
+ mes l("##9 %%E%%E%%E: @@.", getitemlink(Topaz));
+ mes l("##9 %%F%%F%%F: @@.", getitemlink(Ruby));
+ mesc l("Two equal: 1 casino coin.");
+ next;
+ goto L_Menu;
+
+
+L_Spin:
+ mesc l("Spinning...");
+ next;
+ delitem CasinoCoins, 2;
+ .@a=rand(1,7);
+ .@b=rand(1,7);
+ .@c=rand(1,7);
+ symbol(.@a);
+ symbol(.@b);
+ symbol(.@c);
+ next;
+ mesn;
+ if (.@a == .@b && .@a == .@c) {
+ .@it=Iten;
+ switch (.@a) {
+ case 1:
+ .@it=Sapphire; break;
+ case 2:
+ .@it=Amethyst; break;
+ case 3:
+ .@it=Diamond; break;
+ case 4:
+ .@it=Emerald; break;
+ case 5:
+ .@it=Topaz; break;
+ case 6:
+ .@it=Ruby; break;
+ case 7:
+ .@it=Bloodstone; break;
+ }
+ getitem .@it, 1;
+ mesc l("Jackpot! You got the @@!", .@it), 3;
+ } else if (.@a == .@b || .@a == .@c || .@b == .@c) {
+ getitem CasinoCoins, 1;
+ mesc l("Lucky! You got the coin back!"), 3;
+ } else {
+ mesc l("It wasn't this time..."), 3;
+ }
+ next;
+ goto L_Menu;
+
+L_Trade:
+ openshop;
+ closedialog;
+ close;
+
+L_Quit:
+ close;
+
+OnInit:
+ .sex = G_OTHER;
+ .distance = 4;
+ tradertype(NST_CUSTOM);
+
+ sellitem WoodenSword, 940;
+ sellitem JeansShorts, 820;
+ sellitem ElixirOfLife, 150;
+ sellitem PoisonArrow, 30;
+ sellitem StrangeCoin, 5;
+ end;
+
+OnCountFunds:
+ setcurrency(countitem(CasinoCoins));
+ end;
+
+OnPayFunds:
+ if( countitem(CasinoCoins) < @price )
+ end;
+ delitem CasinoCoins,@price;
+ purchaseok();
+ end;
+
+
+}
+