Jump to content
  • 0

OnNPCMapKillEvent Label


Question

Posted (edited)

Hi,

I'm requesting a "OnNPCMapKillEvent" Label. It should work like this:

  • Triggers when a player kills a monster on the same map as the NPC.
  • Set Variable "killedrid" to Monster ID.
  • Set Variable "killerrid" to Player ID.

I would love to have this Label because I don't want to use OnNPCKillEvent. It would cause the server alot of work to run my script every time a monster is killed on the whole server.

Sincerely Bahmut

Edited by Bahmut

3 answers to this question

Recommended Posts

Posted

huh ? what are we needing something like this when this can be done with just some little trick of using the OnNPCKillEvent

[ Pastebin ] Sample

if you claim that the script label is runing upon killing of a monster by every player...

then you want to create a new 1 that only run in certain map..

i think you are wrong..

every single event label is running no matter you are in the map or not...

this apply to those

OnNPCKillEvent:
OnPCLoadMapEvent:
etc..

all these work across the map even you add a map check....but it will still run

Posted

*getmapxy("<variable for map name>",<variable for x>,<variable for y>,<type>{,"<search string>"})

This function will locate a character object, NPC object or pet's coordinates

and place their coordinates into the variables specified when calling it. It

will return 0 if the search was successful, and -1 if the parameters given were

not variables or the search was not successful.

Type is the type of object to search for:

0 - Character object

1 - NPC object

2 - Pet object

3 - Monster object.

While 3 is meant to look for a monster object, no searching will be done if you

specify type 3, and the function will always return -1.

The search string is optional. If it is not specified, the location of the

invoking character will always be returned for types 0 and 2, the location of

the NPC running this function for type 1.

If you compare player location to npc location before code in OnNPCKillEvent, you'll have your desired event.

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