Jump to content
  • 0

Help with this script


Question

Posted (edited)

i wanna give the reward to all members of the party.

OnBossKill:
delwaitingroom;
if( mobcount( strcharinfo(3),strnpcinfo(0)+"::OnBossKill" ) > 0 ){
waitingroom "Faltan ["+mobcount( strcharinfo(3),strnpcinfo(0)+"::OnBossKill")+"] Mobs",0;
end;
}else{
delwaitingroom;
waitingroom "HORA DEL PREMIO",0;
specialeffect 709;
announce "Felicidades la Party [ "+getpartyname( getcharid(1) )+" ] ha superado la Instance Of Mutantsaurus.",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),"Yeeaaah  !! Vencimos a todos los Mobs!!!";
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 "Has ganado un Item Legendario por pasar la Instance Of Mutantsaurus";
}
}
Edited by Terrorsoul

3 answers to this question

Recommended Posts

Posted (edited)

+ for ( .@b = 0; .@b < $@partymembercount; .@b++ )
+ if ( attachrid( $@partymemberaid[.@b] ) )
there's a flaw about this

http://www.eathena.ws/board/index.php?s=&showtopic=271168&view=findpost&p=1485484

https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L8112

it should be

+ for ( .@b = 0; .@b < $@partymembercount; .@b++ )
+ if ( isloggedin( $@partymemberaid[.@b], $@partymembercid[.@b] ) ) {
+ attachrid $@partymemberaid[.@b];
EDIT: ops !

============================================================

-EDIT-

hmmm ... I think your answer is wrong

for ( .@b = 0; .@b < $@partymembercount; .@b++ )
	if ( attachrid( $@partymemberaid[.@b] ) )
		for( set .@a,0; .@a < getarraysize( .Reward ); set .@a,.@a + 2 ) {
			getitem .Reward[.@a],.Reward[.@a+1], $@partymemberaid[.@b];
			unittalk getcharid(3),"Yeeaaah  !! Vencimos a todos los Mobs!!!";
			unitemote getcharid(3),e_heh;
			specialeffect2 709;
		}
if you indent properly, this script will make the player talk "Yeeaah !!" for the amount of times equal to getarraysize( .Reward ) /2

ok I do this one then

OnBossKill:
	delwaitingroom;
	if( mobcount( strcharinfo(3),strnpcinfo(0)+"::OnBossKill" ) > 0 ){
		waitingroom "Missing ["+ mobcount( strcharinfo(3),strnpcinfo(0)+"::OnBossKill") +"] Mobs",0;
		end;
	} else {
//		delwaitingroom; // no need delwaitingroom twice
		waitingroom "PRIZE TIME",0;
		specialeffect EF_POK_JAP;
		announce "Congratulations Missing the Party [ "+ strcharinfo(1) +" ] has exceeded the Instance Of Mutant Saurus.", bc_all;
		getpartymember getcharid(1), 1;
		getpartymember getcharid(1), 2;
		set .@thismap$, strcharinfo(3);
		set .@reward_size, getarraysize( .Reward );
		for ( set .@i, 0; .@i < $@partymembercount; set .@i, .@i +1 ) {
			if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
				attachrid $@partymemberaid[.@i];
				if ( strcharinfo(3) == .@thismap$ ) {
					unittalk getcharid(3),"Yeeaaah! We beat all the Mobs!!!";
					unitemote getcharid(3), e_heh;
					specialeffect2 EF_POK_JAP;
					for( set .@a,0; .@a < .@reward_size; set .@a, .@a + 2 )
						getitem .Reward[.@a], .Reward[.@a+1]; // already attached to current player, no need optional parameter
					dispbottom "You won a Legendary Item by passing the Instance Of Mutant Saurus";
				}
			}
		}
	}
Edited by AnnieRuru
Posted
- unittalk getcharid(3),"Yeeaaah !! Vencimos a todos los Mobs!!!";
- 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];

Then : 

+ for ( .@b = 0; .@b < $@partymembercount; .@b++ )
+ if ( attachrid( $@partymemberaid[.@b] ) )
+ for( set .@a,0; .@a < getarraysize( .Reward ); set .@a,.@a + 2 ) {
+ getitem .Reward[.@a],.Reward[.@a+1], $@partymemberaid[.@b];
+ unittalk getcharid(3),"Yeeaaah  !! Vencimos a todos los Mobs!!!";
+ unitemote getcharid(3),e_heh;
+ specialeffect2 709;
+ }
  • Upvote 1

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