Jump to content
  • 0

OnNPCKillEvent


Tales

Question


  • Group:  Members
  • Topic Count:  163
  • Topics Per Day:  0.04
  • Content Count:  319
  • Reputation:   8
  • Joined:  02/05/12
  • Last Seen:  

How can i get a specific mob id when a player kill him?

I mean...When you kill a poring 5 times you will receive 5 apples.

 

i think on this...

 

 

- script 0a10 -1,{
 
setarray .control[0],0,0,0,0,0,0;
 
OnNPCKillEvent:
if (BaseLevel <= 10){
if (killedrid == 1002) {
.controle[0] = .controle[0]+1;
 
}
}

 

 

 

 

http://rathena.org/board/topic/85798-onnpc-kill-summon-monster/ -> but this args change my mind
Like already discussed in this area, you should use the monster command and an additional label to be triggered when the monster dies if you only want to trigger the death of a few certain monsters.
OnNPCKillEvent should only be used if you want a general label which is triggered whenever any monster on the server is killed. You could want to use this, for instance, if you want to count all the monsters a player kills, but not if you want to trigger the death of certain, few monsters.
The resource difference might not be that noticable for all cases, since we are talking about a very short time duration, but it still exists and if you run many unoptimised scripts, you will eventually notice a different. 
 

 

And this, change my mind again...

 

monster "prontera",123,42,"Poringz0rd",2341,23,"Master::OnThisMobDeath";       amatsu,13,152,4 script Master 767,{   mes "Hi there";   close;       OnThisMobDeath:   announce "Hey, "+strcharinfo(0)+" just killed a Poringz0rd!",bc_blue|bc_all;   end;   }

Edited by Tales
Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  46
  • Topics Per Day:  0.01
  • Content Count:  206
  • Reputation:   13
  • Joined:  01/07/12
  • Last Seen:  

lol, i was going to work on something like this today haha, i want to make mini quests of killing certain amounts of monsters, like idk, 50 anubis, and stuff like that.

 

if i make this work, i'll pass you the script, but still look it by yourself, i might not be the answer haha

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:  

killedrid  // OnNPCKillEvent return mob id

retrieve specific mob id ? you already have the answer.. O__O

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  163
  • Topics Per Day:  0.04
  • Content Count:  319
  • Reputation:   8
  • Joined:  02/05/12
  • Last Seen:  

But my concern is whether this script will run for each character. I mean, it will create instances for each character? 
 
If I have a server with 800 people, it will not cause crash?

Look this

	
monster "prontera",123,42,"Poringz0rd",2341,23,"Master::OnThisMobDeath";		
			
amatsu,13,152,4 script Master 767,{
		
mes "Hi there";
close;

	OnThisMobDeath:
	announce "Hey, "+strcharinfo(0)+" just killed a Poringz0rd!",bc_blue|bc_all;
	end;
}
		
	

 

 

Each time that i play kill a mob, he ill receive a Instance of this script without cause crash to the server?

Edited by Tales
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:  

yes, each kill for each players..

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  46
  • Topics Per Day:  0.01
  • Content Count:  206
  • Reputation:   13
  • Joined:  01/07/12
  • Last Seen:  

so it does not work if player 1 summon this monster and player 2 kills it?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  163
  • Topics Per Day:  0.04
  • Content Count:  319
  • Reputation:   8
  • Joined:  02/05/12
  • Last Seen:  

Thank you guys! I managed to solve all my problems! Maybe today or probably tomorrow I'll post the solution. 

@eKoh! Ill help you tomorrow... whitout time at this time.

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