johnlol

mvp_kill

May 22nd, 2019
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // =================== MVP KILL ===============
  2. // ====== MVP will drop an item only ==========
  3. // ====== at specific maps. ===================
  4. // ====== if players are on a party ===========
  5. // ====== item will be given randomly =========
  6. // ====== to any online party members =========
  7. // ============== by : pajodex ================
  8. // ==== Additional Comments: ==================
  9. // 1.0 - Initial release (MVP Kill standalone)
  10. // 1.1 - used setarray function to optimize script
  11. // 1.2 - Added modified Euphy MVP ladder
  12. //       slight rework on the script
  13. // 1.3 - Fixed on reset function (Report by: celeron0134)
  14. // ============================================
  15. -   script  #mvp_kill   -1,{
  16.  
  17. OnInit:
  18.     setarray .p_rwd, 7539,1;    // Party reward <item>,<amount>
  19.     setarray .s_rwd, 7227,1;    // Solo reward <item>,<amount>
  20.     .chance = 50;   // Drop rate chances %
  21.     .gm = 10;  // Prevents gm level and above to trigger the event
  22.     // MVP Map list
  23.     setarray .t_maps$[0],"moc_pryd06","lhz_dun03","gld2_prt","abbey02","ayo_dun02","lhz_dun04","ra_fild02","xmas_fild01","dic_dun02","beach_dun","iz_dun05","tur_dun04","lhz_dun02","jupe_core","moc_fild22","anthell02","odin_tem03","gon_dun03","gef_fild02","thana_boss","gef_fild10","ein_dun02","gef_fild14","moc_pryd04","dew_dun01","in_sphinx5","niflheim","moc_fild17","xmas_dun02","ice_dun03","kh_dun02","treasure02","moc_prydn2","pay_dun04","ra_san05","mosk_dun03","ama_dun03","thor_v03","gef_dun01","mjolnir_04","abyss_03","dic_dun03","prt_sewb4","pay_fild11","gef_dun02","gl_chyard","ra_fild03","ra_fild04","ve_fild01","ve_fild02","lou_dun03","prt_maze03","bra_dun02";
  24.     end;
  25.  
  26. OnNPCKillEvent:
  27. if (getgmlevel() >= .gm ) end; // If gm = event wont happen
  28. if ( getmonsterinfo( killedrid, MOB_MVPEXP )) {
  29.     for (.@a = 0; .@a < getarraysize(.t_maps$); .@a++) {
  30.     if ( strcharinfo(3) == instance_mapname("06guild_01") ) end;
  31.     if ( strcharinfo(3) == instance_mapname("force_1-1") ) end;
  32.     if ( strcharinfo(3) == .t_maps$[.@a]) {
  33.             if ( getcharid(1) ) {
  34.                 getpartymember getcharid(1), 1;
  35.                 getpartymember getcharid(1), 2;
  36.                 for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
  37.                     if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
  38.                         .@partymemberaid[.@c] = $@partymemberaid[.@i];
  39.                         .@c++;
  40.                     }
  41.                 }
  42.                 if (rand(100) < .chance) getitem .p_rwd[0], .p_rwd[1], .@partymemberaid[ rand( .@c ) ];
  43.                 announce "[ System ] : Player ["+ strcharinfo(0) +"] of party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), bc_all;
  44.             }
  45.             else {
  46.                 if (rand(100) < .chance) getitem .s_rwd[0], .s_rwd[1];
  47.                 announce "[ System ] : Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" alone at "+ strcharinfo(3), bc_all;
  48.             }
  49.         MVPKills = MVPKills+1;
  50.         dispbottom "---------------------------------------------------";
  51.         dispbottom "You killed a total of "+MVPKills+" MVP"+((MVPKills == 1)?"":"s")+".";
  52.         dispbottom "---------------------------------------------------";
  53.         end;
  54.         }
  55.     }
  56.     if ( getcharid(1) ) {
  57.         announce "[ System ] : Player ["+ strcharinfo(0) +"] of party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), bc_all;
  58.         }
  59.         else {
  60.         announce "[ System ] : Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" alone at "+ strcharinfo(3), bc_all;
  61.         }
  62.     end;
  63.     }
  64.  
  65.    
  66. }
  67. prontera,164,175,3  script  MVP Ladder#Euphy    891,{
  68.     mes "[Rank ^B22222M^228B22V^7B68EEP^000000^000000^000000]";
  69.     mes "Hello.";
  70.     mes "What are you doing here";
  71.     next;
  72.     switch(select("Check ^191970Ranking^000000.",   "^228B22My^000000 stats.",( getgmlevel() >= 99 ) ? "^8B0000RESET^000000":"","^8B4513Nothing^000000...")) {
  73.         case 1:
  74.             mes "[Rank ^B22222M^228B22V^7B68EEP^000000^000000^000000]";
  75.             query_sql("SELECT char_id, CAST(`value` AS SIGNED) FROM `char_reg_num` WHERE `key` = 'MVPKills' ORDER BY CAST(`value` AS SIGNED) DESC LIMIT 20",.@cid,.@value);
  76.             for(set .@i,0; .@i<getarraysize(.@cid); set .@i,.@i+1) {
  77.                 query_sql("SELECT `name` FROM `char` WHERE char_id = "+.@cid[.@i]+";",.@j$);
  78.                 set .@name$[.@i], .@j$;
  79.             }
  80.             if (!getarraysize(.@cid))
  81.                 mes "The rankings are empty.";
  82.             else for(set .@i,0; .@i<getarraysize(.@cid); set .@i,.@i+1)
  83.             mes "[^FF4500"+(.@i+1)+"^000000] ^808000"+.@name$[.@i]+"^000000 ^696969~^000000 ^FF4500"+.@value[.@i]+"^000000 kills";
  84.             close;
  85.            
  86.         case 2:
  87.             mes "[Rank ^B22222M^228B22V^7B68EEP^000000^000000^000000]";
  88.             mes "You killed "+((MVPKills)?"^FFD700"+MVPKills:"no")+"^000000 ^B22222M^228B22V^7B68EEP^000000^000000^000000"+((MVPKills == 1)?".":"s.");
  89.             close;
  90.         case 3:
  91.             if ( select( "Confirm","Cancel" ) == 1 ) {
  92.                 query_sql("UPDATE `char_reg_num` SET `value` = '0' WHERE `key` ='MVPKills'");
  93.                 addrid(0);
  94.                 MVPKills = 0;
  95.             }
  96.             close;
  97.         default:       
  98.             close;
  99.     }
  100.    
  101. OnInit:
  102.         waitingroom "MVP LADDER!",0;
  103.         end;
  104. }
Add Comment
Please, Sign In to add comment