Jump to content
  • 0

onNPCKillEvent how does it work?


sietse11

Question


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  127
  • Reputation:   7
  • Joined:  02/10/13
  • Last Seen:  

Hey folks.

 

How do I make onNPCDieEvent work?

 

I need to use it to count the kills by a specific player on a specific mob.

And I have no idea how to use it

Edited by sietse11
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • -1

  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  127
  • Reputation:   7
  • Joined:  02/10/13
  • Last Seen:  

Can u be more annoying?

 

This example for On<label name>:

Example:
 
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;
}

if ur question about onNPCDieEvent, nothing label for it except it's ur own label like the example above. just need to change the OnThisMobDeath to 'onNPCDieEvent and change the mob id to mob id that u want.

if you want label that triggered if u kill mob and get the mob id, u must using 'OnNPCKillEvent'

-<tab>script<tab>baaakaaa<tab>-1,{
OnNPCKillEvent:
dispbottom "Look I just killed "+killedrid+" baka mob!";
}

u know, people must know their reading skill before blaming other.

Why did you even respond to this topic?

You obviously lack the reading skill required to read more then one sentence.

And for future reference, I still have not blamed anyone for anything in this forum.

 

As for Euphy, Id like to apologize for my comment. Had I known it would have this effect I would not have said anything. My bad.

 

Still, I'd like to receive some constructive feedback on my second post.

Edited by sietse11
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

That label doesn't exist. I think you mean OnNPCKillEvent - see doc/script_commands.txt for details.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  127
  • Reputation:   7
  • Joined:  02/10/13
  • Last Seen:  

That label doesn't exist. I think you mean OnNPCKillEvent - see doc/script_commands.txt for details.

Can you be more annoying?

 

I am asking this cause your custom/quests/hunting missions and the db/doc are either to hard to read or display information that is either useless or not readable on a single screen.

 

Some examples,

OnNPCKillEvent:

This special label triggers when a player kills a monster. The variable
'killedrid' is set to the Class (mob ID) of the monster killed.

skipping a label or 2

Example: //being a useless example

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;
}
// hunting missions example
OnNPCKillEvent:
    if (!getcharid(1) || !.Party) {
        if (!#Mission_Count || !Mission0) end;
        for (set .@i, 0; .@i<.Quests; set .@i,.@i+1) {
            if (strmobinfo(1,killedrid) == strmobinfo(1,getd("Mission"+.@i))) {
                if (getd("Mission"+.@i+"_") < #Mission_Count) {
                    dispbottom "[Hunting Mission] Killed "+(set(getd("Mission"+.@i+"_"),getd("Mission"+.@i+"_")+1))+" of "+#Mission_Count+" "+strmobinfo(1,killedrid)+".";
                    end;

So what I know,

OnNPCKillEvent:
if (BLABLA == 2-1-1){
   if   (killedrid == 1714) //1714 = Ferus red
      {
      set redferuskills,redferuskills + 1;// counts red ferus kills
      }
      else if  (killedrid == 1717) //1717 = Ferus green
      {
      set greenferuskills,greenferuskills + 1;// counts green ferus kills
   }
   end;
   if (greenferuskills > 99) && (redferuskills > 99) 
   {
   set redferuskills,0;
   set greenferuskills,0;
   set BLABLA,2-1-2;
   }
   end;

This should count ferus kills if your quest variable is BLABLA,2-1-1.

Then when hitting 100 or more on both ferus should set quest variable BLABLA,2-1-2 and stop the counting.

 

Now when talking to the npc he will

set BLABLA,2-1-1;
close;

and then start the onNPCKillEvent.

Is this the proper way of using this label?

Edited by sietse11
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

Can u be more annoying?

 

This example for On<label name>:

Example:
 
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;
}

 

if ur question about onNPCDieEvent, nothing label for it except it's ur own label like the example above. just need to change the OnThisMobDeath to 'onNPCDieEvent and change the mob id to mob id that u want.

if you want label that triggered if u kill mob and get the mob id, u must using 'OnNPCKillEvent'

-<tab>script<tab>baaakaaa<tab>-1,{
OnNPCKillEvent:
dispbottom "Look I just killed "+killedrid+" baka mob!";
}

 

u know, people must know their reading skill before blaming other.

  • Upvote 1
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...