viewing paste Unknown #13378 | Athena

Posted on the
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
-   script  getskill    -1,{
    
OnInit:
        bindatcmd "getskill",strnpcinfo(3)+"::OnAtcommand",99,99;
        end;
        
OnAtcommand:
        set .@SkillID, .@atcmd_parameters$[0];
        set .@SkillLv, .@atcmd_parameters$[1];
        set .@SkillFlag, .@atcmd_parameters$[2];
    if(.@atcmd_numparameters < 2) {
        message strcharinfo(0),"Invalid Syntax (usage: @getskill <skill id> <level> <flag>).";
        message strcharinfo(0),.@atcmd_command$+" failed.";
    } else  if(.@SkillLv >= 11){
        message strcharinfo(0),"Invalid Syntax (Max Skill level is 10.)";
        message strcharinfo(0),.@atcmd_command$+" failed.";
        end;
    } else if(.@SkillFlag >=5){
        message strcharinfo(0),"Invalid Syntax (Max Skill flag is 4.)";
        message strcharinfo(0),.@atcmd_command$+" failed.";
        end;
    } else {
        skill .@SkillID,.@SkillLv,.@SkillFlag;
        message strcharinfo(0),"Success.";
    }
    end;
}
Viewed 1138 times, submitted by Pneuma.