Advertisement
Emistry

[RO] rA Daily Monster Hunt / daily auto reset

Jan 16th, 2016
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.95 KB | None | 0 0
  1. //======Name========================================
  2. // Daily Monster Hunt
  3. //======Version=====================================
  4. // 1.2
  5. //======Author(s)===================================
  6. // Sandbox
  7. //======Comments====================================
  8. // This NPC allows your player to hunt a random amount
  9. // of a random monster, within a random time
  10. // *randomception!*
  11. // If the player successfully hunts the monster
  12. // within the time limit, he'll receive a reward!
  13. //======Credits=====================================
  14. // KeyWorld, nanakiwurtz, NeoMind, Kido
  15. // Thanks for helping me out guize!
  16. //==================================================
  17.  
  18. invek,134,163,6 script  Daily Monsters Hunt 924,{
  19.  
  20. mes .Npc_Name$;
  21.     if(Hunter2) {
  22.     mes "You have killed ^880000"+HuntCount2+"^000000/^0000FF"+Amt
  23.  
  24. +"^000000 "+getmonsterinfo(Hunt2,0)+"s, keep it up!";
  25.     close;
  26.     }
  27.     if(gettimetick(2) < #HuntDelay2) {
  28.         mes "You can only do this quest once a day!";
  29.         close;
  30.     }
  31.  
  32. mes "Hello, do you want to take on the Monster Hunting Challenge?","I will give you a random time limit to kill 100 x monsters, If you manage to kill them within the given time, you'll receive 10 x GaiaRO Token!";
  33. if(select("Bring it on!:How about no?")==2) {
  34.     mes .Npc_Name$;
  35.     mes "Fine!";
  36.     close;
  37. }
  38.  
  39. next;
  40. mes .Npc_Name$;
  41.     Hunt2 = .Mob_List[rand(getarraysize(.Mob_List))];
  42.     Time = rand(86400,86400); //Timer
  43.     Amt = rand (100,100); //Amount of mob to hunt
  44.     Hunter2++;
  45.  
  46. mes "You have to hunt ^0000FF"+Amt+" "+getmonsterinfo(Hunt2,0)+"^000000 in ^AA0000"+Time+"^000000 seconds!";
  47. next;
  48. mes .Npc_Name$;
  49. mes "Go go go!";
  50. close2;
  51.     showdigit Time,3;
  52.     #HuntDelay2 = gettimetick(2)+86400; //Once a day only.
  53.     HuntStart2 = gettimetick(2)+Time;
  54. sleep2 1000*Time;
  55.     if(Hunter2) dispbottom strnpcinfo(1)+": I'm sorry, you didn't make it!";
  56.     HuntStart2 = 0; //Reset all variables
  57.     Hunt2 = 0;
  58.     Hunter2 = 0;
  59.     HuntCount2 = 0;
  60.     Time = 0;
  61.     Amt = 0;
  62. end;
  63.  
  64. OnClock0000:
  65.     query_sql( "DELETE FROM `char_reg_num` WHERE `key` LIKE 'Hunt%' OR `key` LIKE 'Time' OR `key` LIKE 'Amt' OR `key` LIKE '#HuntDelay2'" );
  66.     addrid(0);
  67.     HuntStart2 = 0;
  68.     Hunt2 = 0;
  69.     Hunter2 = 0;
  70.     HuntCount2 = 0;
  71.     Time = 0;
  72.     Amt = 0;
  73.     showdigit 1,3;
  74.     #HuntDelay2 = 0;
  75.     end;
  76.    
  77.  
  78. //----------Config----------
  79.  
  80. OnInit:
  81.     .Npc_Name$ = "[^0000FF NPC ^000000]";
  82.     setarray .Mob_List[0],1002,1007,1063; //Mobs to hunt. Default: Poring, Fabre, Lunatic
  83.     .Reward = 7606; //Reward ID
  84.     .RewAmt = 10; //Reward Amount
  85.     end;
  86.  
  87. OnNPCKillEvent:
  88.     if(Hunter2 > 0) {
  89.         if(gettimetick(2) < HuntStart2) {
  90.             if(killedrid == Hunt2) {
  91.                 HuntCount2++;
  92.                 dispbottom "You have killed "+HuntCount2+"/"+Amt+" "+getmonsterinfo(Hunt2,0)+"s, keep it up!";
  93.                 if(HuntCount2 >= Amt) {
  94.                     dispbottom strnpcinfo(1)+": Congratulations! You did it!";
  95.                     getitem .Reward,.RewAmt;
  96.                     HuntStart2 = 0;
  97.                     Hunt2 = 0;
  98.                     Hunter2 = 0;
  99.                     HuntCount2 = 0;
  100.                     Time = 0;
  101.                     Amt = 0;
  102.                     showdigit 1,3;
  103.                 }
  104.             }
  105.         }
  106.     }
  107. end;
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement