Advertisement
plugandplaydev

Race of The Day

Jun 2nd, 2015
487
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.50 KB | None | 0 0
  1. prontera,155,181,5 script ROTD 436,{
  2. set .@gmlevel,getgmlevel();
  3.  
  4. do{
  5. set .@menu,select("^4EEE94ROTD Information^000000",
  6. ( .@gmlevel < .gm_level )?"":"^FF0000[GM]^000000Set a New Monster's Race",
  7. ( .@gmlevel < .gm_level )?"":"^FF0000[GM]^000000Set EXP Bonus",
  8. ( .@gmlevel < .gm_level )?"":"^FF0000[GM]^000000Set Item / Zeny Bonus",
  9. "Close" );
  10.  
  11. switch( .@menu ) {
  12. case 1:
  13. mes "^FF0000ROTD^000000 refer to ^0000FFRace of the Day^000000";
  14. mes "In another word, it mean that the ^FF0000Monster's Race^000000 that you killed by day will grant you ^FF0000Extra Bonus EXP / Item / Zeny ^000000.";
  15. next;
  16. mes "[ ^FF0000Today's ROTD^000000 ]";
  17. mes "^0000FF"+.rotd$[.today_rotd]+"^000000 Race";
  18. if ( .rotd_exp_bonus ) mes " ~ ^777777"+.rotd_exp_bonus+"% more exp^000000";
  19. if ( ( .rotd_item_amount && .rotd_item_rate ) || .rotd_zeny || .rotd_exp_bonus ) {
  20. mes " ";
  21. mes "Reward : "+( ( .rotd_item_rate )? .rotd_item_rate+"%":"" )+" : ";
  22. if ( .rotd_item_amount && .rotd_item_rate ) mes " ~ ^777777"+.rotd_item_amount+" x "+getitemname( .rotd_item_id )+"^000000";
  23. if ( .rotd_zeny ) mes " ~ ^777777"+.rotd_zeny+" Zeny^000000";
  24. mes " ";
  25. mes "Amount are random...";
  26. }
  27. break;
  28. case 2:
  29. mes "Select new race.";
  30. set .today_rotd,select( .rotd_menu$ ) - 1;
  31. if ( .today_rotd >= .rotd_size ) set .today_rotd,rand( .rotd_size );
  32. mes "New Race : ^777777"+.rotd$[.today_rotd]+"^000000";
  33. delwaitingroom;
  34. waitingroom "[ROTD]:"+.rotd$[.today_rotd]+" ",0;
  35. break;
  36. case 3:
  37. mes "Set new exp bonus. (%)";
  38. input .rotd_exp_bonus,0,100;
  39. if ( .rotd_exp_bonus ) mes "ROTD EXP : "+.rotd_exp_bonus+" %";
  40. break;
  41. case 4:
  42. mes "Set Rotd bonus";
  43. mes "Inset Zeny Bonus";
  44. input .@zeny;
  45. mes "Insert Item ID";
  46. do{
  47. input .@item,0,32767;
  48. if ( !.@item ) close;
  49. }while( getitemname( .@item ) == "null" );
  50. mes "Enter amount.";
  51. input .@amount,0,30000;
  52. mes "Enter Rate to gain.";
  53. input .@rate,0,100;
  54. if ( .@amount && .@rate ) {
  55. next;
  56. mes "Updated item bonus : ( "+.@rate+"% )";
  57. mes "^777777"+.@amount+" x "+getitemname( .@item )+"^000000";
  58. mes "^777777"+.@zeny+" Zeny^000000";
  59. if ( select( "Confirm","Cancel" ) == 1 ) {
  60. set .rotd_item_id,.@item;
  61. set .rotd_item_amount,.@amount;
  62. set .rotd_item_rate,.@rate;
  63. set .rotd_zeny,.@zeny;
  64. mes "Updated.";
  65. }
  66. }
  67. default: close;
  68. }
  69. next;
  70. }while( .@menu != 5 );
  71. close;
  72.  
  73. OnInit:
  74. // min gm level
  75. set .gm_level,80;
  76.  
  77. // monster race list
  78. setarray .rotd$[0],
  79. "Formless",
  80. "Undead",
  81. "Brute",
  82. "Plant",
  83. "Insect",
  84. "Fish",
  85. "Demon",
  86. "Demi Human",
  87. "Angel",
  88. "Dragon",
  89. "Boss",
  90. "Non-Boss";
  91. set .rotd_size,getarraysize( .rotd$ );
  92. for( set .@i,0; .@i < .rotd_size; set .@i,.@i + 1 )
  93. set .rotd_menu$,.rotd_menu$ + .rotd$[.@i] +":";
  94. set .rotd_menu$,.rotd_menu$ + "^0055FFRandom Race^000000";
  95.  
  96. // min party member lv to gain exp
  97. set .party_level_range,10;
  98.  
  99. // daily reset
  100. OnClock0000:
  101. set .today_rotd,rand( .rotd_size );
  102. set .rotd_exp_bonus,rand( 1,100 );
  103. delwaitingroom;
  104. waitingroom "[ROTD]:"+.rotd$[.today_rotd]+" ",0;
  105. end;
  106.  
  107. OnNPCKillEvent:
  108. if ( getmonsterinfo( killedrid,MOB_RACE ) == .today_rotd ) {
  109. set .@partyid,getcharid(1);
  110. set .@mob_base_exp,(( getmonsterinfo( killedrid,MOB_BASEEXP ) / 100 ) * .rotd_exp_bonus );
  111. set .@mob_job_exp,(( getmonsterinfo( killedrid,MOB_JOBEXP ) / 100 ) * .rotd_exp_bonus );
  112. if ( .@partyid ) {
  113. set .@aid,getcharid(3);
  114. set .@baselevel,BaseLevel;
  115. set .@map$,strcharinfo(3);
  116. getpartymember .@partyid,1;
  117. getpartymember .@partyid,2;
  118. while( .@i < $@partymembercount ) {
  119. if ( isloggedin( $@partymemberaid[.@i],$@partymembercid[.@i] ) )
  120. if ( attachrid( $@partymemberaid[.@i] ) )
  121. if ( strcharinfo(3) == .@map$ && ( BaseLevel - .@baselevel ) <= .party_level_range && ( BaseLevel - .@baselevel ) >= ~.party_level_range && Hp >= 1 ) {
  122. set BaseExp,( BaseExp + .@mob_base_exp );
  123. set JobExp,( JobExp + .@mob_job_exp );
  124. dispbottom "[ROTD Party] : "+.@mob_base_exp+" EXP";
  125. }
  126. set .@i,.@i + 1;
  127. }
  128. attachrid( .@aid );
  129. }
  130. else {
  131. set BaseExp,( BaseExp + .@mob_base_exp );
  132. set JobExp,( JobExp + .@mob_job_exp );
  133. dispbottom "[ROTD SOLO] : "+.@mob_base_exp+" EXP";
  134. }
  135. if ( rand( 100 ) < .rotd_item_rate && .rotd_zeny )
  136. set Zeny,Zeny + rand( .rotd_zeny );
  137. if ( rand( 100 ) < .rotd_item_rate && .rotd_item_amount )
  138. getitem .rotd_item_id,rand( .rotd_item_amount ),.@aid;
  139. }
  140. end;
  141. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement