yuhsing

Untitled

Dec 25th, 2012
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.51 KB | None | 0 0
  1. //===== eAthena/rAthena Script =======================================
  2. //= Goblin Invasion
  3. //===== By: ==================================================
  4. //= Mysterious
  5. //===== Current Version: =====================================
  6. //= 1.6
  7. //===== Compatible With: =====================================
  8. //= eAthena or rAthena SVN
  9. //===== Description: =========================================
  10. // Goblins spawn randomly in a given town. Once all Goblins are killed
  11. // the Goblin Leader spawns.
  12. //===== TODO: ================================================
  13. // - Change more coding
  14. //===== Additional Comments: =================================
  15. //= v1.0 - First release [Mysterious]
  16. //= v1.1 - Fixed Bugs [Mysterious]
  17. //= v1.2 - Fixed Sentence structures [Mysterious]
  18. //= v1.3 - Added Proper Notes [Mysterious]
  19. //= v1.4 - Made it obvious on what players have to change [Mysterious]
  20. //= v1.5 - Proper Sentence Structures and Typos fixed [Mysterious]
  21. //= v1.6 - Fixed mobs not counting down properly [Mysterious]
  22. //============================================================
  23.  
  24. rachel,136,146,5 script Goblin Invasion 459,{
  25.  
  26. set .gm,40; //GM Level to access the GM Menu. Default: 40
  27.  
  28. // GM menu | Game Masters Level 40 or more are allowed to Start and Stop invasions.
  29. if (getgmlevel()>.gm) {
  30. if (.mobs_left) {
  31. mes "[Invasion]";
  32. mes "An invasion is already in progress! Details:";
  33. mes "Location: " + .Map$;
  34. mes "^FF0000"+.mobs_left+"^000000 Goblins left";
  35. mes " ";
  36. mes "Would you like to Stop the invasion?";
  37. if(select("- No:- Yes")==1) close;
  38. donpcevent "Invasion NPC::OnTimer1805000";
  39. mes "Invasion stopped";
  40. announce "The Invasion has been stopped by "+strcharinfo(0),bc_all;
  41. goto OnStop;
  42. close;
  43. }
  44. mes "[Invasion]";
  45. mes "Please customize the Invasion event before starting it.";
  46. mes "Note - The Goblin Leader drops x5 of the prize.";
  47. Main:
  48. next;
  49. mes "[Invasion]";
  50. switch(select("Item [" + getitemname(.ItemID) + "]:Start Event")) {
  51. case 1:
  52. mes "Which item would you like the Goblin Leader to drop?";
  53. mes "Please input the item ID:";
  54. input .ItemID;
  55. goto Main;
  56. case 2:
  57. mes "The event is going to begin shortly.";
  58. close2;
  59. goto OnStart;
  60. }
  61.  
  62. //If a player clicks the NPC, the NPC will tell the player how much Mobs are left on the certain map.
  63. mes "[Invasion]";
  64. mes "There are "+.mobs_left+" Goblins who've invaded "+.Map$[.rand_map]+"!";
  65. close;
  66.  
  67. /////////////////////////
  68. //The actual NPC Script//
  69. /////////////////////////
  70. OnMinute50: // Change this to your liking (When you want the event to start)
  71. OnStart:
  72. set .mobs_left, 1;
  73. sleep2 1000;
  74. set $@ran, rand(1,6);
  75. if ($@ran == 6) set .Map$,"splendide";
  76. if ($@ran == 5) set .Map$,"izlude";
  77. if ($@ran == 4) set .Map$,"payon";
  78. if ($@ran == 3) set .Map$,"geffen";
  79. if ($@ran == 2) set .Map$,"morocc";
  80. if ($@ran == 1) set .Map$,"prontera";
  81. sleep2 1000;
  82. announce "[ Rune-Midgard Guard ]: We have trouble here in the fabulous town known as " + .Map$ + "!", bc_all;
  83. sleep2 5000;
  84. announce "[ Rune-Midgard Guard ]: Everyone, we need your help to get rid of these Goblins!", bc_all;
  85. announce "[ Rune-Midgard Guard ]: We need you to kill ALL THE GOBLIN WITHIN 30MINUTES to summon the GOBLIN LEADER!", bc_all;
  86. monster .Map$,0,0,"Goblin",1258,250,"Goblin Invasion::OnMyMobDead";
  87. set .mobs_left, 250;
  88. initnpctimer;
  89. end;
  90.  
  91.  
  92. OnTimer1805000: // 30 minutes later, kills all the mobs.
  93. killmonster .Map$,"Goblin Invasion::OnMyMobDead";
  94. killmonster .Map$,"Goblin Invasion::OnSpecialMobDead";
  95. set .mobs_left, 0;
  96. announce "It seems that no one can finish the Invasion!",bc_all;
  97. end;
  98.  
  99.  
  100. OnStop://When the event is stopped by a GM, or all monsters dead.
  101. stopnpctimer;
  102. killmonster .Map$,"Goblin Invasion::OnMyMobDead";
  103. killmonster .Map$,"Goblin Invasion::OnSpecialMobDead";
  104. announce "It seems that "+strcharinfo(0)+" has ended the Invasion!",bc_all;
  105. end;
  106.  
  107. OnMyMobDead: //When a Goblin is killed
  108. set .mobs_left, .mobs_left-1;
  109. if (.mobs_left==0) {
  110. announce "[ Rune-Midgard Guard ]: The Goblin Leader has spawned in " + .Map$ + "!", bc_all;
  111. monster .Map$,0,0,"Goblin Leader",1299,1,"Goblin Invasion::OnSpecialMobDead";
  112.  
  113. } else {
  114. announce "["+.mobs_left+"/250] Goblins left.",bc_map;
  115. }
  116. end;
  117.  
  118. OnSpecialMobDead:
  119. announce strcharinfo(0)+" has fought off the Goblin Invasion and has been awarded a worthy prize!", bc_all;
  120. getitem .ItemID,5; //Change the [5] to the amount you wish to hand out.
  121. donpcevent "Goblin Invasion::OnStop";
  122. }
  123. end;
  124.  
  125. }
Advertisement
Add Comment
Please, Sign In to add comment