Jump to content
  • 0

Little help here at my mvp rank


UncleBobby

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  7
  • Reputation:   0
  • Joined:  09/29/19
  • Last Seen:  

// =================== MVP KILL ===============
// ====== MVP will drop an item only ==========
// ====== at specific maps. ===================
// ====== if players are on a party ===========
// ====== item will be given randomly =========
// ====== to any online party members =========
// ============== by : pajodex ================
// ==== Additional Comments: ==================
// 1.0 - Initial release (MVP Kill standalone)
// 1.1 - used setarray function to optimize script
// 1.2 - Added modified Euphy MVP ladder
//         slight rework on the script
// 1.3 - Fixed on reset function (Report by: celeron0134)
// 2.0 - Revision to work on latest server file (2023)
//          Removed 'drop chance%'
//          Added 'reward option'
//          Script clean-up
// ============================================
-    script    #mvp_kill    -1,{

OnInit:
    // 0 = disabled
    // 1 = killer only
    // 2 = (on party) randomly to party member online
    // 3 = (on party) to all members online
    .reward_option = 0;

    // Item reward list
    // can add more than 1 items
    // <item>, <id>
    setarray .reward, 
        607,1;

    // Enable announcement?
    .announce = true;

    // Prevents gm level and above to trigger the event
    .gm = 99;  

    // MVP Map list
    setarray .map$,
        "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";
    end;

OnNPCKillEvent:
    if( getmonsterinfo( killedrid,MOB_MVPEXP ) )
    query_sql( "INSERT INTO `MVPRANK` SET `char_id`='"+getcharid(0)+"',`name`='"+strcharinfo(0)+"',`Count`='1' ON DUPLICATE KEY UPDATE `Count`=`Count`+1" );
    if (getgmlevel() >= .gm ) end;
    if ( getmonsterinfo(killedrid, MOB_MVPEXP) && inarray(.map$, strcharinfo(3)) != -1 ) {
        if ( getcharid(1) ) {
            getpartymember getcharid(1), 1;
            getpartymember getcharid(1), 2;
            for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
                if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
                    if (.reward_option == 2) {
                        .@partymemberaid[.@c] = $@partymemberaid[.@i];
                        .@c++;
                    } else if (.reward_option == 3) {
                        for ( .@r = 0; .@r < getarraysize(.reward); .@r+= 2 )
                            getitem .reward[.@r], .reward[.@r+1];
                    }
                }
            }
            if (.reward_option == 2) {
                for ( .@r = 0; .@r < getarraysize(.reward); .@r+= 2 )
                    getitem .reward[.@r], .reward[.@r+1], .@partymemberaid[ rand( .@c ) ];
            }
        }
        else {
            if (.reward_option) {
                for ( .@r = 0; .@r < getarraysize(.reward); .@r+= 2 )
                    getitem .reward[.@r], .reward[.@r+1];
            }
        }
        if (.announce) 
            announce "[ System ] : Player ["+ strcharinfo(0) +"] "+ ( getcharid(1) ? "of party ["+ strcharinfo(1) +"]":"" ) +" has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), bc_all;
        Count++;
        dispbottom "---------------------------------------------------";
        dispbottom "You've killed a MvP your points is recorded";
        dispbottom "---------------------------------------------------";
    }
    end;
}

prontera,140,204,5    script    MVP Ladder#Euphy    653,{
    mes "[MVP Kills Rank]";
    mes "Hello.";
    mes "What are you doing here";
    next;
    switch(select("Check Ranking.",    "My stats.",( getgmlevel() >= 99 ) ? "RESET POINTS":"","Nothing...")) {
        case 1:
            mes "[Rank MVP]";
            if(!query_sql( "SELECT `name`,`Count` FROM `MVPRANK` ORDER BY `Count` DESC LIMIT 5",.@Name$,.@Count )) {
                mes "The rankings are empty.";
                close;
            }
            if( getarraysize( .@Name$ ) ){
            for( set .@i,0; .@i < getarraysize( .@Name$ ); set .@i,.@i + 1 )
            mes "[ "+( .@i + 1 )+". ] "+.@Name$[.@i]+" - "+.@Count[.@i]+" Points";
            break;
}

        case 2:
            mes "[Rank MVP]";
            mes "MVP Killed: "+ Count;
            end;
        case 3:
            if ( select( "Confirm","Cancel" ) == 1 ) {
                query_sql "UPDATE `MVPRANK` SET `Count` = IF(`Count` = 0, 0, `Count` - 1) = "+ getcharid(0);
                addrid(0);
}
            end;
        default:        
            end;
    }

OnInit:
    initnpctimer;
    end;
OnTimer1000:
    showscript("MvP Ladder");
    setnpctimer 0;
    end;
}

this script is fully working on my server however the MVP counts kills while using bloody branch... is there's a way to avoid that count using BB?

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

add this to your npc script

OnBloodyBranch:
    dispbottom "MVP from bloody branch aren't included as part of mvp rank";
	end;

update your item_db

    Script: |
      monster "this",-1,-1,"--ja--",-1-MOBG_BLOODY_DEAD_BRANCH,1,"#mvp_kill::OnBloodyBranch";

 

  • Love 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...