summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2024-07-29 15:23:53 -0300
committerJesusaves <cpntb1@ymail.com>2024-07-29 15:23:53 -0300
commit2215c23b622a3e550a9b140a20597cc3ad1c3804 (patch)
tree1c73f1a7138e66043bb7779d2c4769502746670e
parente16584406b84997e73a2747fabcf27d963216109 (diff)
downloadserverdata-2215c23b622a3e550a9b140a20597cc3ad1c3804.tar.gz
serverdata-2215c23b622a3e550a9b140a20597cc3ad1c3804.tar.bz2
serverdata-2215c23b622a3e550a9b140a20597cc3ad1c3804.tar.xz
serverdata-2215c23b622a3e550a9b140a20597cc3ad1c3804.zip
Add the Imperial Slot Machine. It's impossible to use it, however.
-rw-r--r--npc/031-4/_import.txt2
-rw-r--r--npc/031-4/gambler.txt165
-rw-r--r--npc/031-4/slots.txt189
3 files changed, 356 insertions, 0 deletions
diff --git a/npc/031-4/_import.txt b/npc/031-4/_import.txt
index 16d63bfb5..26f3ba513 100644
--- a/npc/031-4/_import.txt
+++ b/npc/031-4/_import.txt
@@ -1,3 +1,5 @@
// Map 031-4: Aethyr Indoors
// This file is generated automatically. All manually added changes will be removed when running the Converter.
"npc/031-4/_warps.txt",
+"npc/031-4/gambler.txt",
+"npc/031-4/slots.txt",
diff --git a/npc/031-4/gambler.txt b/npc/031-4/gambler.txt
new file mode 100644
index 000000000..8782c6b55
--- /dev/null
+++ b/npc/031-4/gambler.txt
@@ -0,0 +1,165 @@
+// TMW2 Scripts
+// Author:
+// Jesusalva
+// Description:
+// Gambler: Will next card be better or worse?
+// $XAN_BETS: How many victories all players already had (for propaganda :3)
+
+031-4,92,84,0 script Gambler#031-4 NPC_PLAYER,{
+ function cardname{
+ switch (getarg(0)) {
+ case 0:
+ return "A"; break;
+ case 10:
+ return "J"; break;
+ case 11:
+ return "Q"; break;
+ case 12:
+ return "K"; break;
+ case 13:
+ return l("Joker"); break;
+ default:
+ return getarg(0)+1;
+ }
+ }
+
+ goto L_Menu;
+
+L_Menu:
+ showavatar;
+ mesn;
+ mesc ("I'll futurely play Poker with you, but as I cannot show images side by side, showing your hand would take a LOT of space. So not available.");
+ mesc ("The prize of an Axe Hat cannot be obtained, and thus, slot machine cannot be used.");
+ if (!is_admin()) close;
+
+ mesc l("If a tie happens, I'll give your coin back.");
+ next;
+ menu
+ rif(countitem(CasinoCoins) >= 1, l("Let's play!")), L_Spin,
+ l("Information"), L_Info,
+ l("Leave"), L_Quit;
+
+L_Info:
+ mes "";
+ mesc l("Rules:");
+ mesc l("A card will be flipped, you'll need to decide if next flip will be HIGHER or LOWER.");
+ mesc l("Cards are ranked on this priority: A - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - J - Q - K - Joker");
+ next;
+ mesc l("Prizes:");
+ mesc l("If you're right, you'll get at least 80 GP!");
+ mesc l("You'll also get half of the GP as Monster Points!");
+ mesc l("If a tie happens, you'll get your coin back.");
+ mesc l("If you're wrong, your winning streak is reset.");
+ mesc l("Winning Streak is also reset on logout or when you leave the Inn.");
+ next;
+ mesc l("Winning Strike Prizes:");
+ mesc l("If you get 10 successive right guesses, you'll get a %s!", getitemlink(SantaHat));
+ mesc l("Every seven successive right guesses, you'll get a %s!", getitemlink(BronzeGift)); // 7.14%
+ mesc l("Every fifteen successive right guesses, you'll get a @@!", getitemlink(SilverGift)); // 3.33%
+ mesc l("Every fifty successive right guesses, you'll get a @@!", getitemlink(GoldenGift)); // 1.00%
+ mesc l("Every 101 successive right guesses, you'll get a @@!", getitemlink(PrismGift)); // 0.50%
+ next;
+ goto L_Menu;
+
+
+L_Spin:
+ showavatar AVATAR_CARD_COVER;
+ mesc l("I'll draw a card now!");
+ next;
+ delitem CasinoCoins, 1;
+ // First card will never be an edge card (Ace or Joker), so you can ALWAYS guess wrong.
+ .@card1=rand(1, 12);
+ showavatar 1000+.@card1;
+ mesn;
+ mesc l("It's a @@!", cardname(.@card1));
+ mesc l("Will next draw be HIGHER or LOWER?!");
+ next;
+ mesc l("Cards are ranked on this priority: A - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - J - Q - K - Joker");
+ select
+ l("HIGHER!"),
+ l("LOWER!");
+ mes "";
+
+ // Flip Flop!
+ .@card2=rand(0, 13);
+ showavatar 1000+.@card2;
+ mesn;
+ mesc l("It's a @@!", cardname(.@card2));
+
+ if (.@card1 == .@card2) {
+ mesc l("It's a tie!");
+ getitem CasinoCoins, 1;
+ .@bypass=1;
+ } else if (.@card2 < .@card1 && @menu == 2) {
+ mesc l("It's lower! That's right!");
+ Zeny=Zeny+80;
+ @gambler_winstreak=@gambler_winstreak+1;
+ } else if (.@card2 > .@card1 && @menu == 1) {
+ mesc l("It's higher! That's right!");
+ Zeny=Zeny+80;
+ @gambler_winstreak=@gambler_winstreak+1;
+ } else {
+ mesc l("You were wrong!");
+ @gambler_winstreak=0;
+ }
+
+ // Winning Streak
+ if (!.@bypass && @gambler_winstreak) {
+ if (@gambler_winstreak % 7 == 0)
+ getitem BronzeGift, 1;
+ if (@gambler_winstreak % 15 == 0)
+ getitem SilverGift, 1;
+ if (@gambler_winstreak % 50 == 0)
+ getitem GoldenGift, 1;
+ if (@gambler_winstreak % 101 == 0)
+ getitem PrismGift, 1;
+ if (@gambler_winstreak == 10)
+ getitem SantaHat, 1;
+ mesc l("Your current win streak is @@!", @gambler_winstreak);
+ $XAN_BETS=$XAN_BETS+1;
+ Zeny+=min((@gambler_winstreak*2), 40);
+ Mobpt+=40+min(@gambler_winstreak, 20);
+ } else {
+ .@bypass=0;
+ }
+ next;
+ goto L_Menu;
+
+L_Quit:
+ close;
+
+OnInit:
+ .sex = G_MALE;
+ .distance = 4;
+ .@npcId = getnpcid(.name$);
+ setunitdata(.@npcId, UDT_HEADTOP, TopHat);
+ setunitdata(.@npcId, UDT_HEADMIDDLE, CreasedShirt);
+ setunitdata(.@npcId, UDT_HEADBOTTOM, JeansShorts);
+ npcsit;
+ end;
+
+}
+
+
+// Random NPC
+/*
+020-4,70,36,4 script Gambling Fedja NPC_PLAYER,{
+ mesn;
+ mesq l("Argh... I can never get it right! If only he drew an Ace or a Joker on the first draw... But he never does that!");
+ next;
+ mesn;
+ mesq l("That rat... I already spent @@ @@ with him!!", $XAN_BETS, getitemlink(CasinoCoins));
+ mes l("If I weren't tempted to try again everytime someone gets it right...");
+ close;
+
+OnInit:
+ .@npcId = getnpcid(.name$);
+ setunitdata(.@npcId, UDT_HEADMIDDLE, CreasedShirt);
+ setunitdata(.@npcId, UDT_HEADBOTTOM, JeansShorts);
+
+ .sex = G_MALE;
+ .distance = 4;
+ npcsit;
+ end;
+}
+*/
diff --git a/npc/031-4/slots.txt b/npc/031-4/slots.txt
new file mode 100644
index 000000000..5f2c816e0
--- /dev/null
+++ b/npc/031-4/slots.txt
@@ -0,0 +1,189 @@
+// TMW2 Scripts
+// Author:
+// Jesusalva, Saulc
+// Description:
+// Slot Machine for bets in Aethyr, for the King of Gambling
+// Rare Reward: Imperial Crown
+
+031-4,96,81,0 script Slot Machine#031-4 NPC_NO_SPRITE,{
+ 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;
+ case 8:
+ mesn "%%8";
+ break;
+ case 9:
+ mesn "%%9";
+ break;
+ case 10:
+ mesn "%%0";
+ break;
+ case 11:
+ mesn "%%1";
+ break;
+ case 12:
+ mesn "%%2";
+ break;
+ case 13:
+ mesn "%%3";
+ break;
+ case 14:
+ mesn "%%4";
+ break;
+ case 15:
+ mesn "%%5";
+ break;
+ case 16:
+ mesn "%%6";
+ break;
+ case 17:
+ mesn "%%7";
+ break;
+ case 18:
+ mesn "%%:";
+ break;
+ case 19:
+ mesn "%%;";
+ break;
+ default:
+ mesn "%%@";
+ break;
+ }
+ return;
+ }
+
+ function dismiss {
+ mesc b(l("NOT CLASSY ENOUGH!")), 1;
+ mesc l("You need to acquire a %s from a Casino around the world to use this slot machine.", getitemlink(getarg(0))), 1;
+ close;
+ return;
+ }
+
+L_Menu:
+ // Unlock the seven Casinos around the world
+ if (!countitem(Monocle)) dismiss(Monocle);
+ if (!countitem(Bloodstone)) dismiss(Bloodstone);
+ if (!countitem(PaperBag)) dismiss(PaperBag);
+ if (!countitem(TrapperHat)) dismiss(TrapperHat);
+ if (!countitem(SantaHat)) dismiss(SantaHat);
+ if (!countitem(Beard)) dismiss(Beard);
+ if (!countitem(AxeHat)) dismiss(AxeHat);
+ // Oooh, so you did it, didn't you?
+ mesn;
+ mesc l("Thou whom hast cleared the seven casinos in the world, may challenge the ultimate slot machine."), 1;
+ if (!gethominfo(0)) { mesc l("Acquire a Homunculus to witness it."); close; }
+ if (homstatus()) { mesc l("Bring your Homunculus to witness it."); close; }
+ mesc l("Just one coin for spin."), 1;
+ next;
+ menu
+ rif(countitem(CasinoCoins) >= 1, l("Spin!")), L_Spin,
+ l("Prizes"), L_Info,
+ l("Leave"), -;
+ close;
+
+L_Info:
+ mes "";
+ mesc l("Prizes:");
+ mes l("##9 77777: @@.", getitemlink(ImperialCrown));
+ if (countitem(AFKCap))
+ mesc l("Five equal: %s.", getitemlink(Bathrobe));
+ else
+ mesc l("Five equal: %s.", "20 Strange Coin + 15000 Homun EXP");
+ mesc l("Four equal: @@.", "5 Strange Coin + 5000 Homun EXP");
+ mesc l("Three equal: @@.", "5 Casino Coins + 500 Homun EXP");
+ mesc l("Two equal: %s.", l("50 GP + 50 Homunculus EXP"));
+ mes "";
+ mesc l("Two pairs count as three equal. A \"full house\" count as four equal.");
+ next;
+ goto L_Menu;
+
+
+L_Spin:
+ mesc l("Spinning...");
+ dnext;
+ delitem CasinoCoins, 1;
+ .@a=rand2(20);
+ .@b=rand2(20);
+ .@c=rand2(20);
+ .@d=rand2(20);
+ .@e=rand2(20);
+ symbol(.@a);
+ symbol(.@b);
+ symbol(.@c);
+ symbol(.@d);
+ symbol(.@e);
+
+ // Check how many symbols you got identical
+ // This is not the same as normal slot machines!
+ .@s = 0;
+ if (.@a == .@b || .@a == .@c || .@a == .@d || .@a == .@e)
+ .@s += 1;
+ if (.@b == .@c || .@b == .@d || .@b == .@e)
+ .@s += 1;
+ if (.@c == .@d || .@c == .@e)
+ .@s += 1;
+ if (.@d == .@e)
+ .@s += 1;
+
+ mes "";
+ mesn;
+ if (.@a == .@b && .@a == .@c && .@a == .@d && .@a == .@e && .@a == 7) {
+ getitem ImperialCrown, 1;
+ kamibroadcast(b(sprintf("%s has acquired the %s!", strcharinfo(0), getitemlink(ImperialCrown))), "JACKPOT");
+ mesc b(l("Jackpot! Thou hast been crowned eternal as the gambler king!")), 4;
+ } else if (.@a == .@b && .@a == .@c && .@a == .@d && .@a == .@e) {
+ if (countitem(AFKCap))
+ getitem Bathrobe, 1;
+ else
+ getitem StrangeCoin, 20;
+ Zeny += 350;
+ gethomunexp 15000;
+ mesc b(l("Thou hast been lucky and a %s prize was given to thee.", l("major"))), 4;
+ } else if (.@s == 3) {
+ Zeny += 250;
+ getitem StrangeCoin, 5;
+ gethomunexp 5000;
+ mesc l("Thou hast been lucky and a %s prize was given to thee.", l("normal")), 3;
+ } else if (.@s == 2) {
+ Zeny += 150;
+ getitem CasinoCoins, 5;
+ gethomunexp 500;
+ mesc l("Thou hast been lucky and a %s prize was given to thee.", l("small")), 2;
+ } else if (.@s == 1) {
+ Zeny += 50;
+ gethomunexp 50;
+ mesc l("Thou hast been lucky and a %s prize was given to thee.", l("minor")), 6;
+ } else {
+ mesc l("It wasn't this time..."), 9;
+ }
+ next;
+ goto L_Menu;
+
+OnInit:
+ .sex = G_OTHER;
+ .distance = 4;
+ end;
+
+
+}
+