Advertisement
existence_dev92

Automated Clucker

Nov 9th, 2019
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.54 KB | None | 0 0
  1. //===== rAthena Script =======================================
  2. //= Cluck! Cluck! Boom!
  3. //===== By: ==================================================
  4. //= Keale
  5. //===== Current Version: =====================================
  6. //= 1.2a
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= Click the chicken and try retrieve the item at a low
  11. //= chance. If you fail he will nuke, freeze, stone,
  12. //= stun, or make you fall asleep.
  13. //= The prize is configurable and triggered by the NPC.
  14. //===== Additional Comments: =================================
  15. //= 1.0 First release.
  16. //= 1.1 Using 'switch rand' instead.
  17. //= 1.2 Cleaned and standardized. [Euphy]
  18. //= 1.2a Switched 'atcommand' to 'unitskilluseid'.
  19. //= 1.3 Switched 'unitskilluseid' to 'unitkill'.
  20. //============================================================
  21.  
  22. doubrius,43,135,0 script Crazy Chicken 800,2,2,{
  23.  
  24. set .@GMAccess,80; // GM level required to access NPC
  25.  
  26. if (.startcluck) {
  27. specialeffect2 EF_HIT3;
  28. switch(rand(15)) {
  29. case 0: npctalk "Crazy Chicken : CLUUUUUUCK!!!"; unitkill getcharid(3); skilleffect "NPC_SELFDESTRUCTION",1; emotion ET_HUK; break;
  30. case 1: npctalk "Crazy Chicken : Cluuuuuck!~"; break;
  31. case 2: unitkill getcharid(3); skilleffect "NPC_SELFDESTRUCTION",1; break;
  32. case 3: sc_start SC_Freeze,10000,0; break;
  33. case 4: npctalk "Crazy Chicken : CLUUUUUUUUUCK!!!"; unitkill getcharid(3); skilleffect "NPC_SELFDESTRUCTION",1; emotion ET_HUK; break;
  34. case 5: sc_start SC_Sleep,10000,0; break;
  35. case 6: sc_start SC_Stone,10000,0; emotion ET_KIK; break;
  36. case 7: npctalk "Crazy Chicken : CLUUUUUUCK!!!"; unitkill getcharid(3); skilleffect "NPC_SELFDESTRUCTION",1; emotion ET_HUK; break;
  37. case 8: npctalk "Crazy Chicken : Cluck! CLUUUCK!!"; unitkill getcharid(3); skilleffect "NPC_SELFDESTRUCTION",1; emotion ET_HUK; break;
  38. case 9: sc_start SC_Stun,10000,0; break;
  39. case 10: sc_start SC_Sleep,10000,0; emotion ET_KIK; break;
  40. case 11: npctalk "Crazy Chicken : Cluck! Cluck!"; break;
  41. case 12: sc_start SC_Stun,10000,0; break;
  42. case 13: unitkill getcharid(3); skilleffect "NPC_SELFDESTRUCTION",1; break;
  43. default:
  44. if (rand(50) < 4) {
  45. npctalk "Crazy Chicken : WOOF!...........";
  46. specialeffect2 EF_SPHERE;
  47. announce "[Cluck! Cluck! Boom!] " + strcharinfo(0) + " squeezed out the prize! Well done!",0;
  48. getitem $cluck_item_id,$cluck_item_amount;
  49. set .startcluck,0;
  50. } else {
  51. npctalk "Crazy Chicken : Cluck! CLUUUCK!!";
  52. unitkill getcharid(3); skilleffect "NPC_SELFDESTRUCTION",1;
  53. }
  54. break;
  55. }
  56. end;
  57. }
  58. mes "[Crazy Chicken]";
  59. if (getgmlevel() >= .@GMAccess) {
  60. mes "Cluck cluck! Cluuuuuck? ^FF0000~Hi GM " + strcharinfo(0) + ", Wanna play today?~^000000";
  61. mes "Cluck cluck... CLUCK! ^FF0000~Just tell me what to do!~^000000";
  62. next;
  63. while(1) switch(select("Start Event:Check Prize:Set Prize:Not today Crazy Chicken")) {
  64. case 1:
  65. mes "[Crazy Chicken]";
  66. if (.startcluck) {
  67. mes "Cluck! the event is running do you want to stop it?";
  68. if (select("Yes")) {
  69. next;
  70. mes "[Crazy Chicken]";
  71. mes "Event is stopped! Cluuuuuuuuuuuuck!!";
  72. close2;
  73. callsub S_CheckStop, .startcluck;
  74. }
  75. }
  76. mes "CLUCK! ^FF0000~Sure thing!~^000000";
  77. emotion ET_OK;
  78. close2;
  79. OnCluckStart:
  80. announce "[Cluck! Cluck! Boom!] is about to start in Maintown!",bc_blue;
  81. initnpctimer;
  82. end;
  83. case 2:
  84. mes "[Crazy Chicken]";
  85. mes "Cluck, cluck cluck... Cluck! ^FF0000~The current prize is^000000 ^008000"+ $cluck_item_amount +" "+ getitemname($cluck_item_id) +".^000000";
  86. next;
  87. break;
  88. case 3:
  89. mes "[Crazy Chicken]";
  90. mes "Cluck cluck? Cluck??? ^FF0000~What should the prize for winning be? Please input the ID.~^000000";
  91. input $cluck_item_id;
  92. next;
  93. mes "[Crazy Chicken]";
  94. mes "Cluck? cluuuck? ^FF0000~How many if this item should I give away?~^000000";
  95. input $cluck_item_amount;
  96. next;
  97. mes "[Crazy Chicken]";
  98. mes "Cluck cluck..? Cluck. ^FF0000~So, the prize is^000000 ^008000"+ $cluck_item_amount +" "+ getitemname($cluck_item_id) +"^000000? ^FF0000Great.~^000000";
  99. emotion ET_OK;
  100. next;
  101. break;
  102. case 4:
  103. mes "[Crazy Chicken]";
  104. mes "Cluck cluck cluck...";
  105. close;
  106. }
  107. }
  108. mes "Cluck cluck! Cluuuuuck?";
  109. mes "Cluck....";
  110. close;
  111.  
  112. OnClock1800:
  113. donpcevent strnpcinfo(3)+"::OnCluckStart";
  114. end;
  115.  
  116. S_CheckStop:
  117. if (getarg(0)) {
  118. if (getnpctimer(0)) {
  119. setnpctimer 0;
  120. stopnpctimer;
  121. }
  122. .startcluck = 0;
  123. }
  124. end;
  125.  
  126. OnTimer10000:
  127. callsub S_CheckStop, .startcluck;
  128. announce "[Crazy Chicken] : Please hurry behind the fountain if you want to play with the crazy chicken!",bc_all,0xFF7F50;
  129. end;
  130. OnTimer20000:
  131. callsub S_CheckStop, .startcluck;
  132. announce "[Crazy Chicken] : Crazy Chicken has eaten one of my items! I'm too scared to retrieve it!",bc_all,0xFF7F50;
  133. end;
  134. OnTimer30000:
  135. callsub S_CheckStop, .startcluck;
  136. announce "[Crazy Chicken] : Click the insane chicken and try squeeze out the item, if you're lucky you'll win! Are you ready?",bc_all,0xFF7F50;
  137. end;
  138. OnTimer40000:
  139. callsub S_CheckStop, .startcluck;
  140. announce "[Crazy Chicken] : GO! Catch me to get the reward!",bc_all,0xFF7F50;
  141. stopnpctimer;
  142. if (!$cluck_item_id) set $cluck_item_id,512;
  143. if (!$cluck_item_amount) set $cluck_item_amount,1;
  144. set .startcluck,1;
  145. end;
  146.  
  147. OnTouch:
  148. if (!rand(9) && !.startcluck) {
  149. unitkill getcharid(3);
  150. skilleffect "NPC_SELFDESTRUCTION",1;
  151. }
  152. end;
  153. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement