shifty_assassin.txt 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. //===== rAthena Script =======================================
  2. //= Shifty Assassin
  3. //===== By: ==================================================
  4. //= acky
  5. //===== Current Version: =====================================
  6. //= 1.1.2
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  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. morocc,148,86,5 script Shifty Assassin 725,{
  16. set .@ninja_price,250000;
  17. // STARTS THE MENU //
  18. M_Start:
  19. mes "[Shifty Assassin]";
  20. mes "What do you want?";
  21. next;
  22. menu "Buy Ninjas",M_Buy,"Assassinate somebody",M_Kill,"Check your Ninjas",M_Check, ( getgmlevel() > 90 ? "Add Ninjas" : "" ),-,"Cancel",M_Exit;
  23. // GM MENU TO ADD NINJAS //
  24. mes "[Shifty Assassin]";
  25. mes "How many ninjas do you want to make available?";
  26. next;
  27. input .@add;
  28. set $ninja_avail, $ninja_avail+.@add;
  29. mes .@add +" ninjas added.";
  30. close;
  31. // BUY NINJAS //
  32. M_Buy:
  33. mes "[Shifty Assassin]";
  34. mes "How many ninjas do you want buy?";
  35. mes "There are ^0000FF" + $ninja_avail + "^000000 ninjas available.";
  36. mes "They cost ^0000FF" + .@ninja_price + " zeny ^000000each.";
  37. input .@buy;
  38. next;
  39. if ($ninja_avail < 1) goto NoNinjas;
  40. if ($ninja_avail < .@buy) goto NotEnoughNinjas;
  41. set .@price, .@buy*.@ninja_price;
  42. if (Zeny < .@price) goto NoZeny;
  43. mes "[Shifty Assassin]";
  44. mes "That will cost you ^0000FF"+ .@price +" zeny^000000.";
  45. next;
  46. menu "Continue",-,"Cancel",M_Exit;
  47. set Zeny, Zeny - .@price;
  48. set #ninjas, #ninjas + .@buy;
  49. set $ninja_avail, $ninja_avail - .@buy;
  50. mes "[Shifty Assassin]";
  51. mes "Thank you.";
  52. close;
  53. // ASSASSINATE SOMEBODY //
  54. M_Kill:
  55. if (agitcheck()) goto M_Busy;
  56. mes "[Shifty Assassin]";
  57. mes "Enter the name of the target.";
  58. mes "^FF0000Type the name exactly, otherwise I won't be able to find the victim.^000000";
  59. next;
  60. menu "Continue",-,"Cancel",M_Exit;
  61. input .@name$;
  62. if ( !getcharid( 3,.@name$ ) ) {
  63. mes "[Shifty Assassin]";
  64. mes .@name$ +" is not online.";
  65. close;
  66. }
  67. next;
  68. mes "[Shifty Assassin]";
  69. mes "Active Ninjas: "+#ninjas;
  70. mes "Resting Ninjas: "+#ninjasr;
  71. mes "How many do you want to send?";
  72. input .@number;
  73. if (.@number < 1) goto NoNinjasSent;
  74. if (.@number > #ninjas) goto NotEnoughNinjas1;
  75. if (.@number > 10) goto TooManyNinjas;
  76. set .@chance, rand(1,12);
  77. set #ninjas,#ninjas-.@number;
  78. set #ninjas,#ninjas+#ninjasr;
  79. set #ninjasr,0;
  80. if (.@number < .@chance) goto M_Failure;
  81. // SUCCESSFUL ATTACK //
  82. mes "Sending ninjas now.";
  83. next;
  84. mes "[Shifty Assassin]";
  85. set .@ninjasurvived, rand(1,.@number);
  86. set #ninjasr,.@number-.@ninjasurvived;
  87. mes "Your attack succeeded but only ^FF0000" + #ninjasr + "^000000 Ninjas survived.";
  88. set .@acc_id, getcharid( 3,.@name$ );
  89. if ( .@acc_id )
  90. unitkill .@acc_id;
  91. announce .@name$ +" has been assassinated by " + strcharinfo(0) +"'s Ninjas.",bc_npc;
  92. close;
  93. // FAILED ATTACK //
  94. M_Failure:
  95. mes "Sending ninjas now.";
  96. next;
  97. mes "[Shifty Assassin]";
  98. set .@ninjasurvived, rand(1,.@number);
  99. set #ninjasr, .@number-.@ninjasurvived;
  100. mes "Your attack failed and only ^FF0000" + #ninjasr + "^000000 Ninjas survived.";
  101. announce .@name$+" has survived " + strcharinfo(0) +"'s Ninja attack.",8;
  102. close;
  103. // NINJAS BUSY FOR WOE //
  104. M_Busy:
  105. mes "[Shifty Assassin]";
  106. mes "Sorry, all my ninjas are busy doing War of Emperium.";
  107. close;
  108. // CHECK YOUR NINJAS //
  109. M_Check:
  110. mes "[Shifty Assassin]";
  111. mes "You have:";
  112. mes "^FF0000" + #ninjas + "^000000 Active Ninjas.";
  113. mes "^0000FF" + #ninjasr + "^000000 Resting Ninjas.";
  114. next;
  115. goto M_Start;
  116. // LIMIT //
  117. NoNinjasSent:
  118. mes "[Shifty Assassin]";
  119. mes "You can't kill anyone without ninjas.";
  120. next;
  121. goto M_Start;
  122. TooManyNinjas:
  123. mes "[Shifty Assassin]";
  124. mes "You can only send 10 ninjas max.";
  125. next;
  126. goto M_Start;
  127. NoZeny:
  128. mes "[Shifty Assassin]";
  129. mes "You do not have enough zeny.";
  130. close;
  131. NotEnoughNinjas:
  132. mes "[Shifty Assassin]";
  133. mes "There aren't that many ninjas to buy.";
  134. next;
  135. goto M_Start;
  136. NoNinjas:
  137. mes "[Shifty Assassin]";
  138. mes "There are no ninjas left to buy.";
  139. close;
  140. NotEnoughNinjas1:
  141. mes "[Shifty Assassin]";
  142. mes "You do not have that many ninjas.";
  143. next;
  144. goto M_Start;
  145. M_Exit:
  146. mes "[Shifty Assassin]";
  147. mes "Goodbye.";
  148. close;
  149. // TIMER DELAY NINJA ADDER //
  150. OnClock0600:
  151. OnClock1200:
  152. OnClock1500:
  153. OnClock1900:
  154. OnClock2000:
  155. OnClock0000:
  156. set $ninja_avail,$ninja_avail+2;
  157. end;
  158. OnClock1800:
  159. set $ninja_avail,$ninja_avail+3;
  160. end;
  161. OnInit:
  162. set $ninja_avail,$ninja_avail+1;
  163. end;
  164. }