diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-02-02 15:16:23 -0200 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-02-02 15:16:23 -0200 |
commit | 66154881bafe2bc42f68b9662e3c98e1c7813047 (patch) | |
tree | 9a7730d58fbea5fcf036418c872b51e36f1581e9 | |
parent | 7804c21a8e4b6c45a9f43a90c46b8313d40e6607 (diff) | |
download | serverdata-66154881bafe2bc42f68b9662e3c98e1c7813047.tar.gz serverdata-66154881bafe2bc42f68b9662e3c98e1c7813047.tar.bz2 serverdata-66154881bafe2bc42f68b9662e3c98e1c7813047.tar.xz serverdata-66154881bafe2bc42f68b9662e3c98e1c7813047.zip |
I cannot add the planned quests, but at least a Gambler I can add
-rw-r--r-- | db/constants.conf | 3 | ||||
-rw-r--r-- | npc/020-4/_import.txt | 1 | ||||
-rw-r--r-- | npc/020-4/gambler.txt | 146 |
3 files changed, 149 insertions, 1 deletions
diff --git a/db/constants.conf b/db/constants.conf index d58b8db83..c0703dfee 100644 --- a/db/constants.conf +++ b/db/constants.conf @@ -3921,7 +3921,8 @@ constants_db: { NPC_Q_ANON: 130 NPC_SAMANTHA: 131 NPC_SERENA: 132 - NPC_NARRATOR: 133 + //NPC_NARRATOR: 133 + NPC_FLOPPED_NOBLEMAN: 133 NPC_ARTAXE: 134 NPC_LUCAS: 135 NPC_CALYPSAN: 136 diff --git a/npc/020-4/_import.txt b/npc/020-4/_import.txt index ba4afe111..404082ea8 100644 --- a/npc/020-4/_import.txt +++ b/npc/020-4/_import.txt @@ -1,3 +1,4 @@ // Map 020-4: Nivalis Indoors // This file is generated automatically. All manually added changes will be removed when running the Converter. "npc/020-4/_warps.txt", +"npc/020-4/gambler.txt", diff --git a/npc/020-4/gambler.txt b/npc/020-4/gambler.txt new file mode 100644 index 000000000..865ee9f37 --- /dev/null +++ b/npc/020-4/gambler.txt @@ -0,0 +1,146 @@ +// 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) + +020-4,69,35,0 script Gambler#020-4 NPC_FLOPPED_NOBLEMAN,{ + 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); + } + } + + goto L_Menu; + +L_Menu: + showavatar; + mesn; + mesc l("Hey, I am flopped. Do you want to gamble?"); + mesc l("You need a @@. I'll flip one card, and you'll need to decide if next draw will be HIGHER or LOWER.", getitemlink(CasinoCoins)); + 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 80 GP!"); + 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("Every seven successive right guesses, you'll get a @@!", getitemlink(StrangeCoin)); + mesc l("Every fifteen successive right guesses, you'll get a @@!", getitemlink(BronzeGift)); + mesc l("Every fifty successive right guesses, you'll get a @@!", getitemlink(SilverGift)); + mesc l("Every 101 successive right guesses, you'll get a @@!", getitemlink(GoldenGift)); + 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?!"); + mesc l("Cards are ranked on this priority: @@", "A - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - J - Q - K - Joker"); + next; + 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 (.@card1 < .@card2 && @menu == 2) { + mesc l("It's lower! That's right!"); + Zeny=Zeny+80; + @gambler_winstreak=@gambler_winstreak+1; + } else if (.@card1 > .@card2 && @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 StrangeCoin, 1; + if (@gambler_winstreak % 15 == 0) + getitem BronzeGift, 1; + if (@gambler_winstreak % 50 == 0) + getitem SilverGift, 1; + if (@gambler_winstreak % 101 == 0) + getitem GoldenGift, 1; + mesc l("Your current win streak is @@!", @gambler_winstreak); + $XAN_BETS=$XAN_BETS+1; + } else { + .@bypass=0; + } + next; + goto L_Menu; + +L_Quit: + close; + +OnInit: + .sex = G_MALE; + .distance = 4; + end; + +} + + +// Random NPC +020-4,70,36,4 script Gambling Xan 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: + .sex = G_MALE; + .distance = 4; + npcsit; + end; +} |