diff options
-rw-r--r-- | db/constants.conf | 1 | ||||
-rw-r--r-- | db/re/item_db.conf | 6 | ||||
-rw-r--r-- | npc/003-10/_import.txt | 1 | ||||
-rw-r--r-- | npc/003-10/slots.txt | 112 |
4 files changed, 117 insertions, 3 deletions
diff --git a/db/constants.conf b/db/constants.conf index 91ae10c25..9a2349f87 100644 --- a/db/constants.conf +++ b/db/constants.conf @@ -4016,6 +4016,7 @@ constants_db: { NPC_FINAL_POINT: 910 NPC_KATJA_TREE: 911 NPC_DAN_NOTE: 912 + NPC_SLOTMACHINE: 913 NPC_OFFSET_NO_SPRITE: 998 comment__: "special npcs" diff --git a/db/re/item_db.conf b/db/re/item_db.conf index d4e35bedd..4c375c918 100644 --- a/db/re/item_db.conf +++ b/db/re/item_db.conf @@ -3104,9 +3104,9 @@ item_db: ( AegisName: "CasinoCoins" Name: "Casino Coins" Type: "IT_ETC" - Buy: 200 - Sell: 20 - Weight: 4 + Buy: 20 + Sell: 10 + Weight: 2 WeaponLv: 0 EquipLv: 0 Refine: false diff --git a/npc/003-10/_import.txt b/npc/003-10/_import.txt index 357bb6e77..a3b5e499e 100644 --- a/npc/003-10/_import.txt +++ b/npc/003-10/_import.txt @@ -2,3 +2,4 @@ // This file is generated automatically. All manually added changes will be removed when running the Converter. "npc/003-10/_warps.txt", "npc/003-10/arnea.txt", +"npc/003-10/slots.txt", diff --git a/npc/003-10/slots.txt b/npc/003-10/slots.txt new file mode 100644 index 000000000..74c96fdb5 --- /dev/null +++ b/npc/003-10/slots.txt @@ -0,0 +1,112 @@ +// TMW2 Scripts +// Author: +// Jesusalva +// Description: +// Slot Machine for bets + +003-10,22,37,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; + mes col("Spin three symbols, and jackpot great rewards!", 9); + mes col("Just one coin for spin.", 9); + next; + menu + rif(countitem(CasinoCoins) >= 1, l("Spin!")), L_Spin, + l("Prizes"), L_Info, + l("Leave"), L_Quit; + +L_Info: + mes ""; + mes col("Prizes:", 9); + mes col("777: 10 coins.", 9); + mes col("Three equal: 5 coins.", 9); + mes col("Two equal: 2 coins.", 9); + next; + goto L_Menu; + + +L_Spin: + mes col("Spinning...", 9); + next; + delitem CasinoCoins, 1; + .@a=rand(1,5); + .@b=rand(1,5); + .@c=rand(1,5); + symbol(.@a); + symbol(.@b); + symbol(.@c); + next; + mesn; + if (.@a == .@b && .@a == .@c && .@a == 7) { + getitem CasinoCoins, 10; + mes col("Jackpot! You got ten coins!", 3); + } else if (.@a == .@b == .@c) { + getitem CasinoCoins, 5; + mes col("Congrats! You got five coins!", 3); + } else if (.@a == .@b || .@a == .@c || .@b == .@c) { + getitem CasinoCoins, 2; + mes col("Lucky! You got two coins!", 3); + } else { + mes col("It wasn't this time...", 3); + } + close; + +L_Quit: + close; + +OnInit: + .sex = G_OTHER; + .distance = 4; + tradertype(NST_CUSTOM); + + sellitem WoodenSword, 940; + sellitem JeansShorts, 820; + sellitem ElixirOfLife, 150; + sellitem RedCottonDye, 30; + sellitem GreenCottonDye, 30; + sellitem BlueCottonDye, 30; + end; + +OnCountFunds: + setcurrency(countitem(CasinoCoins)); + end; + +OnPayFunds: + if( countitem(CasinoCoins) < @price ) + end; + delitem CasinoCoins,@price; + purchaseok(); + end; + + +} + |