summaryrefslogtreecommitdiff
path: root/npc/custom/etc/rpsroulette.txt
blob: e0f8b8952a192e32c33d38b00af820ba77133170 (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
//===== Hercules Script ======================================
//= Rock Scissors Roulette
//===== By: ==================================================
//= acky
//===== Current Version: =====================================
//= 1.2
//===== Compatible With: =====================================
//= Hercules SVN
//===== Description: =========================================
//= Plays a hybrid Russian Roulette Rock Scissors Paper game.
//===== Additional Comments: =================================
//= Prizes customizable, Added emotions.
//= 1.2 Fixes by Blackthunder and me [Poki#3]
//============================================================

cmd_in02,182,126,2	script	Crazy Boris	4_M_03,{
	mes "Hey you! Up for Rock Scissors Roulette?";
	next;
	switch (select("Let me play.","Explain the rules.","Leave")) {
		case 1:
			break;
		case 2:
			mes "Ok here are the rules:";
			mes "I have with me a ^FF00006^000000 chamber pistol with ^FF00001^000000 round. First we play ^FF0000Scissors ^00FF00Paper ^0000FFRock^000000. The loser pulls the trigger. The winner is whoever comes out best.";
			mes "Beat me to win a prize.";
			next;
			if (select("Let me play.","No thanks.") == 1) {
				mes "Ok here we go...";
				break;
			}
			// else fall through
		case 3:
			mes "Pansy.";
			close;
	}
	.@counter = 1;
	while(true) {
		mes "Rock... Paper...";

		.@choice = select("^0000FFROCK!","^0000FFSCISSORS!","^0000FFPAPER!");
		if (.@lastchoice == .@choice) {
			if (.@lastchoice == 1)
				.@opponent = rand(1,3);
			else if (.@lastchoice == 2)
				.@opponent = rand(1,2);
			else
				.@opponent = rand(2,3);
		} else {
			.@opponent = rand(1,3);
		}
		.@lastchoice = .@choice;

		if (.@opponent == 1)
			emotion e_rock;
		else if (.@opponent == 2)
			emotion e_scissors;
		else
			emotion e_paper;

		if (.@opponent == .@choice) {
			// SAME
			mes "Draw! Again!";
			continue;
		}

		if ((.@choice == 1 && .@opponent == 3)
		 || (.@choice == 2 && .@opponent == 1)
		 || (.@choice == 3 && .@opponent == 2)
		 ) {
			// LOSE
			emotion e_heh;
			mes "Boorah! You Lose!";
			next;
			.@win = false;
		} else {
			//WIN
			mes "Damnit, You Win!";
			emotion e_swt2;
			next;
			.@win = true;
		}

		mes .@counter +" of 6";
		if (.@counter == 6)
			mes "Say your prayers";
		.@pull = rand(1, 7 - .@counter);
		++.@counter;
		next;
		if (.@pull > 1) {
			emotion e_pif;
			mes "*^0000FFClick^000000* whew...";
			continue;
		}
		if (!.@win) {
			specialeffect EF_SUI_EXPLOSION;
			mes "*^0000FFClick^000000* *^FF0000BANG^000000*";
			mes "You're dead!";
			emotion e_gg;
			percentheal -100,-100;
			close;
		}
		specialeffect EF_SUI_EXPLOSION;
		mes "*^0000FFClick^000000* *^FF0000BANG^000000*";
		mes "OWWW @#$%^!! THAT HURT LIKE HELL!!";
		emotion e_omg;
		next;
		mes "Congratulations! You have won...";
		switch (rand(1,10)) {
			case 1: setarray .@reward[0], 10,984; break;
			case 3: setarray .@reward[0],100,601; break;	// 100x Fly Wings
			case 4: setarray .@reward[0],  8,603; break;	// 8x Old Blue Box
			case 5: setarray .@reward[0],  4,617; break;	// 4x Old Violet Box
			case 6: setarray .@reward[0],  1,616; break;	// 1x Old Card Album
			case 7: setarray .@reward[0], 10,604; break;	// 10x Dead Branch
			case 8: setarray .@reward[0],  3,969; break;	// 3x Gold
			case 10: setarray .@reward[0],20,505; break;	// 20x Blue Potion
			case 2:
			case 9:
			         setarray .@reward[0], 10,985;
		}
		mes .@reward[0] +"x "+ getitemname(.@reward[1]) +"!";
		getitem .@reward[1], .@reward[0];
		close;
	}
	end;
}