Jump to content
  • 0

OnNPCMapKillEvent Label


Bahmut

Question


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  382
  • Reputation:   38
  • Joined:  01/17/12
  • Last Seen:  

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

3 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  43
  • Reputation:   2
  • Joined:  01/17/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  382
  • Reputation:   38
  • Joined:  01/17/12
  • Last Seen:  

oh man i haven't thougt about this at all. sorry for bothering you guys. next time: first think simple^^

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