Jump to content
  • 0
Hadeszeus

Can I request this script?

Question

OnNPCKillEvent:	if ( killedrid == 1002 ) {		if ( !getcharid(1) ) { // if no party			count++;		}		else {			getmapxy .@map1$, .@x1, .@y1, 0; // killer position			getpartymember getcharid(1), 1;			getpartymember getcharid(1), 2;			for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {				if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {					attachrid $@partymemberaid[.@i];					getmapxy .@map2$, .@x2, .@y2, 0;					if ( .@map1$ == .@map2$ && distance(.@x1,.@y1,.@x2,.@y2) <= 30 ) // same map and the distance is within 30 cell range						count++;				}			}		}	}	end;

This script was originally written by Annieruru.

 

I wan't to make a script that OnNPCKillEvent the party will get an item shared to the party who's distance to the killer is within 30 cells.

 

How can I do this?

Edited by Hadeszeus

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

That does still work inside of a script, but counts mobs instead of giving items.

 

If you want all of your party members to get an item, you can try changing all

count++;

on the script to:

getitem <item ID>, amount;

 

And you're good to go.

 

Just notify me if that wasn't what you wanted.

Share this post


Link to post
Share on other sites
  • 0

That does still work inside of a script, but counts mobs instead of giving items.

 

If you want all of your party members to get an item, you can try changing all

count++;

on the script to:

getitem <item ID>, amount;

 

And you're good to go.

 

Just notify me if that wasn't what you wanted.

 

Hi Jabote again thank you! 

 

But I still have one problem. How can I check if the the KILLER OF THE MOBS CURRENT MAP is equal to PARTY MEMEBERS LOCATION?

 

FOR EXAMPLE

 

IF THE KILLER OF THE MOB IS IN ABBEY02 and other PARTY MEMBERS IS NOT EQUAL TO KILLER OF THE MOBS MAP.

THEY DONT GET THE ITEM. 

 

MEANING THEY NEED TO BE IN THE SAME MAP OF THE KILLERID TO GET THE ITEM.

Share this post


Link to post
Share on other sites
  • 0

 

That does still work inside of a script, but counts mobs instead of giving items.

 

If you want all of your party members to get an item, you can try changing all

count++;

on the script to:

getitem <item ID>, amount;

 

And you're good to go.

 

Just notify me if that wasn't what you wanted.

 

Hi Jabote again thank you! 

 

But I still have one problem. How can I check if the the KILLER OF THE MOBS CURRENT MAP is equal to PARTY MEMEBERS LOCATION?

 

FOR EXAMPLE

 

IF THE KILLER OF THE MOB IS IN ABBEY02 and other PARTY MEMBERS IS NOT EQUAL TO KILLER OF THE MOBS MAP.

THEY DONT GET THE ITEM. 

 

MEANING THEY NEED TO BE IN THE SAME MAP OF THE KILLERID TO GET THE ITEM.

Isn't it checked already?

 

if ( .@map1$ == .@map2$ && distance(.@x1,.@y1,.@x2,.@y2) <= 30 ) // same map and the distance is within 30 cell range

Share this post


Link to post
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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.