viewing paste Unknown #47584 | 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
-   script  HourlyPoint -1,{
 
OnInit:
    setarray .item_get, 7539, 7711;
    setarray .item_amt,    1,    5;
    
    // How many cash point given?
    .cashpoints = 100;
    
    // How many minute for hourly event to be paused when player being idle
    .idle_timer = 59;
    
    // do not touch this
    .idle_debug = .idle_timer *60;
    end;
 
OnPCLoginEvent:
    attachnpctimer ""+strcharinfo(0);
    initnpctimer;
    end;
 
OnTimer60000:
    if(checkvending() || checkchatting() || checkidle() > .idle_debug) {
        if (checkvending()) .@reason$ = " vending or has has a buyingstore";
        else if (checkchatting()) .@reason$ = " in a chatroom";
        else if (checkidle()) .@reason$ = " been idle more than "+.idle_timer+" minute";
        dispbottom "Hourly Point Event has been paused, Reason: "+.@reason$;
    } else {
        @minute++;
        if (@minute == 60) {
            @minute = 0;
            .@rand = getarraysize(.item_get)+1;
            .@reward = rand(.@rand);
            if (.@reward == (.@rand-1)) {
                #CASHPOINTS += .cashpoints;
                dispbottom "Hourly Point Event: You recived 100 CASHPOINTS,for staying in game for 1 hour.";
            } else {
                .@itm = !.item_get[.@reward] ? 501 : .item_get[.@reward];
                .@qty = !.item_amt[.@reward] ? 1 : .item_amt[.@reward];
                getitem .@itm, .@qty;
                dispbottom "Hourly Point Event: You received "+.@qty+"x "+getitemname(.@itm)+" as reward for staying in game for 1 hour.";
            }
        }
    }
    stopnpctimer;
    initnpctimer;
    end;
}
Viewed 990 times, submitted by Guest.