Jump to content
  • 0

Mob counter / record


jeronpot

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  12
  • Reputation:   3
  • Joined:  04/11/12
  • Last Seen:  

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 ?

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

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

  • 1

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  12
  • Reputation:   3
  • Joined:  04/11/12
  • Last Seen:  

@sader1992 thank you. how about with poring kills with ranking? 

from top 1 to top 10 poring killers.

Edited by jeronpot
additional question
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  12
  • Reputation:   3
  • Joined:  04/11/12
  • Last Seen:  

Thank you very much @sader1992?

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