Can I request this script?

Hadeszeus

New member
Messages
651
Points
0
Location
Philippines
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?

 
Last edited by a moderator:
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.

 
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.

 
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?

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