Jump to content
  • 0

Question

Posted

I want to request script that can count how many mobs i killed and having a record.

 

example: i killed 3 porings then it will record in the npc and there's a best record in killing poring. just like pvp ladder but monster.
 

thank you so much ?

4 answers to this question

Recommended Posts

  • 0
Posted (edited)
prontera,0,0,0	script	poring_count	444,{
	.@rank = query_sql("SELECT `char_id`,`char_name`,`kills` FROM `poring_kill_rank` where `kills` > '0' order by `kills` DESC", .@charid,.@name$,.@kills);
	.@ndx = inarray(.@name$, strcharinfo(0));
	if(inarray(.@name$, strcharinfo(0)) != -1){
		mes "^0024E8[YOU] :^000000 (" + (.@ndx +1) + ") : " + .@kills[.@ndx] + " Poring Kills";
	}
	mes "[TOP 10] :";
	for(.@i=0;.@i<min(.@rank,9);.@i++){
		mes (.@i + 1) + " ^0024E8" + .@name$[.@i] + "^000000 ^FF0000" + .@kills[.@i] + "^000000 Poring Kills.";
	}
end;

OnNPCKillEvent:
	if(killedrid == 1002){
		query_sql("SELECT `kills` FROM `poring_kill_rank` WHERE `char_id` = '" + getcharid(0) + "'", .@kills);
		if(.@kills){
			query_sql("UPDATE `poring_kill_rank` SET `kills` = '" + ++.@kills +"' WHERE `char_id` = '" + getcharid(0) + "'");
		}else{
			query_sql("INSERT INTO `poring_kill_rank` (`char_id`,`char_name`,`kills`) VALUES ('" + getcharid(0) + "','" + strcharinfo(0) + "','" + ++.@kills + "')");
		}
	}
end;

OnInit:
	query_sql("CREATE TABLE IF NOT EXISTS `poring_kill_rank` (`char_id` INT NOT NULL,`char_name` VARCHAR(30) NOT NULL,`kills` INT NOT NULL) ENGINE=MyISAM");
}

to reset, just remove all the entries in poring_kill_rank table

Edited by sader1992
  • Upvote 1
  • 1
Posted
prontera,0,0,0	script	poring_count	444,{
	mes "you have killed (" + poring_kill_count + ") Porings.";
	next;
	mes "reset the count ?";
	if(select("yes:no") == 1)
		poring_kill_count = 0;
end;

OnNPCKillEvent:
	if(killedrid == 1002){
		poring_kill_count++;
	}
end;
}

this only work with monsters without label

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