Partymember unequal reward distribution

Helena

New member
Messages
238
Points
0
Emulator
rAthena
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.
default_smile.png

 
Code:
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;}}}

 
 
 
 
 
 
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)

 
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. >.<

 
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
default_wink.png


 
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
default_wink.png
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
 
Thanks JaBote, it works!
default_smile.png


 
Last edited by a moderator:
Back
Top