viewing paste Unknown #14458 | 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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
// Race to the Max Level Script
// Original Author [ Capuche ]
// Edited Version [ NubDesigner ]
// 8-16-2014
 
 
prontera,148,111,5      script  Race to MaxLevel        423,{
 
// A Small Configuration -------------------------
set .@reward_limit,41// Rewards Count > If the value already exceed, npc will decline to give rewards anymore
set .@bLvl,99;          // Base Level requirements.
set .@jLvl,70;          // Job Level requirements.
// -----------------------------------------------
 
        if( BaseLevel == .@bLvl && JobLevel == .@jLvl && reward_limit == 0 && Upper && .count < .@reward_limit ){
                //if( .count < 3 )
                //      getitem 501,1;
                if( .count < 40 )
                        getitem 501,1;
                        getitem 502,1;
                        getitem 503,1;
                        getitem 504,1;
                reward_limit++;
                .count++;
                announce "Congratulations " + strcharinfo(0) + " for receiving the Level | Job Level  "+.@bLvl+"/"+.@jLvl+" Reward, there are only "+ (.@reward_limit-.count) +" Rewards Left!",0;
        }
        else if ( reward_limit ) {
                mes "[ Race to Max Level ]";
                mes "You've already got your reward.";
                mes "Please give chance to others.";
                mes "Thank you.";
                close;
        }
        else if ( BaseLevel != .@bLvl ) {
                mes "[ Race to Max Level ]";
                mes "You need to be atleast Level "+.@bLvl+".";
                mes "To claim your reward.";
                mes " ";
                mes "Reward Left : ^E42217"+ (.@reward_limit-.count) +"^000000 Left.";
                close;
        }
        else if ( JobLevel != .@jLvl) {
                mes "[ Race to Max Level ]";
                mes "You need to have atleast";
                mes "Job Level "+.@jLvl+".";
                mes "To claim your reward.";
                mes " ";
                mes "Reward Left : ^E42217"+ (.@reward_limit-.count) +"^000000 Remaining.";
                close;
        }
        mes "[ Race to Max Level ]";
        mes "I am so sorry, But it seems that all rewards are claimed already.";
        mes " ";
        mes "Reward Left : ^E42217"+ (.@reward_limit-.count) +"^000000 Left.";
        close;
        end;
OnInit:
        .count = query_sql( "select `value` from `global_reg_value` where `str`= 'reward_limit'", .@value );
        if ( .count >99 ) end;
// limit to 127 players online here
        .@size = query_sql( "select `account_id` from `char` where `char_id` not in ( select `char_id` from `global_reg_value` where `str`= 'reward_limit' ) and `online`=1", .@account_id );
        for ( .@i = 0; .@i < .@size; .@i++ ) {
                attachrid .@account_id[.@i];
                if ( reward_limit ) {
                        .count++;
                        if ( .count > 39 ) end;
                }
        }
        end;
}
Viewed 253 times, submitted by unknown.