Jump to content
  • 0

Issue with OnMobDeath:


Question

Posted

Hi, I am currently using the code below to give a reward to the character which kills (Takes out most of the monster's HP).

However, when there are a few players attacking the monster and it dies, for some reason the reward is being given to multiple players.

Could anyone tell me what I am doing wrong? or if this is a bug with OnMobDeath?

// monster
monster strcharinfo(3),0,0,"[Event] Boss"+"",1957,1,strnpcinfo(0)+"::OnBossKill";

OnBossKill:

delwaitingroom;
if( mobcount( strcharinfo(3),strnpcinfo(0)+"::OnBossKill" ) > 0 ){
waitingroom "There are ["+mobcount( strcharinfo(3),strnpcinfo(0)+"::OnBossKill")+"] Monsters remaining.",0;
end;
}else{
delwaitingroom;
waitingroom "Good job!",0;
specialeffect 709;
announce "Well done to team [ "+getpartyname( getcharid(1) )+" ] which has sucessfully completed the mission! ",0;
getpartymember getcharid(1),1;
getpartymember getcharid(1),2;
set @Location$,strcharinfo(3);
for ( set .@i, 0; .@i < $@partymembercount; set .@i, .@i +1 ){
	if ( isloggedin($@partymemberaid[.@i]) ){
		attachrid $@partymemberaid[.@i];
			if( strcharinfo(3) == @Location$ ){
			unittalk getcharid(3),"YEEEY! We have done it!";
			unitemote getcharid(3),e_heh;
				specialeffect2 709;
					for( set .@a,0; .@a < getarraysize( .Reward ); set .@a,.@a + 2 ){
						getitem .Reward[.@a],.Reward[.@a+1], $@partymemberaid[.@i];
						}
				dispbottom "[Laxus] Here is your reward...";
				stopnpctimer;

 

Thank you!

5 answers to this question

Recommended Posts

  • 0
Posted (edited)

Ok, have been watching the players doing the event and it seems that it still continues to give 2 or 3 rewards sometimes. (There were 7 people on the party and 2 received the reward.)

Could anybody help?

Edited by Profile

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...