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) {
        [email protected] = #Daily_Timer + .minutes_required * 60; // 1 hour
        message strcharinfo(0),"You still have "+callfunc("Time2Str",[email protected])+" left before you can receive a reward.";
        end;
    }
    #HOURLYCLAIM = 0;
    #Minute_Online = 0;
 
    dispbottom "----- [ UniteRO Hourly Rewards ] -----------------",0xFFFFFF;
    
    if(.EnableItemRewards) {
        set [email protected], getarraysize(.rewards) - 1;
        set [email protected], rand(0, [email protected] / 2) * 2;
        [email protected] = .rewards[[email protected]];
        [email protected]  = .rewards[[email protected] + 1];
 
        [email protected] = getcharid(0);
        [email protected]$ = strnpcinfo(0);
        [email protected]$ = "** Hourly Reward **";
        [email protected]$ = "You have received your hourly reward.";
        [email protected] = 0;
        if (!checkweight2([email protected],[email protected])) {
            dispbottom "The rewards has been sent to your mail.",0x00FFFF;
            mail [email protected], [email protected]$, [email protected]$, [email protected]$, [email protected], [email protected], [email protected];
        }else{
            getitem [email protected], [email protected];
        }
    }
    
    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:
    [email protected] = #Daily_Timer + .minutes_required * 60; // 1 hour
    message strcharinfo(0),"You still have "+callfunc("Time2Str",[email protected])+" 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 447 times, submitted by Guest.