Jump to content
  • 0

Issue with OnMobDeath:


Profile

Question


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  77
  • Reputation:   1
  • Joined:  04/15/17
  • Last Seen:  

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!

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  50
  • Topics Per Day:  0.02
  • Content Count:  763
  • Reputation:   227
  • Joined:  02/11/17
  • Last Seen:  

Your rewarding is for the whole party :o

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  77
  • Reputation:   1
  • Joined:  04/15/17
  • Last Seen:  

Is it? hahaha, how would I change it to only the mobkiller?

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  50
  • Topics Per Day:  0.02
  • Content Count:  763
  • Reputation:   227
  • Joined:  02/11/17
  • Last Seen:  

you just need to remove the party member aid in the rewarding :))
 

getitem .Reward[.@a],.Reward[.@a+1], $@partymemberaid[.@i];
//
getitem .Reward[.@a],.Reward[.@a+1];

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  77
  • Reputation:   1
  • Joined:  04/15/17
  • Last Seen:  

Oooh, I see... So that was the issue.

Will put it on the live server and see if the issue continues. 

Thank you!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  77
  • Reputation:   1
  • Joined:  04/15/17
  • Last Seen:  

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
Link to comment
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.   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.

×
×
  • Create New...