Terrorsoul Posted January 18, 2014 Posted January 18, 2014 (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 January 18, 2014 by Terrorsoul Quote
Patskie Posted January 19, 2014 Posted January 19, 2014 - 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; + } 1 Quote
AnnieRuru Posted January 19, 2014 Posted January 19, 2014 (edited) + for ( .@b = 0; .@b < $@partymembercount; .@b++ ) + if ( attachrid( $@partymemberaid[.@b] ) )there's a flaw about thishttp://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 ) /2ok 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 January 19, 2014 by AnnieRuru Quote
Terrorsoul Posted January 19, 2014 Author Posted January 19, 2014 thx Annie and Patskie, my instance is complete Quote
Question
Terrorsoul
i wanna give the reward to all members of the party.
Edited by Terrorsoul3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.