Jump to content
  • 0

Custom PVP Points


GM Winter

Question


  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.14
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

hello i would like to ask if theres any change that only in the specific map they will get fame points in pvp ranking

heres the Script:

 

// https://rathena.org/board/topic/107986-requesting-for-a-pvp-ranking-w-reset/

/*
ALTER TABLE `char` ADD `pvp_kill` INT(11) UNSIGNED NOT NULL DEFAULT '0'  AFTER `fame`;
*/

prontera,146,103,5    script    PVP Warper    753,{
    doevent "pvp_rank_main::OnTalk";
}

-    script    pvp_rank_main    -1,{

    OnTalk:
        mes "[PvP Room Master]";
        mes "Where do you wanna go?";
        next;
        switch ( select ( 
            "Izlude",
            "Prontera",
            "Death Match",
            "PVP Ranking",
            ( getgmlevel() >= 99 ) ? "^FF0000[GM] Reset PVP Ranking^000000":""
        )) {
    case 1:    // Izlude PVP Room
        if (getmapusers("pvp_y_1-2") > 99) callsub S_full;
        if (BaseLevel <98) { 
        mes "Excuse me, but";
        mes "did you not come prepared?";
        mes "you need to be";
        mes "atleast level 98 above!";
        close;
        }
        warp "pvp_y_1-2",0,0;
        announce ""+strcharinfo(0)+" entered Izlude PVP ROOM !",bc_all,0xCCFFFF;
        end;
        
    case 2:    // Prontera PVP Rooom
        if (getmapusers("prt_pvp") > 99) callsub S_full;
        if (BaseLevel <98) { 
        mes "Excuse me, but";
        mes "did you not come prepared?";
        mes "you need to be";
        mes "atleast level 98 above!";
        close;
        }
        warp "prt_pvp",0,0;
        announce ""+strcharinfo(0)+" entered Prontera PVP ROOM !",bc_all,0xCCFFFF;
        end;

    case 3:    // Death Match Arena
        if (getmapusers("bat_cc2") > 99) callsub S_full;
        if (BaseLevel <98) { 
        mes "Excuse me, but";
        mes "did you not come prepared?";
        mes "you need to be";
        mes "atleast level 98 above!";
        close;
        }    
        warp "bat_cc2",0,0;
        announce ""+strcharinfo(0)+" entered Death Match Arena !",bc_all,0xCCFFFF;
        end;
        
            default:
                mes "[PvP Room Master]";
                mes "PVP Ranking";
                query_sql( "SELECT `name`,`pvp_kill` FROM `char` WHERE `pvp_kill` > 0 ORDER BY `pvp_kill` DESC LIMIT 10", .@name$, .@pvp_kill );
                .@size = getarraysize( .@name$ );
                for ( .@i = 0; .@i < .@size; .@i++ ) {
                    mes "["+(.@i + 1 )+"] "+.@name$[.@i]+" - "+.@pvp_kill[.@i]+" kill(s)";
                }
                break;
            case 5:
                mes "[PvP Room Master]";
                mes "Reset Ranking? Action cant be undo. Confirm your action.";
                if ( select( "Confirm","Cancel" ) == 1 ) {
                    query_sql( "UPDATE `char` SET `pvp_kill` = 0 WHERE `pvp_kill` > 0" );
                    mes "Done.";
                }
                break;
        }
        close;
    
    L_Enter:
        .@title$ = getarg( 0,"" );
        .@map$ = getarg( 1,"" );
        .@max_player = getarg( 2,0 );
        .@getmapusers = getmapusers( .@map$ );
        
        mes "[PvP Room Master]";
        if ( .@getmapusers == -1 ) {
            mes "Invalid map.";
        }
        else if ( .@max_player > 0 && .@getmapusers >= .@max_player ) {
            mes "I'm sorry but the PVP Room is already full!";
        }
        else {
            mes .@title$ + " ["+.@getmapusers+"/"+.@max_player+"]";
            if ( select( "Enter" ) == 1 ) {
                warp .@map$,0,0;
            }
        }
        return;
        
    OnPCKillEvent:
        if ( getcharid(3) != killedrid ) {
            query_sql( "UPDATE `char` SET `pvp_kill` = `pvp_kill` + 1 WHERE `char_id` = "+getcharid(0)+" LIMIT 1" );
        }
        end;
OnInit:
OnTimer0050:
        showscript "PVP Warper", getnpcid(0);
        initnpctimer;
        end;
}


// PvP Room ----------------------------------------------
prontera,146,164,5    duplicate(PVP Warper)    PVP Warper#prt    753

 

Edited by Mael
Use codebox
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  241
  • Reputation:   18
  • Joined:  06/04/14
  • Last Seen:  

On 7/15/2021 at 3:03 PM, chadness said:

hello i would like to ask if theres any change that only in the specific map they will get fame points in pvp ranking

heres the Script:

 

// https://rathena.org/board/topic/107986-requesting-for-a-pvp-ranking-w-reset/


/*
ALTER TABLE `char` ADD `pvp_kill` INT(11) UNSIGNED NOT NULL DEFAULT '0'  AFTER `fame`;
*/

prontera,146,103,5    script    PVP Warper    753,{
    doevent "pvp_rank_main::OnTalk";
}

-    script    pvp_rank_main    -1,{

    OnTalk:
        mes "[PvP Room Master]";
        mes "Where do you wanna go?";
        next;
        switch ( select ( 
            "Izlude",
            "Prontera",
            "Death Match",
            "PVP Ranking",
            ( getgmlevel() >= 99 ) ? "^FF0000[GM] Reset PVP Ranking^000000":""
        )) {
    case 1:    // Izlude PVP Room
        if (getmapusers("pvp_y_1-2") > 99) callsub S_full;
        if (BaseLevel <98) { 
        mes "Excuse me, but";
        mes "did you not come prepared?";
        mes "you need to be";
        mes "atleast level 98 above!";
        close;
        }
        warp "pvp_y_1-2",0,0;
        announce ""+strcharinfo(0)+" entered Izlude PVP ROOM !",bc_all,0xCCFFFF;
        end;
        
    case 2:    // Prontera PVP Rooom
        if (getmapusers("prt_pvp") > 99) callsub S_full;
        if (BaseLevel <98) { 
        mes "Excuse me, but";
        mes "did you not come prepared?";
        mes "you need to be";
        mes "atleast level 98 above!";
        close;
        }
        warp "prt_pvp",0,0;
        announce ""+strcharinfo(0)+" entered Prontera PVP ROOM !",bc_all,0xCCFFFF;
        end;

    case 3:    // Death Match Arena
        if (getmapusers("bat_cc2") > 99) callsub S_full;
        if (BaseLevel <98) { 
        mes "Excuse me, but";
        mes "did you not come prepared?";
        mes "you need to be";
        mes "atleast level 98 above!";
        close;
        }    
        warp "bat_cc2",0,0;
        announce ""+strcharinfo(0)+" entered Death Match Arena !",bc_all,0xCCFFFF;
        end;
        
            default:
                mes "[PvP Room Master]";
                mes "PVP Ranking";
                query_sql( "SELECT `name`,`pvp_kill` FROM `char` WHERE `pvp_kill` > 0 ORDER BY `pvp_kill` DESC LIMIT 10", .@name$, .@pvp_kill );
                .@size = getarraysize( .@name$ );
                for ( .@i = 0; .@i < .@size; .@i++ ) {
                    mes "["+(.@i + 1 )+"] "+.@name$[.@i]+" - "+.@pvp_kill[.@i]+" kill(s)";
                }
                break;
            case 5:
                mes "[PvP Room Master]";
                mes "Reset Ranking? Action cant be undo. Confirm your action.";
                if ( select( "Confirm","Cancel" ) == 1 ) {
                    query_sql( "UPDATE `char` SET `pvp_kill` = 0 WHERE `pvp_kill` > 0" );
                    mes "Done.";
                }
                break;
        }
        close;
    
    L_Enter:
        .@title$ = getarg( 0,"" );
        .@map$ = getarg( 1,"" );
        .@max_player = getarg( 2,0 );
        .@getmapusers = getmapusers( .@map$ );
        
        mes "[PvP Room Master]";
        if ( .@getmapusers == -1 ) {
            mes "Invalid map.";
        }
        else if ( .@max_player > 0 && .@getmapusers >= .@max_player ) {
            mes "I'm sorry but the PVP Room is already full!";
        }
        else {
            mes .@title$ + " ["+.@getmapusers+"/"+.@max_player+"]";
            if ( select( "Enter" ) == 1 ) {
                warp .@map$,0,0;
            }
        }
        return;
        
    OnPCKillEvent:
        if ( getcharid(3) != killedrid ) {
            query_sql( "UPDATE `char` SET `pvp_kill` = `pvp_kill` + 1 WHERE `char_id` = "+getcharid(0)+" LIMIT 1" );
        }
        end;
OnInit:
OnTimer0050:
        showscript "PVP Warper", getnpcid(0);
        initnpctimer;
        end;
}


// PvP Room ----------------------------------------------
prontera,146,164,5    duplicate(PVP Warper)    PVP Warper#prt    753

 

OnPCKillEvent:

if(strcharinfo(3) != .map$ ) end;

I think this will give you an idea already.

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.14
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

ow now i remember thanks buds

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  241
  • Reputation:   18
  • Joined:  06/04/14
  • Last Seen:  

On 7/18/2021 at 8:05 AM, chadness said:

ow now i remember thanks buds

You're welcome Mate!

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...