function script random_party_buff {
.@party_id = getcharid(1);
setarray .@skill_name$,
"RK_REFRESH",
"RK_CRUSHSTRIKE",
"RK_MILLENNIUMSHIELD",
"RK_VITALITYACTIVATION",
"RK_FIGHTINGSPIRIT",
"RK_ABUNDANCE",
"RK_GIANTGROWTH",
"RK_STORMBLAST",
"RK_STONEHARDSKIN";
.@skill_name_size = getarraysize( .@skil_name$ );
if( .@party_id ){
getmapxy( .@map1$,.@x1,.@y1,0 );
getpartymember .@party_id;
.@aid = getcharid(3);
while( .@i < $@partymembercount ){
getmapxy( .@map2$,.@x2,.@y2,0,$@partymembername$[.@i] );
if( .@map1$ == .@map2$ && distance( .@x1,.@y1,.@x2,.@y2 ) <= 7 ){
attachrid( getcharid( 3,$@partymembername$[.@i] ) );
itemskill .@skill_name$[ rand( .@skill_name_size ) ],1;
.@count++;
}
.@i++;
}
attachrid( .@aid );
dispbottom "Total "+.@count+" Member received buff.";
}
return;
}