root/npc/custom/eAAC_Scripts/roll_a_dice.txt

Revision 1, 7.0 kB (checked in by jinshiro, 17 years ago)
Line 
1//==========================================================
2//Roll a Dice  NPC
3//==========================================================
4//Made by birkiczd
5//==========================================================
6//This game lets you and the Dicer throw 3 dices.
7//Whoever get's a higher number (the player or dealer) wins.
8//==========================================================
9//Version:1.0 - made script public
10//        1.1 - fixed a few bugs,added dice emos =)
11//        1.2 - made variables for the amount of zenys for
12//                each bet so it is easy for people to costumize
13//              the script
14//          1.3 - added more emoticons,made an Info menu
15//                  option which contains explanations and rules,
16//                  added the amount of lost/won zeny on the end
17//                  of each game,added more colors
18//          1.4 - some small code optimization thanks to Myzter             
19//==========================================================
20
21
22cmd_in02,181,98,2       script  Dicer   57,{
23
24//These variables allow you to set the amount of zeny people can bet
25set @betzeny1,500; //500 zeny
26set @betzeny2,1000; //1000 zeny
27set @betzeny3,2000; //2000 zeny
28set @betzeny4,10000; //10000 zeny
29
30//Variable for the number guess zeny bet
31set @betnum, 1000; //1000 Zeny
32
33       
34        mes "[Dicer]";
35        mes "Welcome to the Revolution Dice Game.You wanna check your luck with dices?Remember I am the dice expert and rarely someone was able to beat me.";
36        next;
37        mes "[Dicer]";
38        mes "What would you like to do?";
39        next;
40        menu "Play",L_play,"Info",L_info,"Go away",L_go;
41
42L_go:
43        mes "[Dicer]";
44        mes "Please come again when you are ready.";
45        close;
46
47L_info:
48        mes "[Dicer]";
49        mes "Please choose one of the following options for more informations:";
50        next;
51        menu "Main Rules",L_main,"Bets and Wins",L_bet,"Extra Games",L_extra,"Go away",L_go;
52
53L_main:
54        mes "[Dicer]";
55        mes "^0080FFRoll A Dice^000000 is a very simple game.The game allows you and the NPC to throw 3 dices.Whoever gets a higher total number wins.";
56        next;
57        goto L_info;
58
59L_bet:
60        mes "[Dicer]";
61        mes "You have 4 zeny amounts to choose for your bet.If you choose a high bet your win will also be higher,it is that simple.Also various extra games can increase your win.";
62        next;
63        mes "[Dicer]";
64        mes "Example:";
65        mes "^0080FFBet^000000         ^0080FFWin^000000";
66        mes "500       1000";
67        mes "1000     2000";
68        mes "2000     4000";
69        mes "10000   20000";
70        next;
71        goto L_info;
72
73L_extra:
74        mes "[Dicer]";
75        mes "You can also try increasing your win by playing extra games like guessing your total number at the end of the game.It will cost you an extra amount of zeny but if you guess the number your win will be tripled instead of doubled.";
76        next;
77        goto L_info;
78         
79L_play:
80        mes "[Dicer]";
81        mes "Ok,please choose the amount of zeny you want to bet:";
82        next;
83        menu ""+@betzeny1+" Zeny",L_zeny1,""+@betzeny2+" Zeny",L_zeny2,""+@betzeny3+" Zeny",L_zeny3,""+@betzeny4+" Zeny",L_zeny4,"Too rich for my blood...",L_go;
84
85        L_zeny1:
86                if(Zeny < @betzeny1) goto L_nzeny;
87                set @bet, @betzeny1;
88                goto L_gamea;
89        L_zeny2:
90                if(Zeny < @betzeny2) goto L_nzeny;
91                set @bet, @betzeny2;
92                goto L_gamea;
93        L_zeny3:
94                if(Zeny < @betzeny3) goto L_nzeny;
95                set @bet, @betzeny3;
96                goto L_gamea;
97        L_zeny4:
98                if(Zeny < @betzeny4) goto L_nzeny;
99                set @bet, @betzeny4;
100                goto L_gamea;
101
102L_nzeny:
103        mes "[Dicer]";
104        emotion 20;
105        mes "Sorry but it seems you don't have enough zeny!";
106      close;
107
108L_gamea:
109        mes "[Dicer]";
110        mes "Would you like to try to increase your win by trying to guess the number you will get?";
111        mes "It will cost you another ^0080FF"+@betnum+"^000000 zeny.";
112        next;
113        menu "Yes",L_gamec,"No",L_gameb;
114
115L_gamec:
116        if(Zeny < @betnum + @bet) goto L_nzeny;
117        mes "[Dicer]";
118        mes "Please input the number you think you will get (3-18).";
119        input @numg;
120        if(@numg<3) message strcharinfo(0),"Number is too low, input again.";
121        if(@numg>18) message strcharinfo(0),"Number is too high, input again.";
122        if(@numg<3||@numg>18) goto L_gamec;
123        set Zeny, Zeny - @betnum;
124        next;
125        goto L_gameb;
126
127L_gameb:
128
129        set @dea1, rand(1,6);
130        set @dea2, rand(1,6);
131        set @dea3, rand(1,6);
132        set @pla1, rand(1,6);
133        set @pla2, rand(1,6);
134        set @pla3, rand(1,6);
135        set @deatot, @dea1+@dea2+@dea3;
136        set @platot, @pla1+@pla2+@pla3;
137
138        mes "[Dicer]";
139        mes "I will be the first one to roll the dices,and after that you will throw them.I am feeling lucky today, so you better go away before I take every zeny you have.";
140        next;
141        mes "[^0080FFDicer 1st Turn^000000]";
142        mes "Throwing first dice!";
143        mes ".....roll.....roll....roll....";
144        emotion 58;
145        mes " ";
146        mes "First throw: ^0080FF"+@dea1+" ^000000";
147        next;
148        mes "[^0080FFDicer 2nd Turn^000000]";
149        mes "Throwing second dice!";
150        emotion 58;
151        mes ".....roll.....roll....roll....";
152        mes " ";
153        mes "Second throw: ^0080FF"+@dea2+" ^000000";
154        next;
155        mes "[^0080FFDicer 3rd Turn^000000]";
156        mes "Throwing third dice!";
157        emotion 58;
158        mes ".....roll.....roll....roll....";
159        mes " ";
160        mes "Third throw: ^0080FF"+@dea3+" ^000000";
161        next;
162        mes "[Dicer]";
163        mes "Now it's your turn to throw the dices.I bet you can't get higher numbers then me.";
164        next;
165        mes "[^0080FFPlayer 1st Turn^000000]";
166        mes "Throwing first dice!";
167        mes ".....roll.....roll....roll....";
168        emotion 58;
169        mes " ";
170        mes "First throw: ^0080FF"+@pla1+" ^000000";
171        next;
172        mes "[^0080FFPlayer 2nd Turn^000000]";
173        mes "Throwing second dice!";
174        emotion 58;
175        mes ".....roll.....roll....roll....";
176        mes " ";
177        mes "Second throw: ^0080FF"+@pla2+" ^000000";
178        next;
179        mes "[^0080FFPlayer 3rd Turn^000000]";
180        mes "Throwing third dice!";
181        emotion 58;
182        mes ".....roll.....roll....roll....";
183        mes " ";
184        mes "Third throw: ^0080FF"+@pla3+" ^000000";
185        next;
186      mes "[Dicer]";
187        mes "Let's look at our total numbers:";
188        mes " ";
189        mes "Dicer Total: ^0080FF"+@deatot+" ^000000.";
190        mes "Player Total: ^0080FF"+@platot+" ^000000.";
191        next;
192        if (@platot < @deatot) goto L_lose;
193        if (@platot == @deatot) goto L_again;
194        if (@platot > @deatot && @platot == @numg) goto L_win2;
195        if (@platot > @deatot) goto L_win1;
196
197L_lose:
198        mes "[Dicer]";
199        set Zeny, Zeny - @bet;
200        emotion 39;
201        mes "I got a higher number!!!";
202        mes "See I told you nobody can beat me!";
203        mes " ";
204        mes "You lost ^0080FF"+@bet+"^000000 Zeny.";
205        next;
206        goto L_againa;
207       
208L_again:
209        mes "[Dicer]";
210        emotion 54;
211        mes "It seems it's a draw.Let's play again.";
212        next;
213        goto L_play;
214
215L_win1:
216        mes "[Dicer]";
217        set Zeny, Zeny + @bet*2;
218        set @wona, @bet*2;
219        emotion 36;
220        mes "I can't belive I lost. Here take your money.";
221        mes " ";
222        mes "You won ^0080FF"+@wona+"^000000 Zeny.";
223        next;
224        goto L_againa;
225
226L_win2:
227        mes "[Dicer]";
228        set Zeny, Zeny + @bet*3;
229        set @wonb, @bet*3;
230        emotion 36;
231        mes "You even guessed the total number you got.I can't belive I lost. Here is your money.";
232        mes " ";
233        mes "You won ^0080FF"+@wonb+"^000000 Zeny.";
234        next;
235        goto L_againa;
236
237L_againa:
238        mes "[Dicer]";
239        mes "Would you like to play again?";
240        next;
241        menu "Yes",L_play,"No",L_go;
242
243 
244}
Note: See TracBrowser for help on using the browser.