root/npc/custom/shifty_assassin.txt @ 3

Revision 1, 4.9 kB (checked in by jinshiro, 17 years ago)
Line 
1//===== eAthena Script =======================================
2//= Shifty Assassin
3//===== By: ==================================================
4//= acky - god@acky.com
5//===== Current Version: =====================================
6//= 1.1.2
7//===== Compatible With: =====================================
8//= eAthena SVN
9//===== Description: =========================================
10//= Players buy ninjas to assassinate other players
11//===== Additional Comments: =================================
12//= 1.1.1 Changed all gmcommand to atcommand as Poki#3 suggested. [Vicious]
13//= 1.1.2 Updated WoE Check. [Paradox924X]
14//============================================================
15
16morocc,148,86,5 script  Shifty Assassin 725,{
17set $ninja_price,250000;
18
19// STARTS THE MENU //
20M_Start:
21mes "[Shifty Assassin]";
22mes "What do you want?";
23next;
24if (getgmlevel() > 90) goto M_GM;
25menu "Buy Ninjas",M_Buy,"Assassinate somebody",M_Kill,"Check your Ninjas",M_Check,"Cancel",M_Exit;
26M_GM:
27menu "Buy Ninjas",M_Buy,"Assassinate somebody",M_Kill,"Check your Ninjas",M_Check,"Add Ninjas",M_Add,"Cancel",M_Exit;
28
29// GM MENU TO ADD NINJAS //
30M_Add:
31mes "[Shifty Assassin]";
32mes "How many ninjas do you want to make available?";
33next;
34set @add,0;
35input @add;
36set $ninja_avail,$ninja_avail+@add;
37mes @add + " ninjas added.";
38close;
39
40// BUY NINJAS //
41M_Buy:
42mes "[Shifty Assassin]";
43mes "How many ninjas do you want buy?";
44mes "There are ^0000FF" + $ninja_avail + "^000000 ninjas available.";
45mes "They cost ^0000FF" + $ninja_price + " zeny ^000000each.";
46
47set @buy,0;
48input @buy;
49next;
50if ($ninja_avail < 1) goto NoNinjas;
51if ($ninja_avail < @buy) goto NotEnoughNinjas;
52set @price,@buy*$ninja_price;
53if (zeny < @price ) goto NoZeny;
54
55mes "[Shifty Assassin]";
56mes "That will cost you ^0000FF" + @price + " zeny^000000.";
57next;
58menu "Continue",-,"Cancel",M_Exit;
59
60set zeny,zeny-@price;
61set #ninjas,#ninjas+@buy;
62set $ninja_avail,$ninja_avail-@buy;
63
64mes "[Shifty Assassin]";
65mes "Thank you.";
66close;
67
68// ASSASSINATE SOMEBODY //
69M_Kill:
70if (agitcheck()) goto M_Busy;
71mes "[Shifty Assassin]";
72mes "Enter the name of the target.";
73mes "^FF0000Type the name exactly, otherwise I won't be able to find the victim.^000000";
74next;
75menu "Continue",-,"Cancel",M_Exit;
76set @name$,"0";
77input @name$;
78next;
79mes "[Shifty Assassin]";
80mes "Active Ninjas: "+#ninjas;
81mes "Resting Ninjas: "+#ninjasr;
82mes "How many do you want to send?";
83set @number,0;
84input @number;
85if (@number < 1) goto NoNinjasSent;
86if (@number > #ninjas) goto NotEnoughNinjas1;
87if (@number > 10) goto TooManyNinjas;
88set @chance,rand (1,12);
89set #ninjas,#ninjas-@number;
90set #ninjas,#ninjas+#ninjasr;
91set #ninjasr,0;
92if (@number < @chance) goto M_Failure;
93
94// SUCCESSFUL ATTACK //
95mes "Sending ninjas now.";
96next;
97mes "[Shifty Assassin]";
98set @ninjasurvived,rand (1,@number);
99set #ninjasr,@number-@ninjasurvived;
100mes "Your attack succeeded but only ^FF0000" + #ninjasr + "^000000 Ninjas survived.";
101
102atcommand strcharinfo(0) + "@kill "+@name$;
103announce @name$+" has been assassinated by " + strcharinfo(0) +"'s Ninjas.",8;
104close;
105
106// FAILED ATTACK //
107M_Failure:
108mes "Sending ninjas now.";
109next;
110mes "[Shifty Assassin]";
111set @ninjasurvived,rand (1,@number);
112set #ninjasr,@number-@ninjasurvived;
113mes "Your attack failed and only ^FF0000" + #ninjasr + "^000000 Ninjas survived.";
114
115announce @name$+" has survived " + strcharinfo(0) +"'s Ninja attack.",8;
116close;
117
118// NINJAS BUSY FOR WOE //
119M_Busy:
120mes "[Shifty Assassin]";
121mes "Sorry, all my ninjas are busy doing War of Emperium.";
122close;
123
124// CHECK YOUR NINJAS //
125M_Check:
126mes "[Shifty Assassin]";
127mes "You have:";
128mes "^FF0000" + #ninjas + "^000000 Active Ninjas.";
129mes "^0000FF" + #ninjasr + "^000000 Resting Ninjas.";
130next;
131goto M_Start;
132
133
134// LIMIT //
135NoNinjasSent:
136mes "[Shifty Assassin]";
137mes "You can't kill anyone without ninjas.";
138next;
139goto M_Start;
140
141TooManyNinjas:
142mes "[Shifty Assassin]";
143mes "You can only send 10 ninjas max.";
144next;
145goto M_Start;
146
147NoZeny:
148mes "[Shifty Assassin]";
149mes "You do not have enough zeny.";
150close;
151
152NotEnoughNinjas:
153mes "[Shifty Assassin]";
154mes "There aren't that many ninjas to buy.";
155next;
156goto M_Start;
157
158NoNinjas:
159mes "[Shifty Assassin]";
160mes "There are no ninjas left to buy.";
161close;
162
163NotEnoughNinjas1:
164mes "[Shifty Assassin]";
165mes "You do not have that many ninjas.";
166next;
167goto M_Start;
168
169M_Exit:
170mes "[Shifty Assassin]";
171mes "Goodbye.";
172close;
173
174// TIMER DELAY NINJA ADDER //
175
176OnClock0600:
177set $ninja_avail,$ninja_avail+2;
178end;
179
180OnClock1200:
181set $ninja_avail,$ninja_avail+2;
182end;
183
184OnClock1500:
185set $ninja_avail,$ninja_avail+2;
186end;
187
188
189OnClock1800:
190set $ninja_avail,$ninja_avail+3;
191end;
192
193OnClock1900:
194set $ninja_avail,$ninja_avail+2;
195end;
196
197OnClock2000:
198set $ninja_avail,$ninja_avail+2;
199end;
200
201
202OnClock0000:
203set $ninja_avail,$ninja_avail+2;
204end;
205
206OnInit:
207set $ninja_avail,$ninja_avail+1;
208end;
209}
Note: See TracBrowser for help on using the browser.