Jump to content
  • 0
Sign in to follow this  
Ragnar Lothbrok

Help Me on this script please

Question

Can anyone help me on this pvp_rank and dota announcer script... i dont recieve any errors, the problem is kills and death dont count in the rankings i use the sql on the script bellow..

 

 


//create table pvpladder (
//char_id int(11) not null default '0' primary key,
//name varchar(30) not null default '',
//streaks smallint(6) unsigned not null default '0',
//kills smallint(6) unsigned not null default '0',
//deaths smallint(6) unsigned not null default '0',
//streaktime datetime
//) engine = myisam;

//create table ownladder (
//guild_id int(11) not null default '0' primary key,
//name varchar(24) not null default '',
//currentown smallint(6) unsigned not null default '0',
//highestown smallint(6) unsigned not null default '0',
//owntime datetime
//) engine = myisam;

- script DOTAPVP -1,{
OnInit:
// Config
set .sound, 1; // soundeffect : 0 - disable, 1 - play soundeffect to all players on map, 2 - play soundeffect to an area around the killer, 3 - play soundeffect to killer only
set .announce, 1; // announce to : 0 - global, 1 - map
set .announcemap, 0; // announce the map name in the announcement ? : 0 - off, 1 - on

set .announcekill, 1; // announce who pawn who's head : 0 - off, 1 - on
set .msg_die, 1; // show message who kill you when die : 0 - off, 1 - on
set .msg_kill, 1; // show message you kill who when killed someone : 0 - off, 1 - on

set .gmnokill, 0; // GMs are not suppose to kill players. A GM with level or higher will do nothing. IF set to 60, GM60 and above kill any player will not get anything : 0 - off

set .killingspree, 3;
set .dominating, 6;
set .megakill, 9;
set .unstoppable, 10;
set .wickedsick, 12;
set .monsterkill, 15;
set .godlike, 20;
set .holyshit, 23;
set .continue, 1; // after beyond-godlike, every kills will make announcement again

set .owned, 5; // how many times the party/guild has to kill to announce ownage
set .owncontinue, 1; // after ownage, every party/guild cumulative kills will make ownage announce again

set .min_gm_menu, 90; // minimum level of GM can use the GM menu on ladder npc

set .showtotal, 20; // show the length of ladder. Note : Maximum value = 128
set .showpage, 10; // set the views per page. Note : Maximum value = 128
set .loweststreak, 3; // mininum streak count allow to show in highest streak ladder. Default 3 means must at least have killing spree streak to display in ladder
set .lowestownage, 5; // mininum ownage count allow to show in longest ownage ladder. Default 5 means must at least have 5 ownage counts to display in ladder

// *NEW* anti-sit-killer system
// a player must kill another player with this minimum base level to get the announcement and in the ladder.
// Otherwise only have streak ended announcement and killed player's streak reset.
// Its possible for a level 1 novice to kill a level 99 player and he/she will still get in the ladder
// but a level 99 kill a level 1 player will get nothing
// 0 - off this system ( default is 55, pk setting )
set .lvltokill, 50;

// when a player kill another same player times in a row, the player is warp back to save point.
// and the player's streak, kills, and ownage count will deduct accordingly
// 0 - off this system
set .counttopunish, 0;

// minimum level range to kill another player
// eg. when set to 20, player level 99 needs to kill another player with minimum level of 79 to get announcement and increase the kill rank.
// but a player with base level 50 kills a level 99 will also get the announcement
// higher base level cannot kill lower level, but lower level can kill higher level
// 0 - off this system
set .minlvlrange, 50;


// Config ends ------------------------------------------------------------------------------------------

// to prevent bug happen
if ( .announce < 0 || .announce > 1 ) set .announce, 0;
if ( .continue < 1 ) set .continue, 1;
if ( .owncontinue < 1 ) set .owncontinue, 1;
if ( .gmnokill <= 0 ) set .gmnokill, 100;
if ( .lvltokill <= 1 ) set .lvltokill, 0;
if ( .counttopunish <= 1 ) set .counttopunish, 0;
end;

// script start
OnPCKillEvent:
if ( getgmlevel() >= .gmnokill ) end;
getmapxy .@map$,.@x,.@y,0;
if ( !attachrid(killedrid) ) end;
if ( killerrid != getcharid(3) && ( .msg_die || .msg_kill ) ) {
if ( .msg_die ) message strcharinfo(0),"You have been killed by "+ rid2name(killerrid);
if ( .msg_kill ) message rid2name(killerrid),"You just killed "+ strcharinfo(0);
}
if ( @PlayersKilledStreak >= .holyshit )
set .@streakname$,"Beyond Godlike";
else if ( @PlayersKilledStreak >= .godlike )
set .@streakname$,"Godlike";
else if ( @PlayersKilledStreak >= .monsterkill )
set .@streakname$,"Monster Kill";
else if ( @PlayersKilledStreak >= .wickedsick )
set .@streakname$,"Wicked Sick";
else if ( @PlayersKilledStreak >= .unstoppable )
set .@streakname$,"Unstoppable";
else if ( @PlayersKilledStreak >= .megakill )
set .@streakname$,"Mega-kill";
else if ( @PlayersKilledStreak >= .dominating )
set .@streakname$,"Dominating";
else if ( @PlayersKilledStreak >= .killingspree )
set .@streakname$,"Killing Spree";
if ( @PlayersKilledStreak >= .killingspree && killerrid == getcharid(3) )
announce strcharinfo(0) +" has ended "+( (sex)?"him":"her" )+" own "+ .@streakname$ +"["+ @PlayersKilledStreak +"] streak "+( (.announcemap)?("at "+ .@map$):""),16|.announce;
else if ( @PlayersKilledStreak >= .killingspree )
announce rid2name(killerrid) +": has ended "+ strcharinfo(0) +" "+ .@streakname$ +"["+ @PlayersKilledStreak +"] streak. "+( (.announcemap)?("at "+ .@map$):""),16|.announce;
else if ( .announcekill )
announce rid2name(killerrid) +": has killed "+ strcharinfo(0) +" "+( (.announcemap)?("at "+ .@map$):""),16|.announce;
set @PlayersKilledStreak,0;
if ( query_sql("select char_id from pvpladder where char_id = "+ getcharid(0), .@d_cid ) )
query_sql "update pvpladder set deaths = deaths + 1 where char_id = "+ getcharid(0);
set @dota_multikills,0;
if ( getcharid(2) ) {
if ( query_sql("select guild_id from ownladder where guild_id = "+ getcharid(2), .@d_gid ) )
query_sql "update ownladder set currentown = 0 where guild_id = "+ getcharid(2);
set .@killedgroup, getcharid(2);
}
if ( killerrid == getcharid(3) || baselevel < .lvltokill ) end;
if ( .minlvlrange ) set .@killedlvl, baselevel;
if ( !attachrid(killerrid) ) end;
if ( .minlvlrange && .@killedlvl + .minlvlrange < baselevel ) end;
if ( .counttopunish ) {
for ( set .@i,0; .@i < 60; set .@i, .@i +1 ) {
if ( .@i == gettime(2) ) continue;
deletearray getd("@sitkillid"+ .@i), 128;
deletearray getd("@sitkilltimes"+ .@i), 128;
}
for ( set .@i,0; .@i < getarraysize( getd("@sitkillid"+ gettime(2)) ); set .@i, .@i +1 ) {
if ( getd("@sitkillid"+ gettime(2) +"["+ .@i +"]") != killedrid )
continue;
else {
set .@sitkillfound, 1;
setd "@sitkilltimes"+ gettime(2) +"["+ .@i +"]", getd("@sitkilltimes"+ gettime(2) +"["+ .@i +"]") +1 ;
if ( getd("@sitkilltimes"+ gettime(2) +"["+ .@i +"]") >= .counttopunish ) {
warp "SavePoint",0,0;
announce strcharinfo(0) +" , Stop killing "+ rid2name(killedrid) + " !!!",0;
debugmes strcharinfo(0) +" is sit-killing "+ rid2name(killedrid) +" for "+ getd("@sitkilltimes"+ gettime(2) +"["+ .@i +"]") + " times";
logmes "is sit-killing "+ rid2name(killedrid) +" for "+ getd("@sitkilltimes"+ gettime(2) +"["+ .@i +"]") +" times";
query_sql "update pvpladder set kills = kills - "+ ( .counttopunish -1 ) +" where char_id = "+ getcharid(0);
query_sql "select streaks from pvpladder where char_id = "+ getcharid(0), .@streak;
if ( @PlayersKilledStreak == .@streak )
query_sql "update pvpladder set streaks = "+( @PlayersKilledStreak +1 - .counttopunish )+" where char_id = "+ getcharid(0);
set @PlayersKilledStreak, @PlayersKilledStreak +1 - .counttopunish;
if ( getcharid(2) ) {
query_sql "select currentown, highestown from ownladder where guild_id = "+ getcharid(2), .@currentown, .@highestown;
query_sql "update ownladder set currentown = currentown - "+ ( .counttopunish -1 ) +" where guild_id = "+ getcharid(2);
if ( .@currentown == .@highestown )
query_sql "update ownladder set highestown = currentown where guild_id = "+ getcharid(2);
}
end;
}
}
}
if ( !.@sitkillfound ) {
setd "@sitkillid"+ gettime(2) +"["+ .@i +"]", killedrid;
setd "@sitkilltimes"+ gettime(2) +"["+ .@i +"]", 1;
}
}
set @PlayersKilledStreak, @PlayersKilledStreak + 1;
if ( query_sql("select streaks from pvpladder where char_id = "+ getcharid(0), .@streaks) )
query_sql "update pvpladder set kills = kills + 1 where char_id = "+ getcharid(0);
else
query_sql "insert into pvpladder ( char_id, name, kills , streaktime ) values ( "+ getcharid(0) +", '"+ escape_sql( strcharinfo(0) ) +"', 1, now() )";
if ( @PlayersKilledStreak > .@streaks ) {
query_sql "update pvpladder set streaks = "+ @PlayersKilledStreak +" where char_id = "+ getcharid(0);
query_sql "update pvpladder set streaktime = now() where char_id = "+ getcharid(0);
}
if ( @PlayersKilledStreak == .killingspree )
setarray .@streakname$,"killingspree.wav","is on a Killing Spree",".";
else if ( @PlayersKilledStreak == .dominating )
setarray .@streakname$,"dominating.wav","is Dominating!",".";
else if ( @PlayersKilledStreak == .megakill )
setarray .@streakname$,"megakill.wav","has a Mega-Kill!",".";
else if ( @PlayersKilledStreak == .unstoppable )
setarray .@streakname$,"unstoppable.wav","is Unstoppable!",".";
else if ( @PlayersKilledStreak == .wickedsick )
setarray .@streakname$,"wickedsick.wav","is Wicked Sick!",".";
else if ( @PlayersKilledStreak == .monsterkill )
setarray .@streakname$,"monsterkill.wav","has a Monster Kill!",".";
else if ( @PlayersKilledStreak == .godlike )
setarray .@streakname$,"godlike.wav","is GODLIKE!",". Will someone ever stop "+( (sex)?"him":"her" ) +"?";
else if ( @PlayersKilledStreak >= .holyshit && ( (@PlayersKilledStreak - .holyshit) % .continue == 0 ) )
setarray .@streakname$,"holyshit.wav","is BEYOND GODLIKE!",". Someone kill "+( (sex)?"him":"her" ) +"!";
if ( .@streakname$[1] != "" ) {
announce strcharinfo(0) +": "+ .@streakname$[1] +" "+( (.announcemap)?("at "+ .@map$):"") + .@streakname$[2],16|.announce;
if ( .sound == 1 ) soundeffectall .@streakname$[0],0,.@map$;
else if ( .sound == 2 ) soundeffectall .@streakname$[0],0;
else if ( .sound == 3 ) soundeffect .@streakname$[0],0;
}
set @dota_multikills, @dota_multikills + 1;
deltimer "DOTAPVP::OnStreakReset";
addtimer 11500,"DOTAPVP::OnStreakReset";
if ( getcharid(2) ) {
set .@sideid, getcharid(2);
if ( .@sideid != .@killedgroup ) {
if ( query_sql("select currentown, highestown from ownladder where guild_id = "+ getcharid(2), .@currentown, .@highestown) ) {
set .@currentown, .@currentown + 1;
query_sql "update ownladder set currentown = "+ .@currentown +" where guild_id = "+ getcharid(2);
if ( .@currentown > .@highestown ) {
query_sql "update ownladder set highestown = "+ .@currentown +" where guild_id = "+ getcharid(2);
query_sql "update ownladder set owntime = now() where guild_id = "+ getcharid(2);
}
} else
query_sql "insert into ownladder ( guild_id, name, currentown, highestown ) values ( "+ getcharid(2) +", '"+ escape_sql( strcharinfo(2) ) +"', 1 , 1 )";
}
}
set .@dota_multikills, @dota_multikills;
set .@origin, getcharid(3);
sleep 1500;
if ( .@sideid && .@sideid != .@killedgroup && .@currentown >= .owned && ( ( .@currentown - .owned ) % .owncontinue == 0 ) ) {
if ( .announce ) mapannounce .@map$, "The guild ["+ getguildname(.@sideid) +"] is OWNING["+ .@currentown +"] !!!",16;
else announce "The guild ["+ getguildname(.@sideid) +"] is OWNING !!!",16;
if ( .sound == 1 ) soundeffectall "ownage.wav",0,.@map$;
else if ( .sound == 2 ) soundeffectall "ownage.wav",0;
else if ( .sound == 3 && attachrid(.@origin) ) soundeffect "ownage.wav",0;
}
sleep 1250;
if ( !attachrid(.@origin) ) end;
if ( .@dota_multikills == 2 ) {
if ( .announce ) mapannounce .@map$, strcharinfo(0) +": just got a Double Kill !!",16;
else announce strcharinfo(0) +": just got a Double Kill !!",16;
if ( .sound == 1 ) soundeffectall "doublekill.wav",0,.@map$;
else if ( .sound == 2 ) soundeffectall "doublekill.wav",0;
else if ( .sound == 3 ) soundeffect "doublekill.wav",0;
}
else if ( .@dota_multikills >= 3 ) {
if ( .announce ) mapannounce .@map$, strcharinfo(0) +": just got a Triple kill !!",16;
else announce strcharinfo(0) +": just got a Triple kill !!",16;
if ( .sound == 1 ) soundeffectall "triplekill.wav",0,.@map$;
else if ( .sound == 2 ) soundeffectall "triplekill.wav",0;
else if ( .sound == 3 ) soundeffect "triplekill.wav",0;
}
end;
OnWhisperGlobal:
dispbottom "Your current Streak : "+ @PlayersKilledStreak;
if ( query_sql("select kills from pvpladder where char_id = "+ getcharid(0), .@kills) )
dispbottom "Your total Kills : "+ .@kills;
else
dispbottom "You are not in the pvp ladder yet";
if ( !getcharid(2) ) end;
if ( query_sql("select currentown from ownladder where guild_id = "+ getcharid(2), .@currentown) )
dispbottom "Your guild Own : "+ .@currentown;
else
dispbottom "Your guild is not in the ladder yet.";
end;
OnStreakReset:
set @dota_multikills,0;
end;
}

prontera.gat,165,181,4 script PvP Ranking Board 857,{
set .@npcname$, strnpcinfo(0);
do {
deletearray .@name$, 128;
deletearray .@kills, 128;
deletearray .@deaths, 128;
deletearray .@streak, 128;
deletearray .@owned, 128;
deletearray .@time$, 128;
set .@gid, 0;
set .@cid, 0;
set .@currentown, 0;
mes "[ ^FF0000PvP Ranking^000000 ]";
mes "Hello ^00CC99"+ strcharinfo(0) +"^000000...";
mes "If you want to I can show you your PVP stats.";
if ( getgmlevel() >= getvariableofnpc(.min_gm_menu,"DOTAPVP") ) mes "And GM option for you.";
next;
if ( getgmlevel() >= getvariableofnpc(.min_gm_menu,"DOTAPVP") )
select "Most Kills","Highest Streak","Longest Ownage","Own Information","Explanation","Reset Table","Modify a ladder value";
else
select "Most Kills","Highest Streak","Longest Ownage","Own Information","Explanation";
switch (@menu) {
case 1:
query_sql "select name, kills, deaths from pvpladder order by kills desc limit "+ getvariableofnpc(.showtotal,"DOTAPVP"), .@name$, .@kills, .@deaths;
if ( !getarraysize(.@name$) ) {
mes "[ ^FF0000PvP Ranking^000000 ]";
mes "The ladder currently is empty";
next;
}
for ( set .@j,0; .@j < getarraysize(.@name$); set .@j, .@j + getvariableofnpc(.showpage,"DOTAPVP") ) {
mes "[ ^FF0000PvP Ranking^000000 ]";
for ( set .@i, .@j; .@i < (getvariableofnpc(.showpage,"DOTAPVP") + .@j) && .@i < getarraysize(.@name$); set .@i, .@i + 1 ) {
mes ""+ (.@i+1) +". "+ .@name$[.@i] +" : ^00AA00["+ .@kills[.@i] +"]^000000";
}
next;
}
break;
case 2:
query_sql "select name, streaks, date_format(streaktime,'%a %e/%c/%y %r') from pvpladder where streaks >= "+ getvariableofnpc(.loweststreak,"DOTAPVP") +" order by streaks desc limit "+ getvariableofnpc(.showtotal,"DOTAPVP"), .@name$, .@streak, .@time$;
if ( !getarraysize(.@name$) ) {
mes "[ ^FF0000PvP Ranking^000000 ]";
mes "The ladder currently is empty";
next;
}
for ( set .@j,0; .@j < getarraysize(.@name$); set .@j, .@j + getvariableofnpc(.showpage,"DOTAPVP") ) {
mes "[ ^FF0000PvP Ranking^000000 ]";
for ( set .@i, .@j; .@i < (getvariableofnpc(.showpage,"DOTAPVP") + .@j) && .@i < getarraysize(.@name$); set .@i, .@i + 1 ) {
mes "^996600"+ (.@i+1) +": ^006699"+ .@name$[.@i] +" ^70AC11{"+ .@streak[.@i] +"} ^000000on :";
mes " ^EE8800"+ .@time$[.@i] +"^000000";
}
next;
}
break;
case 3:
query_sql "select name, highestown, date_format(owntime,'%a %e/%c/%y %r') from ownladder where highestown >= "+ getvariableofnpc(.lowestownage,"DOTAPVP") +" order by highestown desc limit "+ getvariableofnpc(.showtotal,"DOTAPVP"), .@name$, .@owned, .@time$;
if ( !getarraysize(.@name$) ) {
mes "[ ^FF0000PvP Ranking^000000 ]";
mes "The ladder currently is empty";
next;
}
for ( set .@j,0; .@j < getarraysize(.@name$); set .@j, .@j + getvariableofnpc(.showpage,"DOTAPVP") ) {
mes "[ ^FF0000PvP Ranking^000000 ]";
for ( set .@i, .@j; .@i < (getvariableofnpc(.showpage,"DOTAPVP") + .@j) && .@i < getarraysize(.@name$); set .@i, .@i + 1 ) {
mes "^996600"+ (.@i+1) +": ^006699"+ .@name$[.@i] +" ^00AAAA("+ .@owned[.@i] +") ^000000on :";
mes " ^EE8800"+ .@time$[.@i] +"^000000";
}
next;
}
break;
case 4:
query_sql "select char_id, streaks, kills, deaths, date_format(streaktime,'%a %e/%c/%y %r') from pvpladder where char_id = "+ getcharid(0), .@cid, .@streak, .@kills, .@deaths, .@time$;
mes "[ ^FF0000PvP Ranking^000000 ]";
if ( !.@cid && !@PlayersKilledStreak )
mes "You not yet kill any player";
else {
mes "Your Current Streak : ^70AC11{"+ @PlayersKilledStreak +"}^000000";
mes "Your Total Kills : ^00AA00["+ .@kills +"]^000000";
mes "Your Death Counts : ^FF0000<"+ .@deaths +">^000000";
mes "Highest Streak was ^70AC11{"+ .@streak +"}^000000 on :";
mes " ^EE8800"+ .@time$ +"^000000";
set .@streak, 0;
set .@kills, 0;
set .@deaths, 0;
set .@time$, "";
}
next;
if ( getcharid(2) ) {
mes "[ ^FF0000PvP Ranking^000000 ]";
query_sql "select guild_id, currentown, highestown, date_format(owntime,'%a %e/%c/%y %r') from ownladder where guild_id = "+ getcharid(2), .@gid, .@currentown, .@owned, .@time$;
if ( !.@gid )
mes "Your guild not yet kill any player";
else {
mes "Your guild name : ^006699"+ strcharinfo(2) +"^000000";
mes "Current Owning : ^00AAAA("+ .@currentown +")^000000";
mes "Longest Ownage was ^00AAAA("+ .@owned + ")^000000 on :";
mes " ^EE8800"+ .@time$ +"^000000";
}
next;
}
break;
case 5:
mes "[ ^FF0000PvP Ranking^000000 ]";
mes "Explanation for Most Kills:";
mes " ";
mes "^996600Rank. ^006699NAME ^00AA00[Total Kills] ^FF0000^000000";
mes " ";
mes "--------------------------------";
mes " ";
mes "The ^00AA00Kills^000000 added when a player kills another player.";
mes " ";
mes "^FF0000Deaths^000000 count increase when a player killed by another player, or suicide (eg: Grand Cross).";
mes " ";
mes "A player killed by monsters, homunculus or pets will not add the kills or deaths count.";
next;
mes "[ ^FF0000PvP Ranking^000000 ]";
mes "Explanation for Highest Streak:";
mes " ";
mes "^996600Rank. ^006699NAME ^70AC11{Highest Streak} ^000000on :";
mes " ^EE8800TIME^000000";
mes " ";
mes "--------------------------------";
mes " ";
mes "The ^70AC11Streak^000000 are added every time a player kills another player. It will reset upon log out, killed by another player, or suicide (eg: Sacrifice).";
mes " ";
mes "Then it record in the server the ^EE8800TIME^000000 when that player got that highest streak.";
mes " ";
mes "A player killed by monsters, homunculus or pets will not reset the streak.";
mes " ";
mes "--------------------------------";
mes " ";
mes "The numbers of straight kills to get these announcements are :";
mes "^70AC11"+ getvariableofnpc(.killingspree,"DOTAPVP") +"^000000 : Killing Spree";
mes "^70AC11"+ getvariableofnpc(.dominating,"DOTAPVP") +"^000000 : Dominating";
mes "^70AC11"+ getvariableofnpc(.megakill,"DOTAPVP") +"^000000 : Mega Kill";
mes "^70AC11"+ getvariableofnpc(.unstoppable,"DOTAPVP") +"^000000 : Unstoppable";
mes "^70AC11"+ getvariableofnpc(.wickedsick,"DOTAPVP") +"^000000 : Wicked Sick";
mes "^70AC11"+ getvariableofnpc(.monsterkill,"DOTAPVP") +"^000000 : Monster Kill";
mes "^70AC11"+ getvariableofnpc(.godlike,"DOTAPVP") +"^000000 : Godlike";
mes "^70AC11"+ getvariableofnpc(.holyshit,"DOTAPVP") +"^000000 : Beyond Godlike";
next;
mes "[ ^FF0000PvP Ranking^000000 ]";
mes "Explanation for Longest Ownage:";
mes " ";
mes "^996600Rank. ^006699NAME ^00AAAA(Longest Ownage) ^000000on :";
mes " ^EE8800TIME^000000";
mes " ";
mes "--------------------------------";
mes " ";
mes "The ^00AAAAOwnage^000000 added every time any guild members killed another player that doesn't belong to his/her guild. It will reset when any of the guild member was killed by ANY player, including his/her guild member.";
mes " ";
mes "Then it record in the server the ^EE8800TIME^000000 when the guild got that longest ownage.";
mes " ";
mes "If the server went under maintainance, the current ownage will survive after the server restart";
mes " ";
mes "Any guild member killed by monster, homunculus or pets will not reset the ownage count.";
next;
if ( getvariableofnpc(.lvltokill,"DOTAPVP") ) {
mes "[ ^FF0000PvP Ranking^000000 ]";
mes "You must kill another player with minimum base level of "+ getvariableofnpc(.lvltokill,"DOTAPVP") +", in order to get an announcement or get in the ladder.";
mes " ";
mes "It's possible for a base level 1 novice kills a base level 99 player and still can get in the ladder.";
mes "However when a player level 99 kills a level 1 novice will get nothing.";
next;
}
if ( getvariableofnpc(.counttopunish,"DOTAPVP") ) {
mes "[ ^FF0000PvP Ranking^000000 ]";
mes "Some noob players try to kill the same person over and over again in hope of getting his/her name appear in the ladder.";
mes "However if you trying to do the same thing on this ladder, your name will announce to the public, and your action will be recorded into the server to notify the GMs.";
next;
}
if ( getvariableofnpc(.minlvlrange,"DOTAPVP") ) {
mes "[ ^FF0000PvP Ranking^000000 ]";
mes "When you kill another player thats lower base level than you, the base level gap between you and that player must not more than "+ getvariableofnpc(.minlvlrange,"DOTAPVP") +".";
mes " ";
if ( getvariableofnpc(.minlvlrange,"DOTAPVP") >= 200)
mes "In other words, if your base level is 500, the player you killed must be at least level "+( 500 - getvariableofnpc(.minlvlrange,"DOTAPVP") )+" then only you will get the announcement and in the ladder.";
else if ( getvariableofnpc(.minlvlrange,"DOTAPVP") >= 70)
mes "In other words, if your base level is 255, the player you killed must be at least level "+( 255 - getvariableofnpc(.minlvlrange,"DOTAPVP") )+" then only you will get the announcement and in the ladder.";
else
mes "In other words, if your base level is 99, the player you killed must be at least level "+( 99 - getvariableofnpc(.minlvlrange,"DOTAPVP") )+" then only you will get the announcement and in the ladder.";
mes "Higher base level kills lower level gets nothing, however lower level player kills higher level will get the announcement.";
next;
}
break;
case 6:
if ( getgmlevel() < getvariableofnpc(.min_gm_menu,"DOTAPVP") ) break;
mes "[PvP Ranking]";
mes "Which table you want to reset ?";
next;
switch( select("Both","PVP ladder","Ownage ladder","Nope") ) {
case 1:
mes "[ ^FF0000PvP Ranking^000000 ]";
mes "Are you sure you want to reset both ladder ?";
next;
if ( select("Nope:Yup") == 1 ) break;
query_sql "delete from pvpladder";
query_sql "delete from ownladder";
mes "[ ^FF0000PvP Ranking^000000 ]";
mes "Both ladder are reset";
next;
break;
case 2:
case 3:
set .@menu, @menu;
mes "[ ^FF0000PvP Ranking^000000 ]";
mes "Are you sure you want to reset "+( (.@menu ==2)?"PVP":"Ownage" )+" ladder ?";
next;
if ( select("Nope:Yup") == 1 ) break;
query_sql "delete from "+( (.@menu ==2)?"pvp":"own" )+"ladder";
mes "[PvP Ranking]";
mes "The ladder is reset";
next;
break;
default:
}
break;
case 7:
if ( getgmlevel() < getvariableofnpc(.min_gm_menu,"DOTAPVP") ) break;
mes "[ ^FF0000PvP Ranking^000000 ]";
mes "select which table you want to modify";
next;
switch( select ("PVP ladder","Ownage ladder","Back") ) {
if ( @menu == 3 ) break;
mes "[PvP Ranking]";
mes "select input type";
next;
case 1:
if ( select("Char ID","Char Name","Account ID") != 3) {
if ( @menu == 1 )
input .@id;
else
input .@id$;
mes "[ ^FF0000PvP Ranking^000000 ]";
query_sql "select char_id from `char` where "+( (@menu ==1)?("char_id = "+ .@id) "name = '"+ escape_sql(.@id$) +"'") ), .@cid;
if ( !.@cid ) {
mes "There is no such character "+( (@menu == 1)?"ID":"name");
next;
break;
} else
set .@cid, 0;
query_sql "select char_id, name, streaks, kills, deaths, date_format(streaktime,'%a %e/%c/%y %r') from pvpladder where "+( (@menu ==1)?("char_id = "+ .@id) "name = '"+ escape_sql(.@id$) +"'") ), .@cid, .@name$, .@streak, .@kills, .@deaths, .@time$;
if ( !.@cid ) {
mes "This player is not in the ladder";
next;
break;
}
} else {
input .@id;
query_sql "select char_id, name, char_num from `char` where account_id = "+ .@id +" order by char_num asc", .@cid, .@name$, .@gid;
if ( !.@cid ) {
mes "There is no such Account ID";
next;
break;
}
mes "[ ^FF0000PvP Ranking^000000 ]";
for ( set .@i,0; .@i < getarraysize(.@cid); set .@i, .@i + 1 )
mes (.@gid[.@i] +1) +". "+ .@cid[.@i] +" "+ .@name$[.@i];
set .@menu$, (.@gid[.@i] +1) +". "+ .@cid;
for ( set .@i,1; .@i < getarraysize(.@cid); set .@i, .@i + 1 )
set .@menu$, .@menu$ +":"+ .@gid[.@i] +". "+ .@cid[.@i];
next;
select .@menu$;
mes "[ ^FF0000PvP Ranking^000000 ]";
set .@id, .@cid[@menu-1];
deletearray .@cid, 9;
query_sql "select char_id, name, streaks, kills, deaths, date_format(streaktime,'%a %e/%c/%y %r') from pvpladder where char_id = "+ .@id, .@cid, .@name$, .@streak, .@kills, .@deaths, .@time$;
if ( !.@cid ) {
mes "This player is not in the ladder";
next;
break;
}
}
mes "Char ID : ^006699"+ .@cid +"^000000";
mes "Char Name : ^006699"+ .@name$ +"^000000";
mes "Total Kills : ^00AA00["+ .@kills +"]^000000";
mes "Deaths Counts : ^FF0000<"+ .@deaths +">^000000";
mes "Highest Streak was ^70AC11{"+ .@streak +"}^000000 on :";
mes " ^EE8800"+ .@time$ +"^000000";
next;
switch( select("Total Kills","Death Counts","Highest Streak & Highest Streak Time","Name") ) {
case 1:
setarray .@time$,"Total Kills",".@kills","kills","";
break;
case 2:
setarray .@time$,"Death Counts",".@deaths","deaths","";
break;
case 3:
setarray .@time$,"Highest Streak",".@streak","streaks","1";
default:
}
if ( @menu < 4 ) {
input .@num;
mes "[ ^FF0000PvP Ranking^000000 ]";
mes "Really change "+ .@name$ +"'s";
mes .@time$[0] +" from "+ getd(.@time$[1]) +" to "+ .@num +" ?";
if ( .@num >= getd(.@time$[1]) && .@time$[3] == "1" ) mes "and set Highest Streak Time to current time?";
next;
if ( select("Nope:Yup") == 1 ) break;
mes "[PvP Ranking]";
query_sql "update pvpladder set "+ .@time$[2] +" = "+ .@num +" where char_id = "+ .@cid;
if ( .@num >= getd(.@time$[1]) && .@time$[3] == "1" ) query_sql "update pvpladder set streaktime = now()";
mes "The "+ .@time$[0] +" for";
mes .@name$ +" has set to "+ .@num;
if ( .@num >= getd(.@time$[1]) && .@time$[3] == "1" ) mes "and the Highest Streak Time set to current time";
next;
break;
} else {
mes "[ ^FF0000PvP Ranking^000000 ]";
mes "Refreshing name of this char :";
mes .@name$ +" ......";
mes " ";
query_sql "select `char`.name, pvpladder.name from `char` right join pvpladder on `char`.char_id = pvpladder.char_id where `char`.char_id = "+ .@cid, .@cid1$, .@cid2$;
if ( .@cid1$ == "" )
mes "The character has deleted, so can't be change anymore";
else if ( .@cid1$ == .@cid2$ )
mes "The name is still the same, so don't need to change";
else {
query_sql "update pvpladder set name = '"+ escape_sql(.@cid1$) +"' where char_id = "+ .@cid;
mes "Now it called : "+ .@cid1$;
}
set .@cid1$, "";
set .@cid2$, "";
next;
}
break;
case 2:
select "Guild ID","Guild Name";
if ( @menu == 1 )
input .@id;
else
input .@id$;
mes "[ ^FF0000PvP Ranking^000000 ]";
query_sql "select guild_id from guild where "+( (@menu ==1)?("guild_id = "+ .@id) "name = '"+ escape_sql(.@id$) +"'") ), .@gid;
if ( !.@gid ) {
mes "There is no such guild";
next;
break;
} else
set .@gid, 0;
query_sql "select guild_id, name, currentown, highestown, date_format(owntime,'%a %e/%c/%y %r') from ownladder where "+( (@menu ==1)?("guild_id = "+ .@id) "name = '"+ escape_sql(.@id$) +"'") ), .@gid, .@name$, .@currentown, .@owned, .@time$;
if ( !.@gid ) {
mes "This guild is not in the ladder";
next;
break;
}
mes "Guild ID : ^006699"+ .@gid +"^000000";
mes "Guild name : ^006699"+ .@name$ +"^000000";
mes "Current Owning : ^00AAAA("+ .@currentown +")^000000";
mes "Longest Ownage was ^00AAAA("+ .@owned +")^000000 on :";
mes " ^EE8800"+ .@time$ +"^000000";
next;
switch( select("Current Owning","Longest Ownage & Longest Ownage Time","Name") ) {
case 1:
setarray .@time$,"Current Owning",".@currentown","currentown","";
break;
case 2:
setarray .@time$,"Highest Ownage",".@owned","highestown","1";
default:
}
if ( @menu < 3 ) {
input .@num;
mes "[ ^FF0000PvP Ranking^000000 ]";
mes "Really change "+ .@name$ +"'s";
mes .@time$[0] +" from "+ getd(.@time$[1]) +" to "+ .@num +" ?";
if ( .@num >= getd(.@time$[1]) && .@time$[3] == "1" ) mes "and set Longest Ownage Time to current time?";
next;
if ( select("Nope:Yup") == 1 ) break;
mes "[PvP Ranking]";
query_sql "update ownladder set "+ .@time$[2] +" = "+ .@num +" where guild_id = "+ .@gid;
if ( .@num >= getd(.@time$[1]) && .@time$[3] == "1" ) query_sql "update ownladder set owntime = now()";
mes "The "+ .@time$[0] +" for";
mes .@name$ +" guild has set to "+ .@num;
if ( .@num >= getd(.@time$[1]) && .@time$[3] == "1" ) mes "and the Longest Ownage Time set to current time";
next;
break;
} else {
mes "[ ^FF0000PvP Ranking^000000 ]";
mes "Refreshing name of this guild :";
mes .@name$ +" ......";
mes " ";
query_sql "select guild.name, ownladder.name from guild right join ownladder on guild.guild_id = ownladder.guild_id where guild.guild_id = "+ .@gid, .@gid1$, .@gid2$;
if ( .@gid1$ == "" )
mes "The guild has deleted, so can't be change anymore";
else if ( .@gid1$ == .@gid2$ )
mes "The name is still the same, so don't need to change";
else {
query_sql "update ownladder set name = '"+ escape_sql(.@gid1$) +"' where guild_id = "+ .@gid;
mes "Now it called : "+ .@gid1$;
}
set .@gid1$, "";
set .@gid2$, "";
next;
}
default:
}
default:
}
} while (1);

}

 

Edited by arnie2302

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.