Jump to content
  • 0
Helena

Partymember unequal reward distribution

Question

Hi annie, jabote, and other good scripters~
 
I have an issue with the script, it works fine when all partymembers are online, but if they aren't it doesn't.  To clarify, if I go with a team of 3, and only 2 are online, the killer gets the prize that is meant for the third (offline) partymember.
 
What i want is all partymembers to get max 1 gold (969), is it possible? Thanks a lot. :)
 
OnMobKilled3:if(!mobcount("que_qaru01",strnpcinfo(0)+"::OnMobKilled3")) {	sleep2 2000;mapannounce "que_qaru01","Boss-Monster is now dead!",0; sleep2 2000;announce "Your party finished this monster battle, good job!",0;sleep2 2000;getpartymember getcharid(1),2;for(set .@i,0; .@i<$@partymembercount; set .@i,.@i+1){attachrid $@partymemberaid[.@i];getitem 969,1;warp "prontera",156,184;end;}}}
 
 
 
 
 

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

The script Dastgir made has a small mistake on the code:

			if (attachrid($@partymemberaid[.@i]){				getitem 969,1;				warp "prontera",156,184;				end;			}

This means that when one gets the prizes, others won't since the execution of the script will get stopped there.

 

Try placing that end; at the end of the script, like this:

OnMobKilled3:	if(!mobcount("que_qaru01",strnpcinfo(0)+"::OnMobKilled3")) {		sleep2 2000;		mapannounce "que_qaru01","Boss-Monster is now dead!",0;		sleep2 2000;		announce "Your party finished this monster battle, good job!",0;		sleep2 2000;		getpartymember getcharid(1),2;		for(.@i = 0; .@i<$@partymembercount; .@i++){			if (attachrid($@partymemberaid[.@i]){				getitem 969,1;				warp "prontera",156,184;			}		}	}	end;

 

Test and comment please ;)

Share this post


Link to post
Share on other sites
  • 0
OnMobKilled3:	if(!mobcount("que_qaru01",strnpcinfo(0)+"::OnMobKilled3")) {		sleep2 2000;		mapannounce "que_qaru01","Boss-Monster is now dead!",0;		sleep2 2000;		announce "Your party finished this monster battle, good job!",0;		sleep2 2000;		getpartymember getcharid(1),2;		for(.@i = 0; .@i<$@partymembercount; .@i++){			if (attachrid($@partymemberaid[.@i]){				getitem 969,1;				warp "prontera",156,184;				end;			}		}	}

That's what I can think of to prevent the problem you mentioned. (I added check if attachrid is successful then only give item)

Share this post


Link to post
Share on other sites
  • 0

 

OnMobKilled3:	if(!mobcount("que_qaru01",strnpcinfo(0)+"::OnMobKilled3")) {		sleep2 2000;		mapannounce "que_qaru01","Boss-Monster is now dead!",0;		sleep2 2000;		announce "Your party finished this monster battle, good job!",0;		sleep2 2000;		getpartymember getcharid(1),2;		for(.@i = 0; .@i<$@partymembercount; .@i++){			if (attachrid($@partymemberaid[.@i]){				getitem 969,1;				warp "prontera",156,184;				end;			}		}	}

That's what I can think of to prevent the problem you mentioned. (I added check if attachrid is successful then only give item)

 

Thanks Dastgir, but now the partyleader does not get any item nor does he get warped out. The other partymembers do though. >.<

Share this post


Link to post
Share on other sites
  • 0

The script Dastgir made has a small mistake on the code:

 

if (attachrid($@partymemberaid[.@i]){				getitem 969,1;				warp "prontera",156,184;				end;			}
This means that when one gets the prizes, others won't since the execution of the script will get stopped there.

 

Try placing that end; at the end of the script, like this:

OnMobKilled3:	if(!mobcount("que_qaru01",strnpcinfo(0)+"::OnMobKilled3")) {		sleep2 2000;		mapannounce "que_qaru01","Boss-Monster is now dead!",0;		sleep2 2000;		announce "Your party finished this monster battle, good job!",0;		sleep2 2000;		getpartymember getcharid(1),2;		for(.@i = 0; .@i<$@partymembercount; .@i++){			if (attachrid($@partymemberaid[.@i]){				getitem 969,1;				warp "prontera",156,184;			}		}	}	end;
 

Test and comment please ;)

oops, i really have not seen that end command..... and just changed attachrid to the if condition with all other lines same as 1st post.. xD

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.