Advertisement
EyesOfAHawk

Jack Frost v0.1

Nov 29th, 2018
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.02 KB | None | 0 0
  1. //===== Hercules Script ======================================
  2. //= Christmas Event - 2018
  3. //===== By ===================================================
  4. //= Hrist, Infiltrated, Wolfie
  5. //= Original 'Break the Seal Quest' by Albert
  6. //===== Description ==========================================
  7. //= Jack Frost - similar to Mysterious Crane.
  8. //============================================================
  9.  
  10. amatsu,230,230,3 script Jack Frost CLEAR_NPC,{
  11.  
  12. // sets the '.@name$' variable to custom bRO style
  13. .@name$ = F_NpcName(strnpcinfo(NPC_NAME));
  14.  
  15. // flavour text
  16. mes(.@name$);
  17. mes("Ho, ho, hi~~~~fellow");
  18. mes("spirited adventurer-!");
  19. if (!@Repeat_Xmas_Text && .Condense_Text) {
  20. next();
  21. mes(.@name$);
  22. }
  23. mes("I am Jack Frost, many");
  24. mes("a-call me Jack and I'm");
  25. mesf("reaching out to you, %s.", strcharinfo(PC_NAME));
  26. if (!@Repeat_Xmas_Text && .Condense_Text) {
  27. next();
  28. mes(.@name$);
  29. }
  30. mes("On this blissfully chilly");
  31. mes("morning, it has frightfully");
  32. mes("come to my attention that");
  33. mes("we cannot start Christmas");
  34. mes("this year without the Seal");
  35. mes("of Christmas being broken.");
  36. if (!@Repeat_Xmas_Text && .Condense_Text) {
  37. next();
  38. mes(.@name$);
  39. }
  40. mes("For each time the seal");
  41. mes("is broken, you will be");
  42. mes("rewarded with a gift chosen");
  43. mes("randomly my bag of treats.");
  44. mes("To do that, I'll need for");
  45. mes("you to help me gather a");
  46. mes("list of items. Return them");
  47. mes("to me so I can work my magic.");
  48. next();
  49. mes(.@name$);
  50.  
  51. if (.Condense_Text)
  52. @Repeat_Xmas_Text = true;
  53.  
  54. // counts required items from '.Required' array
  55. if (F_CountItem(.Required) < 1) {
  56. // display a list of required items from array
  57. F_DispCountItem(.Required);
  58. } else {
  59. // player has required items, delete then award random item
  60. mes("So you have all the");
  61. mes("items..? In exchange");
  62. mes("I will give you a");
  63. mes("chance of a nice reward.");
  64. next();
  65. mes(.@name$);
  66. mes("Choose your class...the");
  67. mes("higher the less chance");
  68. mes("of something good!");
  69. next();
  70. .@i = select("Class S", "Class A", "Class B", "Class C", "Class D") -1;
  71. mes(.@name$);
  72. mes("Break the seal for a");
  73. mes("chance at one of these:");
  74. mes(" ");
  75. callsub(S_Item, .@i, true);
  76. next();
  77. mes(.@name$);
  78. mes("Are you ready to break");
  79. mes("the Seal of Christmas?");
  80. next();
  81. if (select("Ready!", "^777777Not ready.^000000") == 2)
  82. close();
  83.  
  84. // in case somehow player lost items since last check
  85. if (F_CountItem(.Required) < 1) {
  86. mes(.@name$);
  87. mes("...");
  88. next();
  89. mes(.@name$);
  90. mes("Nothing happened.");
  91. close();
  92. }
  93.  
  94. F_DelItem(.Required);
  95. .@ID = callsub(S_Item, .@i);
  96. getitem(.@ID, 1);
  97. if (.@ID == Gold_Coin)
  98. .@Mes$ = "A moment of silence for";
  99. else
  100. .@Mes$ = "Congratulations to";
  101. announce(sprintf("%s [ %s ] who received %s %s after breaking the seal of Christmas!", .@Mes$, strcharinfo(PC_NAME), callsub(S_A_An, getitemname(.@ID)), getitemname(.@ID)), bc_all);
  102. }
  103. close();
  104.  
  105. S_A_An:
  106. .@str$ = strtolower(getarg(0));
  107. setarray(.@Vowel$, "a", "e", "i", "o", "u");
  108. for (.@i = 0; .@i < getarraysize(.@Vowel$); .@i++) {
  109. if (charat(.@str$, 0) == .@Vowel$[.@i])
  110. return "an";
  111. }
  112. return "a";
  113.  
  114. S_Item:
  115. switch (getarg(0, 4)) {
  116. // CLASS S
  117. case 0:
  118. .@Chance = 200; // 2%
  119. setarray(.@ID,
  120. (getarg(1, false)) ? C_Sparkly_Xmas_Cloak : F_ReturnRand(C_Sparkly_Xmas_Cloak, C_Sparkly_Xmas_Cloak_Aqua, C_Sparkly_Xmas_Cloak_Black, C_Sparkly_Xmas_Cloak_Blue, C_Sparkly_Xmas_Cloak_Green, C_Sparkly_Xmas_Cloak_Grey, C_Sparkly_Xmas_Cloak_Orange, C_Sparkly_Xmas_Cloak_Pink, C_Sparkly_Xmas_Cloak_Purple, C_Sparkly_Xmas_Cloak_Yellow),
  121. King_Poring_Hat,
  122. C_Crimson_Booster,
  123. C_Scratching_Cat,
  124. C_Worg_In_Mouth,
  125. C_Merry_Xmas_Rudolph,
  126. C_White_Angel_Wing_Heart
  127. );
  128. break;
  129.  
  130. // CLASS A
  131. case 1:
  132. .@Chance = 800; // 8%
  133. setarray(.@ID,
  134. Blue_Poring_Bubble,
  135. Valkyrie_Circlet,
  136. C_Small_Golden_Wings,
  137. C_Horse_King,
  138. C_Snowflakes,
  139. C_Snowman_Balloon,
  140. C_Sparkly_Winter_Scarf
  141. );
  142. break;
  143.  
  144. // CLASS B
  145. case 2:
  146. .@Chance = 1600; // 16%
  147. setarray(.@ID,
  148. C_Neko_Santa_Hat,
  149. C_Cat_Santa_Hat,
  150. Candy_Hat,
  151. 5488,
  152. Frozen_Twin_Pompom,
  153. C_Large_Ribbon_Muffler,
  154. C_Light_Up_Christmas_Tree
  155. );
  156. break;
  157.  
  158. // CLASS C
  159. case 3:
  160. .@Chance = 3200; // 32%
  161. setarray(.@ID,
  162. 5500,
  163. Navy_Beret,
  164. Red_Beret,
  165. Ice_Wing_Ear,
  166. 5402,
  167. C_Long_Tongue,
  168. (getarg(1, false)) ? C_Light_Up_Scarf : F_ReturnRand(C_Light_Up_Scarf, C_Light_Up_Scarf_Black, C_Light_Up_Scarf_Blue, C_Light_Up_Scarf_Green, C_Light_Up_Scarf_Purple, C_Light_Up_Scarf_Yellow)
  169. );
  170. break;
  171.  
  172. // CLASS D
  173. case 4:
  174. .@Chance = 6400; // 64%
  175. setarray(.@ID,
  176. Gold_Spirit_Chain,
  177. C_Snowman_Hat,
  178. Candy_Cane_In_The_Mouth,
  179. F_ReturnRand(Blue_Scarf, Cyan_Scarf, Gold_Scarf, Pink_Scarf, Red_Scarf_, Green_Scarf),
  180. Citron_Hat,
  181. Mini_Tree,
  182. (getarg(1, false)) ? C_Light_Up_Santa_Hat : F_ReturnRand(C_Light_Up_Santa_Hat, C_Light_Up_Santa_Hat_Black, C_Light_Up_Santa_Hat_Blue, C_Light_Up_Santa_Hat_Green, C_Light_Up_Santa_Hat_Yellow)
  183. );
  184. break;
  185. default:
  186. break;
  187. }
  188.  
  189. // Just display what item is in a category then return
  190. if (getarg(1, false)) {
  191. .@str$ = "";
  192. .@size = getarraysize(.@ID);
  193. for (.@i = 0; .@i < .@size; .@i++) {
  194. if (.@i == .@size - 1)
  195. .@str$ += sprintf("%s%s", (.@i > 0 ? " or " : ""), getitemname(.@ID[.@i]));
  196. else
  197. .@str$ += sprintf("%s%s", (.@i > 0 ? ", " : ""), getitemname(.@ID[.@i]));
  198. }
  199. mesf("- %s.", .@str$);
  200. return;
  201. }
  202.  
  203. .@i = getarraysize(.@ID) - 1;
  204. if (.@i < 0)
  205. .@i = 0;
  206.  
  207. .@i = rand(.@i);
  208. .@j = rand(10000);
  209. if (.@j < .@Chance)
  210. return .@ID[.@i];
  211.  
  212. return Gold_Coin; // TODO: change to Ancient_Coin
  213.  
  214. OnInit:
  215. setarray(.Required,
  216. Jellopy, 100,
  217. Red_Potion, 50,
  218. ITEMID_ZENY, 10000000
  219. );
  220.  
  221. // Do you want the flavour text to be condensed after reading it the first time?
  222. // They will have to read it again if they relog.
  223. // (true / false)
  224. .Condense_Text = true;
  225. end;
  226. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement