Jump to content
  • 0
Hadeszeus

Need Help on this. Adding Party Members Map Check

Question

Hi Guys,

 

I have this script that gives an item to the Killer of the MVPS. The rewards is separate from PARTY KILLER and A SOLO KILLER.

 

Im trying to add a condition that check if the party members are in the same map of the KILLER when the MVP was killed.
If not in the same map of KILLER. No reward will be given.

The problem is I can't make it work and I need your help.

I added this before it gives the item to the party.
 

 if ( strcharinfo(3) != .@mapc$ ) end;

 

-	script	MVPREWARD	-1,{OnNPCKillEvent:    if ( !getmonsterinfo( killedrid, MOB_MVPEXP ) ) end;    if ( getcharid(1) ) {	.@mapc$ = strcharinfo(3);        getpartymember getcharid(1), 1;        getpartymember getcharid(1), 2;        for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {            if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) { // what happens if someone in the party member is offline =/                .@partymemberaid[.@c] = $@partymemberaid[.@i];                .@c++;            }        }        if ( strcharinfo(3) != .@mapc$ ) end;	getitem 501, 5, .@partymemberaid[ rand( .@c ) ];           announce "Party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;     }    else {	getitem 501, 1; //Get Item if KILLER is not in a party.        announce "Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;     }   end;}
Edited by Hadeszeus

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0
-	script	MVPREWARD	-1,{OnNPCKillEvent:    if ( !getmonsterinfo( killedrid, MOB_MVPEXP ) ) end;    if ( getcharid(1) ) {        .@mapc$ = strcharinfo(3);        getpartymember getcharid(1), 1;        getpartymember getcharid(1), 2;        for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {            if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) { // what happens if someone in the party member is offline =/				if (attachrid($@partymemberaid[.@i])){					if (strcharinfo(3) == .@mapc$){						.@partymemberaid[.@c] = $@partymemberaid[.@i];						.@c++;					}				}            }        }        getitem 501, 5, .@partymemberaid[ rand( .@c ) ];           announce "Party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;     }    else {        getitem 501, 1; //Get Item if KILLER is not in a party.        announce "Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;     }   end;}

This should work.

Share this post


Link to post
Share on other sites
  • 0

 

-	script	MVPREWARD	-1,{OnNPCKillEvent:    if ( !getmonsterinfo( killedrid, MOB_MVPEXP ) ) end;    if ( getcharid(1) ) {        .@mapc$ = strcharinfo(3);        getpartymember getcharid(1), 1;        getpartymember getcharid(1), 2;        for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {            if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) { // what happens if someone in the party member is offline =/				if (attachrid($@partymemberaid[.@i])){					if (strcharinfo(3) == .@mapc$){						.@partymemberaid[.@c] = $@partymemberaid[.@i];						.@c++;					}				}            }        }        getitem 501, 5, .@partymemberaid[ rand( .@c ) ];           announce "Party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;     }    else {        getitem 501, 1; //Get Item if KILLER is not in a party.        announce "Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;     }   end;}

This should work.

 

Thanks Dastgir! 

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.