Advertisement
hendra814

MVP Check by NPC

Feb 12th, 2018
423
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.26 KB | None | 0 0
  1. prontera,143,165,4 script MVP Convex Mirror 10233,{
  2.  
  3. for( .@i = 0; .@i < getarraysize( $MVP_MobID ); .@i++ ) {
  4. if($MVP_Status[.@i] == 2){
  5. .status$[.@i] = "^008000ALIVE^000000";
  6. } else .status$[.@i] = "^ff0000DEAD^000000";
  7. mes ""+getmonsterinfo($MVP_MobID[.@i],MOB_NAME)+"" + "^000000 (^008080" + $MVP_Maps$[.@i] + "^000000) "+.status$[.@i]+"";
  8. }
  9.  
  10. OnNPCKillEvent:
  11. if( getmonsterinfo(killedrid, MOB_MVPEXP) > 0 )
  12. for( set .@i,0; .@i < getarraysize($MVP_MobID); set .@i, .@i+1 )
  13. {
  14. if( (killedrid == $MVP_MobID[.@i]) && (strcharinfo(3) == $MVP_Maps$[.@i])) {
  15. $MVP_Status[.@i] = 1;
  16. $MVP_TimeStamp[.@i] = gettimetick(2);
  17. }
  18. }
  19. end;
  20.  
  21. OnInit:
  22. setarray $MVP_MobID[0],1511,1785,1785,1785,1785,1785,1630,1039,1039,
  23. 1873,2068,1272,1272,1719,1046,1046,1389,1112,1115,1418,
  24. 1871,1252,2253,2251,1768,1086,2165,1885,1832,1492,2255,
  25. 1734,2442,1251,2202,1688,2156,1373,1147,1147,1059,1059,1150,
  26. 1150,2362,1087,1190,1038,1157,1159,1623,2249,2087,1583,
  27. 2441,3074,1312,1751,1685,1658;
  28.  
  29. setarray $MVP_Maps$[0],"moc_pryd06","gld_dun03","ra_fild03","ra_fild04","ve_fild01","ve_fild02","lou_dun03","gld_dun03","prt_maze03",
  30. "abbey03","bra_dun02","gl_chyard","gld_dun04","abyss_03","gef_dun02","gld_dun04","gef_dun01","treasure02","pay_fild10","gon_dun03",
  31. "abbey02","xmas_fild01","gld2_pay","gld2_ald","ra_san05","prt_sewb4","dic_dun03","mosk_dun03","thor_v03","ama_dun03","gld2_gef",
  32. "kh_dun02","teg_dun02","xmas_dun02","iz_dun05","ayo_dun02","dew_dun01","niflheim","gld_dun02","anthell02","gld_dun02","mjolnir_04","pay_dun04",
  33. "gld_dun01","moc_prydn2","gef_fild03","gef_fild10","moc_pryd04","in_sphinx5","moc_fild17","ein_dun02","gld2_prt","dic_dun02","beach_dun",
  34. "teg_dun01","c_tower3_","tur_dun04","odin_tem03","jupe_core","lhz_dun02";
  35.  
  36. setarray $MVP_ResTime[0],60,480,180,300,180,360,117,480,120,
  37. 720,120,60,480,180,120,480,60,120,120,95,
  38. 120,120,480,480,300,60,120,120,660,91,480,
  39. 120,120,60,120,420,120,133,480,120,480,120,60,
  40. 480,60,60,120,60,60,120,125,480,120,300,
  41. 480,120,60,480,120,120;
  42.  
  43. //Respawn only undead MVP's on server start or reload
  44. for( set .@i,0; .@i < getarraysize($MVP_MobID); set .@i, .@i+1 )
  45. {
  46. //check whether MPV is alive or $MVP_Status variable is not yet set.
  47. //1 - Dead, 2 - Alive
  48. if ( $MVP_Status[.@i] == 2 || $MVP_Status[.@i] == 0 || $MVP_TimeStamp[.@i] == 0 ) {
  49. //monster $MVP_maps$[.@i],0,0,"--ja--",$MVP_MobID[.@i],1;
  50. $MVP_Status[.@i] = 2;
  51. } else { // don't respawn MVP and wait for next spawn time
  52. $MVP_Status[.@i] = 1;
  53. }
  54. }
  55.  
  56. startnpctimer;
  57. OnTimer60000: //check every 60 seconds
  58. for( set .@i,0; .@i < getarraysize($MVP_MobID); set .@i, .@i+1 )
  59. {
  60. set .@time, $MVP_ResTime[.@i]*60;
  61. if( ($MVP_TimeStamp[.@i] + .@time) <= gettimetick(2) && $MVP_Status[.@i] == 1 ) {
  62. //monster $MVP_Maps$[.@i],0,0,"--ja--",$MVP_MobID[.@i],1;
  63. //Defines last respawn
  64. $MVP_TimeStamp[.@i] = gettimetick(2);
  65. $MVP_Status[.@i] = 2;
  66. }
  67. }
  68. setnpctimer 0;
  69. end;
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement