mushroom_event.txt 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //===== rAthena Script =======================================
  2. //= Find the Mushroom
  3. //===== By: ==================================================
  4. //= Mysterious
  5. //===== Current Version: =====================================
  6. //= 3.6a
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= Find the Mushroom - random amount of Mushrooms spawns in random maps.
  11. //= Players need to find these mushrooms and kill them to gain prizes!
  12. //===== Additional Comments: =================================
  13. //= 3.0 Fully Functional with Rewritten script. [Mysterious]
  14. //= 3.6a Slightly edited. [Euphy]
  15. //============================================================
  16. prontera,142,228,6 script Find the Mushroom 1084,{
  17. mes "[ Find The Mushroom ]";
  18. if (.status == 1) {
  19. .@count = mobcount( .event_map$, strnpcinfo(0) + "::OnMobKilled" );
  20. if (.@count > 0) {
  21. mes "There are " + .@count + " Mushrooms left in " + .event_map$ + "!";
  22. mes "Find and kill the mushrooms to gain " + getitemname(.prize) + "!";
  23. close;
  24. }
  25. .event_map$ = "";
  26. .status = 0;
  27. mes "All the mushrooms are killed?";
  28. }
  29. mes "There is no event at the moment!";
  30. if (.status || getgmlevel() < .GM) close;
  31. mes "Start the event?";
  32. next;
  33. if (select("- No:- Yes") == 1) close;
  34. donpcevent strnpcinfo(0) + "::OnMinute10";
  35. mes "[ Find The Mushroom ]";
  36. mes "Event started!";
  37. close;
  38. OnInit:
  39. .prize = 512; // Reward item ID
  40. .amount = 10; // Reward item amount
  41. .GM = 60; // GM level required to access NPC
  42. setarray .maps_list$[0],"izlude","geffen","morocc","prontera"; // Possible maps
  43. end;
  44. OnMinute10: // Start time (every hour)
  45. if (.status) end;
  46. .status = 1;
  47. .@spawn = rand(1,10); // How many Mushrooms should spawn?
  48. .event_map$ = .maps_list$[ rand(getarraysize(.maps_list$)) ];
  49. .@label$ = strnpcinfo(0) + "::OnMobKilled";
  50. killmonster .event_map$, .@label$;
  51. monster .event_map$,0,0,"Please don't kill me!",1084,.@spawn, .@label$;
  52. announce "Find the Mushroom : Total of " + .@spawn + " Mushrooms have been spawned in " + .event_map$ + "!",0;
  53. sleep 2500;
  54. announce "Find the Mushroom : Every Mushroom you kill will give you " + getitemname(.prize) + "!",0;
  55. end;
  56. OnMobKilled:
  57. if (playerattached() == 0)
  58. end;
  59. getitem .prize, .amount;
  60. .@spawn = mobcount( .event_map$, strnpcinfo(0) + "::OnMobKilled" );
  61. if (.@spawn > 0)
  62. announce "[ " + strcharinfo(0) + " ] has killed a Mushroom. There are now " + .@spawn + " Mushroom(s) left.",bc_map;
  63. else {
  64. announce "The Find the Mushroom Event has ended. All the Mushrooms have been killed.",0;
  65. .status = 0;
  66. .event_map$ = "";
  67. }
  68. end;
  69. }