viewing paste Unknown #56106 | Text

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 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
prontera,155,150,3  script  Hourly Reward   4_M_KHMAN,{
 
    if(!#HOURLYCLAIM) {
        .@HTimer = #Daily_Timer + .minutes_required * 60; // 1 hour
        message strcharinfo(0),"You still have "+callfunc("Time2Str",.@HTimer)+" left before you can receive a reward.";
        end;
    }
    #HOURLYCLAIM = 0;
    #Minute_Online = 0;
 
    dispbottom "----- [ UniteRO Hourly Rewards ] -----------------",0xFFFFFF;
    
    if(.EnableItemRewards) {
        set .@size, getarraysize(.rewards) - 1;
        set .@index, rand(0, .@size / 2) * 2;
        .@claimitem = .rewards[.@index];
        .@claimamt  = .rewards[.@index + 1];
 
        .@charid = getcharid(0);
        .@sender$ = strnpcinfo(0);
        .@title$ = "** Hourly Reward **";
        .@body$ = "You have received your hourly reward.";
        .@zeny = 0;
        if (!checkweight2(.@claimitem,.@claimamt)) {
            dispbottom "The rewards has been sent to your mail.",0x00FFFF;
            mail .@charid, .@sender$, .@title$, .@body$, .@zeny, .@claimitem, .@claimamt;
        }else{
            getitem .@claimitem, .@claimamt;
        }
    }
    
    if(.EnableVarRewards) {
        #ACTIVITYPOINTS += 1;
        dispbottom "You've received 1 Activity Point and your hourly reward item.",0x00FFFF;
        dispbottom "Total Activity Points: "+#ACTIVITYPOINTS+"!",0x00FFFF;
    }
    end;
 
OnCheck:
    #Minute_Online += 1;
    if (#Minute_Online >= .minutes_required) {
        #HOURLYCLAIM = 1;
        #Minute_Online = 0;
        #Daily_Timer = gettimetick(2) - (#Minute_Online*60);
        dispbottom "You have been online for an hour. Talk to the Hourly Reward NPC to get your rewards!",0x00FFFF;
    }
    addtimer 60000, strnpcinfo(3)+"::OnCheck";
    end;
 
OnPCLoginEvent:
    sleep2 1250;
    addtimer 60000,strnpcinfo(3)+"::OnCheck";
    #Daily_Timer = gettimetick(2) - (#Minute_Online*60);
    end;
 
OnCheckHourly:
    .@HTimer = #Daily_Timer + .minutes_required * 60; // 1 hour
    message strcharinfo(0),"You still have "+callfunc("Time2Str",.@HTimer)+" left before you can receive a reward.";
    end;
 
OnInit:
    // Removed (Check the minutes/seconds left via NPC)
    //bindatcmd "hourly",strnpcinfo(3)+"::OnCheckHourly"; 
    
    // Configuration
    .minutes_required = 60; // Minutes Required (60 = 60 minutes)
    
    // Toggle Rewards
    .EnableItemRewards = 1; // Enable item rewards? (0 = Disabled | 1 = Enabled).
    .EnableVarRewards = 1;  // Enable item rewards? (0 = Disabled | 1 = Enabled).
    
    // Reward Sets (This only gives 1 Random ID with the Designated Amount)
    // <ItemID, Amount>
    setarray .rewards[0], 3550,  2, // 
                          3551,  2, //
                          3552,  2, //
                          3553,  2, //
                          12083, 2, // Giant Burito
                          12093, 2, // Special Toast 
                          12073, 2, // Bearfoot Special
                          12072, 3, // Whole Roast
                          12082, 3, // Sumptuous Feast
                          12094, 3, // Heavenly Fruit Juice
                          12088, 3, // Incredibly Spicy Curry
                          12078, 3, //
                          12092, 3, //
                          12089, 3, //
                          12077, 3, //
                          12087, 3, //
                          12098, 3, //
                          12082, 3, //
                          12079, 3; //                  
    end;
}
Viewed 637 times, submitted by Guest.