viewing paste Unknown #13793 | 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 28 29 30 31 32 33 34 35 36 37 38 39 40
-   script  WeaponLevel -1,{
if(!.init) donpcevent strnpcinfo(3)+"::OnInit";
OnInit:
    //Configuration
    setarray .WepXP[0],100,1000, 3700, 10100, 22600, 44200, 78500, 129700, 202600, 302600; //Weapon Level Experience
    set .MaxWLV,getarraysize(.WepXP);
    set .init,1;
    bindatcmd "weapon",strnpcinfo(3)+"::OnAtcommand",0,40;
end;
 
OnAtcommand:
if(getequipname(EQI_HAND_R) != ""){
set $@Weapon$,getequipname(EQI_HAND_R);
dispbottom "["+$@Weapon$+"] Level: "+WeaponLv+" | Expereince: "+WeaponExp+"/"+.WepXP[WeaponLv]+"";
}else {
dispbottom "[Weapon] I'm sorry but you don't seem to have a Weapon on.";}
end;
 
OnNPCKillEvent:
    setarray .exp[0],1,2,3,4,5,6,7,8,9,10; //Experience per kill
    setarray .weapons[0],1701,1201,1101;
    set .XPperKill,.exp[rand(getarraysize(.exp))];
    set $@Weapon$, getequipname(EQI_HAND_R);
    for (set .@i,0; .@i <= (getarraysize(.weapons)-1);set .@i,.@i +1)
    if(getequipid(EQI_HAND_R) == .weapons[.@i]){
        if(WeaponLv == .MaxWLV){
        end;} else{
            dispbottom "["+$@Weapon$+"] +"+.XPperKill+" Experience";
        set WeaponExp, WeaponExp+.XPperKill;}
        if(.WepXP[WeaponLv] <= WeaponExp && WeaponLv < .MaxWLV){
        set WeaponLv, WeaponLv+1;
        set StatusPoint, StatusPoint+1*WeaponLv;
        dispbottom "["+$@Weapon$+"] Weapon Level: "+WeaponLv+"!";
        dispbottom "["+$@Weapon$+"] Stats: "+1*WeaponLv+"!";
        }
    }else{
    end;}
    
 
}
Viewed 1064 times, submitted by Pneuma.