Jump to content
  • 0

Requesting for a PVP Ranking w/ Reset.


Question

Posted (edited)

As the title says, i want to add pvp ranking w/ reset (GM 99 Only can reset) in my pvp room script.

 

Here's the script.

morocc,154,113,6	script	PvP Room	615,{

	.@pvpmap1$ = "Izlude (Berry/Seed - ALLOWED) ["+getmapusers("pvp_y_1-2")+"/30]";
	if( getmapusers("pvp_y_1-2") >= 30 ) { mes "[PvP Room Master]", "I'm sorry but the PVP Room is already full!"; close; }
	.@pvpmap2$ = "Izlude (x Berry/Seed) ["+getmapusers("pvp_y_2-2")+"/30]";
	if( getmapusers("pvp_y_2-2") >= 30 ) { mes "[PvP Room Master]", "I'm sorry but the PVP Room is already full!"; close; }
	mes "Where do you wanna go?";
	next;
	switch (select(.@pvpmap1$,	.@pvpmap2$)) {
	case 1:
	announce strcharinfo(0)+" has joined Izlude (PVP, Berry/Seed - ALLOWED).",bc_all;
		warp "pvp_y_1-2",0,0;
		end;
	case 2:
	announce strcharinfo(0)+" has joined Izlude (x Berry/Seed).",bc_all;
		warp "pvp_y_2-2",0,0;
		end;
	case 3:
	announce strcharinfo(0)+" has joined Morocc Deathmatch (x Berry/Seed).",bc_all;
		warp "pvp_y_1-5",0,0;
		end;
		

OnInit:
waitingroom "PVP Room",0;
end;
	}
}



// PvP Room ----------------------------------------------
morocc,171,250,4	duplicate(PvP Room)	PvP Room#d2	615
louyang,225,98,3	duplicate(PvP Room)	PvP Room#d3	615
payon,167,234,3	duplicate(PvP Room)	PvP Room#d4	615
gonryun,170,142,3	duplicate(PvP Room)	PvP Room#d5	615
aldebaran,146,116,3	duplicate(PvP Room)	PvP Room#d6	615
ayothaya,161,159,3	duplicate(PvP Room)	PvP Room#d7	615
xmas,154,126,3	duplicate(PvP Room)	PvP Room#d8	615

Dont want to use GHOST PVP LADDER, because it has bug.

Edited by Deviszh

3 answers to this question

Recommended Posts

  • 0
Posted
On 11/28/2016 at 3:48 AM, Emistry said:

hello sir emistry im trying your script i had a problem in sql files 

this is the error 
 

Quote

[SQL]: DB error - Unknown column 'pvp_kill' in 'field list'
[Debug]: at C:\Users\Richard\Desktop\Server Side\src\map\script.cpp:17086 - UPDATE `char` SET `pvp_kill` = `pvp_kill` + 1 WHERE `char_id` = 150005 LIMIT 1
[Debug]: Source (NPC): pvp_rank_main (invisible/not on a map)


this is your script

 

Quote

// 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,158,195,4     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 [ "+getmapusers("pvp_y_1-2")+" ]",
            "Prontera [ "+getmapusers("prt_pvp")+" ]",
            "Death Match [ "+getmapusers("bat_cc2")+" ]",
            "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;
}


// PvP Room ----------------------------------------------
//prontera,163,198,4    duplicate(PVP Warper)    PVP Warper#prt    753
payon,190,104,4    duplicate(PVP Warper)    PVP Warper#pay    753
morocc,162,101,4    duplicate(PVP Warper)    PVP Warper#mrc    753
geffen,124,68,4    duplicate(PVP Warper)    PVP Warper#gef    753
alberta,32,238,5    duplicate(PVP Warper)    PVP Warper#alb    753
izlude,134,96,4    duplicate(PVP Warper)    PVP Warper#izl    753
aldebaran,145,113,4    duplicate(PVP Warper)    PVP Warper#ald    753

 

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...