Hadeszeus 15 Posted June 1, 2014 (edited) 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 June 1, 2014 by Hadeszeus Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted June 1, 2014 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. Quote Share this post Link to post Share on other sites
0 Hadeszeus 15 Posted June 19, 2014 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. Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted June 19, 2014 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 Quote Share this post Link to post Share on other sites
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 HadeszeusShare this post
Link to post
Share on other sites