Jump to content
  • 0

PvP ladder remain empty


YuliChenz

Question


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   0
  • Joined:  11/04/12
  • Last Seen:  

i got this script from my friend, i installed it, pvp warper works but pvp ladder still empty.

my friend said that might be because there is no table on my sql yet, he doesnt know how to add it -_-"

here is the script

ayothaya,140,162,5	script	PvP Warper	730,{
	mes "[PvP Warper]";
	mes "Would you like to enter the PvP Arena?";
	menu "Yes",-,"No",L_no;
	next;
	warp "pvp_y_2-2",0,0;
	close;
 

L_no:
close;
}

-	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, 1; // announce the map name in the announcement ? : 0 - off, 1 - on

	set .announcekill, 0; // 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 <this number> level or higher will do nothing. IF set to 60, GM60 and above kill any player will not get anything : 0 - off

	set .firstblood, 1;
	set .doublekill, 2;
	set .triplekill, 3;
	set .killingspree, 5;
	set .dominating, 10;
	set .megakill, 15;
	set .unstoppable, 20;
	set .wickedsick, 25;
	set .monsterkill, 30;
	set .godlike, 40;
	set .holyshit, 50;
	set .continue, 5; // after beyond-godlike, every <this number> kills will make announcement again

	set .owned, 15; // how many times the party/guild has to kill to announce ownage
	set .owncontinue, 15; // after ownage, every <this number> 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, 10; // 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, 15; // 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 <this number> 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, 55;

	// when a player kill another same player <this number> 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, 6;

	// 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, 0;

	// The maps to activate the dota pvp ladder
	// at default this is set to "all" meaning all maps will be used.
	// If you want specific maps only then put the map names separated with coma.
	// Ex. setarray .mapallow$[0],"prontera","prt_fild01","payon";
	setarray .mapallow$[0],"pvp_y_8-2","ars_dun06","ars_dun09";

	// if .mapdeny$[0] is set to "all" this settings block this
    	// script in all maps specify in this array
    	// Ex. setarray .mapdeny$[0],"prontera","prt_fild01","payon";
    	setarray .mapdeny$[0],"guild_vs3";


// 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;
	for( set .@i,0; .@i < getarraysize(.mapallow$); set .@i,.@i + 1 )
    		{
        		if( .mapallow$[.@i] == "all" ) {
            			for ( set .@j,0; .@j < getarraysize(.mapdeny$); set .@j, .@j+1 )
                			if ( .@map$ == .mapdeny$[.@j] )
                   				 end;
            			goto L_ok;
        		}		
        		if( .@map$ == .mapallow$[.@i] ) goto L_ok;
    	}

L_ok:
	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";
		else if ( @PlayersKilledStreak >= .triplekill )
			set .@streakname$,"Triple Kill";
		else if ( @PlayersKilledStreak >= .doublekill )
			set .@streakname$,"Double Kill";
		else if ( @PlayersKilledStreak >= .firstblood )
			set .@streakname$,"First Blood";
	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) +"'s "+ .@streakname$ +"["+ @PlayersKilledStreak +"] streak "+( (.announcemap)?("at "+ .@map$):""),16|.announce;
	else if ( .announcekill )
		announce rid2name(killerrid) +" has pawned "+ strcharinfo(0) +"'s head "+( (.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 == .firstblood )
		setarray .@streakname$,"First Blood.wav","just got a FIRST BLOOD!",".";
	else if ( @PlayersKilledStreak == .doublekill )
		setarray .@streakname$,"doublekill.wav","just got a DOUBLE KILL!",".";
	else if ( @PlayersKilledStreak == .triplekill )
		setarray .@streakname$,"triplekill.wav","just got a TRIPLE KILL!",".";
	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] +"["+ @PlayersKilledStreak +"] "+( (.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["+ .@currentown +"] !!!",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;
}

ayothaya,140,159,5	script	PvP Ranking::PvP Ladder	721,{
	//waitingroom "PvP Top 20",0;
	set .@npcname$, "PvP-StatsViewer";
	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 "["+ .@npcname$ +"]";
		mes "Hello "+ strcharinfo(0) +"...";
		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 "["+ .@npcname$ +"]";
					mes "The ladder currently is empty";
					next;
				}
				for ( set .@j,0; .@j < getarraysize(.@name$); set .@j, .@j + getvariableofnpc(.showpage,"DOTAPVP") ) {
					mes "["+ .@npcname$ +"]";
					for ( set .@i, .@j; .@i < (getvariableofnpc(.showpage,"DOTAPVP") + .@j) && .@i < getarraysize(.@name$); set .@i, .@i + 1 ) {
						mes "^996600"+ (.@i+1) +": ^006699"+ .@name$[.@i] +" ^00AA00["+ .@kills[.@i] +"] ^FF0000<"+ .@deaths[.@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 "["+ .@npcname$ +"]";
					mes "The ladder currently is empty";
					next;
				}
				for ( set .@j,0; .@j < getarraysize(.@name$); set .@j, .@j + getvariableofnpc(.showpage,"DOTAPVP") ) {
					mes "["+ .@npcname$ +"]";
					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 "["+ .@npcname$ +"]";
					mes "The ladder currently is empty";
					next;
				}
				for ( set .@j,0; .@j < getarraysize(.@name$); set .@j, .@j + getvariableofnpc(.showpage,"DOTAPVP") ) {
					mes "["+ .@npcname$ +"]";
					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 "["+ .@npcname$ +"]";
				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 "["+ .@npcname$ +"]";
					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 "["+ .@npcname$ +"]";
				mes "Explanation for Most Kills:";
				mes " ";
				mes "^996600Rank. ^006699NAME ^00AA00[Total Kills] ^FF0000<Deaths>^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 "["+ .@npcname$ +"]";
				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 "["+ .@npcname$ +"]";
				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 "["+ .@npcname$ +"]";
					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 "["+ .@npcname$ +"]";
					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 "["+ .@npcname$ +"]";
					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 "["+ .@npcname$ +"]";
				mes "Which table you want to reset ?";
				next;
				switch( select("Both","PVP ladder","Ownage ladder","Nope") ) {
					case 1:
						mes "["+ .@npcname$ +"]";
						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 "["+ .@npcname$ +"]";
						mes "Both ladder are reset";
						next;
						break;
					case 2:
					case 3:
						set .@menu, @menu;
						mes "["+ .@npcname$ +"]";
						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 "["+ .@npcname$ +"]";
						mes "The ladder is reset";
						next;
						break;
					default:
				}
				break;
			case 7:
				if ( getgmlevel() < getvariableofnpc(.min_gm_menu,"DOTAPVP") ) break;
				mes "["+ .@npcname$ +"]";
				mes "select which table you want to modify";
				next;
				switch( select ("PVP ladder","Ownage ladder","Back") ) {
					if ( @menu == 3 ) break;
					mes "["+ .@npcname$ +"]";
					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 "["+ .@npcname$ +"]";
							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 "["+ .@npcname$ +"]";
							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 "["+ .@npcname$ +"]";
							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 "["+ .@npcname$ +"]";
							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 "["+ .@npcname$ +"]";
							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 "["+ .@npcname$ +"]";
							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 "["+ .@npcname$ +"]";
						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 "["+ .@npcname$ +"]";
							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 "["+ .@npcname$ +"]";
							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 "["+ .@npcname$ +"]";
							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);
}

please guide me how to make query on my sql. thank you

Edited by YuliChenz
Link to comment
Share on other sites

7 answers to this question

Recommended Posts


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

i think this is the sql table for this script..

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;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   0
  • Joined:  11/04/12
  • Last Seen:  

Could you please tell me how to add this sql table? Do i need create new file or something? Or just add it on my script?

Link to comment
Share on other sites


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

execute the table in your SQL machine

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   0
  • Joined:  11/04/12
  • Last Seen:  

Okay ^^ thanks a lot emistry

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   0
  • Joined:  11/04/12
  • Last Seen:  

i got this error when i tried to execute the sql query


post-10100-0-22442100-1364388557_thumb.jpg

 

please help :(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

select your database 1st

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   0
  • Joined:  11/04/12
  • Last Seen:  

ahh im noob XD and its working!!! thanks emistry, thanks trojanworm.. thanks a lot

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