viewing paste random party buff | Athena

Posted on the | Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
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;
}
Viewed 1673 times, submitted by Emistry.