summaryrefslogtreecommitdiff
path: root/npc/custom/etc/shifty_assassin.txt
blob: ccc9810c359fdfda1f472551467111c73d3b23d1 (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
//===== Hercules Script ======================================
//= Shifty Assassin
//===== By: ==================================================
//= acky
//===== Current Version: =====================================
//= 1.1.2
//===== Description: =========================================
//= Players buy ninjas to assassinate other players
//===== Additional Comments: =================================
//= 1.1.1 Changed all gmcommand to atcommand as Poki#3 suggested. [Vicious]
//= 1.1.2 Updated WoE Check. [Paradox924X]
//============================================================

morocc,148,86,5	script	Shifty Assassin	4_F_JOB_ASSASSIN,{
	set $ninja_price,250000;

	freeloop(true);
	while (true) {
		mes "[Shifty Assassin]";
		mes "What do you want?";
		next;
		switch (select("Buy Ninjas", "Assassinate somebody", "Check your Ninjas", getgmlevel() > 90 ? "Add Ninjas" : "", "Cancel")) {
		case 1:
			mes "[Shifty Assassin]";
			mes "How many ninjas do you want buy?";
			mes "There are ^0000FF" + $ninja_avail + "^000000 ninjas available.";
			mes "They cost ^0000FF" + $ninja_price + " zeny ^000000each.";

			set @buy,0;
			input @buy;
			next;
			if ($ninja_avail < 1) {
				mes "[Shifty Assassin]";
				mes "There are no ninjas left to buy.";
				close;
			}
			if ($ninja_avail < @buy) {
				mes "[Shifty Assassin]";
				mes "There aren't that many ninjas to buy.";
				next;
				continue;
			}
			set @price,@buy*$ninja_price;
			if (Zeny < @price ) {
				mes "[Shifty Assassin]";
				mes "You do not have enough zeny.";
				close;
			}

			mes "[Shifty Assassin]";
			mes "That will cost you ^0000FF" + @price + " zeny^000000.";
			next;
			if (select("Continue", "Cancel") != 1) {
				callsub(OnExit);
				end;
			}
			Zeny -= @price;
			set #ninjas,#ninjas+@buy;
			set $ninja_avail,$ninja_avail-@buy;

			mes "[Shifty Assassin]";
			mes "Thank you.";
			close;
		case 2:
			if (agitcheck()) {
				// NINJAS BUSY FOR WOE //
				mes "[Shifty Assassin]";
				mes "Sorry, all my ninjas are busy doing War of Emperium.";
				close;
			}
			mes "[Shifty Assassin]";
			mes "Enter the name of the target.";
			mes "^FF0000Type the name exactly, otherwise I won't be able to find the victim.^000000";
			next;
			if (select("Continue", "Cancel") != 1) {
				callsub(OnExit);
				end;
			}
			set @name$,"0";
			input @name$;
			next;
			mes "[Shifty Assassin]";
			mes "Active Ninjas: "+#ninjas;
			mes "Resting Ninjas: "+#ninjasr;
			mes "How many do you want to send?";
			set @number,0;
			input @number;
			if (@number < 1) {
				mes "[Shifty Assassin]";
				mes "You can't kill anyone without ninjas.";
				next;
				continue;
			}
			if (@number > #ninjas) {
				mes "[Shifty Assassin]";
				mes "You do not have that many ninjas.";
				next;
				continue;
			}
			if (@number > 10) {
				mes "[Shifty Assassin]";
				mes "You can only send 10 ninjas max.";
				next;
				continue;
			}
			set @chance,rand (1,12);
			set #ninjas,#ninjas-@number;
			set #ninjas,#ninjas+#ninjasr;
			set #ninjasr,0;
			if (@number < @chance) {
				// FAILED ATTACK //
				mes "Sending ninjas now.";
				next;
				mes "[Shifty Assassin]";
				set @ninjasurvived,rand (1,@number);
				set #ninjasr,@number-@ninjasurvived;
				mes "Your attack failed and only ^FF0000" + #ninjasr + "^000000 Ninjas survived.";

				announce @name$+" has survived " + strcharinfo(0) +"'s Ninja attack.",8;
				close;
			}
			// SUCCESSFUL ATTACK //
			mes "Sending ninjas now.";
			next;
			mes "[Shifty Assassin]";
			set @ninjasurvived,rand (1,@number);
			set #ninjasr,@number-@ninjasurvived;
			mes "Your attack succeeded but only ^FF0000" + #ninjasr + "^000000 Ninjas survived.";

			atcommand strcharinfo(0) + "@kill "+@name$;
			announce @name$+" has been assassinated by " + strcharinfo(0) +"'s Ninjas.",bc_npc;
			close;
		case 3:
			mes "[Shifty Assassin]";
			mes "You have:";
			mes "^FF0000" + #ninjas + "^000000 Active Ninjas.";
			mes "^0000FF" + #ninjasr + "^000000 Resting Ninjas.";
			next;
			continue;
		case 4:
			if (getgmlevel() <= 90)
				end;
			mes "[Shifty Assassin]";
			mes "How many ninjas do you want to make available?";
			next;
			set @add,0;
			input @add;
			set $ninja_avail,$ninja_avail+@add;
			mes @add + " ninjas added.";
			close;
		case 5:
			callsub(OnExit);
			end;
		}
		end;
	}

OnExit:
	mes "[Shifty Assassin]";
	mes "Goodbye.";
	close;

// TIMER DELAY NINJA ADDER //
OnClock0600:
	set $ninja_avail,$ninja_avail+2;
	end;
OnClock1200:
	set $ninja_avail,$ninja_avail+2;
	end;
OnClock1500:
	set $ninja_avail,$ninja_avail+2;
	end;
OnClock1800:
	set $ninja_avail,$ninja_avail+3;
	end;
OnClock1900:
	set $ninja_avail,$ninja_avail+2;
	end;
OnClock2000:
	set $ninja_avail,$ninja_avail+2;
	end;
OnClock0000:
	set $ninja_avail,$ninja_avail+2;
	end;
OnInit:
	set $ninja_avail,$ninja_avail+1;
	end;
}