summaryrefslogtreecommitdiff
path: root/npc/custom/eAAC_Scripts/roll_a_dice.txt
blob: 469683dd7d9eafc8fc7027f2fa2ba4c15a02b7d8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
//==========================================================
//Roll a Dice  NPC
//==========================================================
//Made by birkiczd
//==========================================================
//This game lets you and the Dicer throw 3 dices.
//Whoever get's a higher number (the player or dealer) wins.
//==========================================================
//Version:1.0 - made script public
//        1.1 - fixed a few bugs,added dice emos =)
//        1.2 - made variables for the amount of zenys for 
//	          each bet so it is easy for people to costumize 
//              the script
//	    1.3 - added more emoticons,made an Info menu 
//		    option which contains explanations and rules,
//		    added the amount of lost/won zeny on the end 
//		    of each game,added more colors
//	    1.4 - some small code optimization thanks to Myzter             
//==========================================================


cmd_in02.gat,181,98,2	script	Dicer	57,{

//These variables allow you to set the amount of zeny people can bet
set @betzeny1,500; //500 zeny
set @betzeny2,1000; //1000 zeny
set @betzeny3,2000; //2000 zeny
set @betzeny4,10000; //10000 zeny

//Variable for the number guess zeny bet
set @betnum, 1000; //1000 Zeny

	
	mes "[Dicer]";
	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.";
	next;
	mes "[Dicer]";
	mes "What would you like to do?";
	next;
	menu "Play",L_play,"Info",L_info,"Go away",L_go;

L_go:
	mes "[Dicer]";
	mes "Please come again when you are ready.";
	close;

L_info:
	mes "[Dicer]";
	mes "Please choose one of the following options for more informations:";
	next;
	menu "Main Rules",L_main,"Bets and Wins",L_bet,"Extra Games",L_extra,"Go away",L_go;

L_main:
	mes "[Dicer]";
	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.";
	next;
	goto L_info;

L_bet:
	mes "[Dicer]";
	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.";
	next;
	mes "[Dicer]";
	mes "Example:";
	mes "^0080FFBet^000000         ^0080FFWin^000000";
	mes "500       1000";
	mes "1000     2000";
	mes "2000     4000";
	mes "10000   20000";
	next;
	goto L_info;

L_extra:
	mes "[Dicer]";
	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.";
	next;
	goto L_info;
	  
L_play:
	mes "[Dicer]";
	mes "Ok,please choose the amount of zeny you want to bet:";
	next;
	menu ""+@betzeny1+" Zeny",L_zeny1,""+@betzeny2+" Zeny",L_zeny2,""+@betzeny3+" Zeny",L_zeny3,""+@betzeny4+" Zeny",L_zeny4,"Too rich for my blood...",L_go;

	L_zeny1:
		if(Zeny < @betzeny1) goto L_nzeny;
		set @bet, @betzeny1;
		goto L_gamea;
	L_zeny2:
		if(Zeny < @betzeny2) goto L_nzeny;
		set @bet, @betzeny2;
		goto L_gamea;
	L_zeny3:
		if(Zeny < @betzeny3) goto L_nzeny;
		set @bet, @betzeny3;
		goto L_gamea;
	L_zeny4:
		if(Zeny < @betzeny4) goto L_nzeny;
		set @bet, @betzeny4;
		goto L_gamea;

L_nzeny:
	mes "[Dicer]";
	emotion 20;
	mes "Sorry but it seems you don't have enough zeny!";
      close;

L_gamea:
	mes "[Dicer]";
	mes "Would you like to try to increase your win by trying to guess the number you will get?";
	mes "It will cost you another ^0080FF"+@betnum+"^000000 zeny.";
	next;
	menu "Yes",L_gamec,"No",L_gameb;

L_gamec:
	if(Zeny < @betnum + @bet) goto L_nzeny;
	mes "[Dicer]";
	mes "Please input the number you think you will get (3-18).";
	input @numg;
	if(@numg<3) message strcharinfo(0),"Number is too low, input again.";
	if(@numg>18) message strcharinfo(0),"Number is too high, input again.";
	if(@numg<3||@numg>18) goto L_gamec;
	set Zeny, Zeny - @betnum;
	next;
	goto L_gameb;

L_gameb:

	set @dea1, rand(1,6);
	set @dea2, rand(1,6);
	set @dea3, rand(1,6);
	set @pla1, rand(1,6);
	set @pla2, rand(1,6);
	set @pla3, rand(1,6);
	set @deatot, @dea1+@dea2+@dea3;
	set @platot, @pla1+@pla2+@pla3;

	mes "[Dicer]";
	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.";
	next;
	mes "[^0080FFDicer 1st Turn^000000]";
	mes "Throwing first dice!";
	mes ".....roll.....roll....roll....";
	emotion 58;
	mes " ";
	mes "First throw: ^0080FF"+@dea1+" ^000000";
	next;
	mes "[^0080FFDicer 2nd Turn^000000]";
	mes "Throwing second dice!";
	emotion 58;
	mes ".....roll.....roll....roll....";
	mes " ";
	mes "Second throw: ^0080FF"+@dea2+" ^000000";
	next;
	mes "[^0080FFDicer 3rd Turn^000000]";
	mes "Throwing third dice!";
	emotion 58;
	mes ".....roll.....roll....roll....";
	mes " ";
	mes "Third throw: ^0080FF"+@dea3+" ^000000";
	next;
	mes "[Dicer]";
	mes "Now it's your turn to throw the dices.I bet you can't get higher numbers then me.";
	next;
	mes "[^0080FFPlayer 1st Turn^000000]";
	mes "Throwing first dice!";
	mes ".....roll.....roll....roll....";
	emotion 58;
	mes " ";
	mes "First throw: ^0080FF"+@pla1+" ^000000";
	next;
	mes "[^0080FFPlayer 2nd Turn^000000]";
	mes "Throwing second dice!";
	emotion 58;
	mes ".....roll.....roll....roll....";
	mes " ";
	mes "Second throw: ^0080FF"+@pla2+" ^000000";
	next;
	mes "[^0080FFPlayer 3rd Turn^000000]";
	mes "Throwing third dice!";
	emotion 58;
	mes ".....roll.....roll....roll....";
	mes " ";
	mes "Third throw: ^0080FF"+@pla3+" ^000000";
	next;
      mes "[Dicer]";
	mes "Let's look at our total numbers:";
	mes " ";
	mes "Dicer Total: ^0080FF"+@deatot+" ^000000.";
	mes "Player Total: ^0080FF"+@platot+" ^000000.";
	next;
 	if (@platot < @deatot) goto L_lose;
	if (@platot == @deatot) goto L_again;
	if (@platot > @deatot && @platot == @numg) goto L_win2;
	if (@platot > @deatot) goto L_win1;

L_lose:
	mes "[Dicer]";
	set Zeny, Zeny - @bet;
	emotion 39;
	mes "I got a higher number!!!";
	mes "See I told you nobody can beat me!";
	mes " ";
	mes "You lost ^0080FF"+@bet+"^000000 Zeny.";
	next;
	goto L_againa;
	
L_again:
	mes "[Dicer]";
	emotion 54;
	mes "It seems it's a draw.Let's play again.";
	next;
	goto L_play;

L_win1:
	mes "[Dicer]";
	set Zeny, Zeny + @bet*2;
	set @wona, @bet*2;
	emotion 36;
	mes "I can't belive I lost. Here take your money.";
	mes " ";
	mes "You won ^0080FF"+@wona+"^000000 Zeny.";
	next;
	goto L_againa;

L_win2:
	mes "[Dicer]";
	set Zeny, Zeny + @bet*3;
	set @wonb, @bet*3;
	emotion 36;
	mes "You even guessed the total number you got.I can't belive I lost. Here is your money.";
	mes " ";
	mes "You won ^0080FF"+@wonb+"^000000 Zeny.";
	next;
	goto L_againa;

L_againa:
	mes "[Dicer]";
	mes "Would you like to play again?";
	next;
	menu "Yes",L_play,"No",L_go;

 
}