viewing paste hourly | 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 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397
-   script  hourlypoints    FAKE_NPC,{
 
OnInit:
    announce "[Mileage Point System]: The system have been reloaded, please relog again to get more mileage points.", bc_all;
 
    .point_name$ = "Mileage points";
    .point_amt = 1;    // Normal points gained.
    .point_amt_vip = 2;    // Normal points gained.
    .dlimit = 1800;    // Stop points if afk greater then in seconds. 600s = 10 minutes
    .enable = 1;
    .level = 50;
    .maxpoints = 300;
    .online_time = 3600; // One hour = 3600 seconds
 
    bindatcmd "mileage", "hourlypoints::OnAtCommand", 0, 99;
    end;
 
OnPCLoginEvent:
 
    if (BaseLevel < .level){
                dispbottom "You must be level 50 above to start the Mileage points system.",0xFFFF00;
                showscript "You must be level 50 above to start the Mileage points system.";
                #idle = 1;
    }
 
    if (#TIMEPOINTS >= .maxpoints){
                #idle = 1;
                showscript "You have reached the maximum mileage 300 points, please spend your points to earn again.";
    }
 
    if (#vendmode >= 1){
                #idle = 1;
        sleep2 2000;
        #idle = 0;
        #vendmode = 0;
    }
 
 
    if (BaseLevel >= .level)
    {
        if (countitem(408) >= 1){
        showscript "Premium Mileage points system has started. x2 Mileage Points per hour."; 
        dispbottom "Premium Mileage points system has started. x2 Mileage Points per hour.",0xFFFFFF; 
                dispbottom "Total " + #TIMEPOINTS + " Mileage points.",0xFFFFFF;
 
        } else {
 
        showscript "Normal Mileage points system started. x1 Mileage Point per hour";
        dispbottom "Normal Mileage points system started. x1 Mileage Point per hour",0xFFFFFF; 
                dispbottom "Total " + #TIMEPOINTS + " Mileage points.",0xFFFFFF;
        }
 
        #idle = 0;
        @backup_time = 0;
 
        if (!#acctick || #acctick > .online_time)
            #acctick = gettimetick(2) + .online_time;
        else
            #acctick += gettimetick(2);
 
        while(.enable)
        {
            //@idle_time = checkidle();
 
            //if (checkvending() >= 1 || checkchatting() == 1 || @idle_time >= .dlimit)
        //if (checkvending() >= 1)
            if (Class == Job_Novice || #TIMEPOINTS >= .maxpoints || checkvending() >= 1 )
            //if (Class == Job_Novice || #TIMEPOINTS >= .maxpoints )
            //if (Class == Job_Ninja)
            {
                #acctick += @idle_time; // Add idle time
                #idle = 1;
        
        if (checkvending() >= 1) {
                showscript "Mileage point system has been stopped.";
                dispbottom "Vending will stop the mileage system.",0xEE4B2B;
        dispbottom "Please re-login to start the system again.",0xFFFFFF;
        }
 
 
        if (Class == Job_Novice) {
                showscript "Mileage point system has been stopped.";
                dispbottom "The Mileage points system has been stopped because you are still a Novice and you must be level 50 with Job Class.",0xEE4B2B;
        dispbottom "Please re-login if you changed class to start the system again.",0xFFFFFF;
        }
 
        if (#TIMEPOINTS >= .maxpoints) {
                showscript "Mileage point system has been stopped.";
                dispbottom "Mileage point system has been stopped.",0xEE4B2B;
            sleep2 1000;
                dispbottom "You've reached the maximum " +.maxpoints+ " mileage points.",0x00ff00;
            sleep2 1000;
                dispbottom "Spend your points to start collecting points again.",0x00ff00;
            sleep2 500;
        dispbottom "Please re-login if you spent points to start the system again.",0xFFFFFF;
        }
            }
            else
            {
 
                sleep2 1000;
                @backup_time = .@time_left = #acctick - gettimetick(2);
 
                if (.@time_left <= 0) {
        if (countitem(408) >= 1){
                    #TIMEPOINTS += .point_amt_vip;
                    #acctick = gettimetick(2) + .online_time;
                    showscript "[Premium Mileage] - Gained " + .point_amt_vip + " " + .point_name$ + ". Total " + #TIMEPOINTS + " points.";
                    dispbottom "[Premium Mileage] - Gained " + .point_amt_vip + " " + .point_name$ + ". Total " + #TIMEPOINTS + " points.",0xFFFFFF;
 
        }
        if (countitem(408) >= 1) goto TIME;
 
                    #TIMEPOINTS += .point_amt;
                    #acctick = gettimetick(2) + .online_time;
                    showscript "[Normal Mileage] - Gained " + .point_amt + " " + .point_name$ + ". Total " + #TIMEPOINTS + " points.";
                    dispbottom "[Normal Mileage] - Gained " + .point_amt + " " + .point_name$ + ". Total " + #TIMEPOINTS + " points.",0xFFFFFF;
 
                } else {
TIME:
                    .@time_left = .online_time - .@time_left;
                    .@Time$ = "";
                    .@Minutes = .@time_left / 60;
                    .@time_left -= (.@Minutes * 60);
 
                    if (.@Minutes > 1)
                        .@Time$ += .@Minutes + " minutes, ";
                    else if (.@Minutes > 0)
                        .@Time$ += .@Minutes + " minute, ";
 
                    if (.@time_left > 1 || .@time_left == 0)
                        .@Time$ += .@time_left + " seconds";
                    else if (.@time_left == 1)
                        .@Time$ += .@time_left + " second";
 
                    if (.@Minutes == 15 && .@time_left == 0 || .@Minutes == 30 && .@time_left == 0 || .@Minutes == 45 && .@time_left == 0)
                        dispbottom "You spend a total of [" + .@Time$ + "] playing.",0xFFFFFF;
                }
            }
 
            if (#idle)
                break;
        }
    }
    end;
 
OnPCLogoutEvent:
    // BackUP online time
    if (BaseLevel >= .level)
    {
        if (@backup_time)
            #acctick = @backup_time;
    }
    end;
 
OnAtCommand:
    if (BaseLevel >= .level)
    {
        if (#idle)
        {
            .@Time$ = "";
            .@Minutes = @idle_time / 60;
            .@time_left = @idle_time - (.@Minutes * 60);
 
            if (.@Minutes > 1)
                .@Time$ += .@Minutes + " minutes, ";
            else if (.@Minutes > 0)
                .@Time$ += .@Minutes + " minute, ";
 
            if (.@time_left > 1 || .@time_left == 0)
                .@Time$ += .@time_left + " seconds";
            else if (.@time_left == 1)
                .@Time$ += .@time_left + " second";
 
            //dispbottom "You been idle for " + .@Time$ + ". Please relog again.",0xFFFF00;
            dispbottom "Mileage point system has been stopped.",0xEE4B2B;
        sleep2 1000;
            dispbottom "It's either you reached the maximum " +.maxpoints+ " points.",0x00ff00;
        sleep2 1000;
            dispbottom "Vending mode",0x00ff00;
        sleep2 1000;
            dispbottom "Or your are still a novice and need to change class.",0x00ff00;
        sleep2 1000;
            dispbottom "One more thing is you need to be level 50+ to start the Mileage System",0x00ff00;
        sleep2 1000;
        dispbottom "You have a total " + #TIMEPOINTS + " Mileage points.",0xFFFF00;
        sleep2 500;
        dispbottom "Please re-login if you spent points, changed to 1st class, or reached level 50+ to start the system again.",0xFFFFFF;
        goto MILEAGE;
        }
        else
        {
            .@time_left = @backup_time;
            .@Time$ = "";
            .@Minutes = .@time_left / 60;
            .@time_left -= (.@Minutes * 60);
 
            if (.@Minutes > 1)
                .@Time$ += .@Minutes + " minutes, ";
            else if (.@Minutes > 0)
                .@Time$ += .@Minutes + " minute, ";
 
            if (.@time_left > 1 || .@time_left == 0)
                .@Time$ += .@time_left + " seconds";
            else if (.@time_left == 1)
                .@Time$ += .@time_left + " second";
 
            //dispbottom "You have [" + .@Time$ + "] left in able to gain a Mileage points.",0xFFFF00;
            //dispbottom "Total " + #TIMEPOINTS + " Mileage points.",0xFFFF00;
MILEAGE:
        mes "[Mileage System]";
        mes "Greetings Adventurer";
        mes "What do you want to do?";
        switch (select("- How's Mileage system work?","- Check time and points","- Exchange Points to Mileage Coupon")) {
            case 1:
                next;
                mes "[Mileage System]";
                mes "You can activate the system if you mee the following requirements:";
                mes "^ff0000Base Level 50+^000000";
                mes "^ff0000Must be 1-1, 2-1, 2-2 Class^000000";
                next;
                mes "[Mileage System]";
                mes "^0000ffOne mileage point^000000 is automatically accumulated every hour for the character who activated the system.";
                next;
                mes "[Mileage System]";
                mes "^0000ffTwo mileage point^000000 will be accumulated every if the user is a premium member.";
                next;
                mes "[Mileage System]";
                mes "Mileage can be accumulated only upto 300 points.";
                next;
                mes "[Mileage System]";
                mes "Through mileage system you can exchange your points into Mileage Coupons to buy headgears and other stuff at the Mileage Shop!";
                next;
                mes "[Mileage System]";
                mes "Exchange ratio is 5:1";
                mes "5 Points = 1 Mileage Coupon";
                next;
                mes "[Mileage System]";
                mes "Mileage system ^ff0000will stop^000000 if you";
                mes "are in ^ff0000Vending Mode^000000 or ";
                mes "^ff0000Reached 300 mileage points^000000";
                close;
                
            case 2:
                next;
                mes "[Mileage System]";
                mes "You have ^0000ff[" + .@Time$ + "]^000000 left in able to gain a Mileage points.";
                mes "Total ^ff0000" + #TIMEPOINTS + "^000000. Mileage points";
                mes "^008000Normal^000000: 1 point per hour";
                mes "^FFC300Premium^000000: 2 points per hour";
                close;
                
            case 3:
                next;
                //mes "[Mileage System]";
                if(#TIMEPOINTS >= 0 ) {
                mes "[Mileage System]";
                mes "How many points";
                mes "Exchange ratio is ^0000ff5:1^000000";
                mes "do you want to exchange?";
                next;
                mes "[Mileage System]";
                mes "Select an option to exchange";
                mes "Total ^ff0000" + #TIMEPOINTS + "^000000. Mileage points";
                next;
                        switch (select("5 Points > 1 Mileage Coupon","50 Points > 10 Mileage Coupons","100 Points > 20 Mileage Coupons","200 Points > 40 Mileage Coupons","300 Points > 60 Mileage Coupons")) {
                        
                                
                                case 1:
                                        mes "[Mileage System]";
                                        mes "So you want to exchange";
                                        mes "5 Points into 1 Coupon";
                                        next;
                                            switch (select("Yes","No")) {
                                            case 1:
                                                    mes "[Mileage System]";
                                                        if(#TIMEPOINTS < 5) {
                                                        //mes "[Mileage System]";
                                                        mes "I'm sorry but you don't have enough points to exchange.";
                                                        mes "You currently have " + #TIMEPOINTS + " Points.";
                                                        close;
                                                        }
                                                    #TIMEPOINTS -= 5;
                                                    getitem 456,1;
                                                    mes "Okay you can use the Mileage Coupon at the Mileage Coupon Exchanger.";
                                                    dispbottom "-5 Mileage points.",0xFF0000;
                                                    dispbottom "Total " + #TIMEPOINTS + " Mileage points.",0xFFFF00;
 
                                                    close;
                                                    
                                            case 2:
                                                    close;
                                            }
                                case 2:
                                        mes "[Mileage System]";
                                        mes "So you want to exchange";
                                        mes "50 Points into 10 Coupons";
                                        next;
                                            switch (select("Yes","No")) {
                                            case 1:
                                                    mes "[Mileage System]";
                                                        if(#TIMEPOINTS < 50) {
                                                        //mes "[Mileage System]";
                                                        mes "I'm sorry but you don't have enough points to exchange.";
                                                        mes "You currently have " + #TIMEPOINTS + " Points.";
                                                        close;
                                                        }
                                                    #TIMEPOINTS -= 50;
                                                    getitem 456,10;
                                                    mes "Okay you can use the Mileage Coupon at the Mileage Coupon Exchanger.";
                                                    dispbottom "-50 Mileage points.",0xFF0000;
                                                    dispbottom "Total " + #TIMEPOINTS + " Mileage points.",0xFFFF00;
                                                    close;
                                                    
                                            case 2:
                                                    close;
                                            }
                                case 3:
                                        mes "[Mileage System]";
                                        mes "So you want to exchange";
                                        mes "100 Points into 20 Coupons";
                                        next;
                                            switch (select("Yes","No")) {
                                            case 1:
                                                    mes "[Mileage System]";
                                                        if(#TIMEPOINTS < 100) {
                                                        //mes "[Mileage System]";
                                                        mes "I'm sorry but you don't have enough points to exchange.";
                                                        mes "You currently have " + #TIMEPOINTS + " Points.";
                                                        close;
                                                        }
                                                    #TIMEPOINTS -= 100;
                                                    getitem 456,20;
                                                    mes "Okay you can use the Mileage Coupon at the Mileage Coupon Exchanger.";
                                                    dispbottom "-100 Mileage points.",0xFF0000;
                                                    dispbottom "Total " + #TIMEPOINTS + " Mileage points.",0xFFFF00;
                                                    close;
                                                    
                                            case 2:
                                                    close;
                                            }
                                case 4:
                                        mes "[Mileage System]";
                                        mes "So you want to exchange";
                                        mes "200 Points into 40 Coupons";
                                        next;
                                            switch (select("Yes","No")) {
                                            case 1:
                                                    mes "[Mileage System]";
                                                        if(#TIMEPOINTS < 200) {
                                                        //mes "[Mileage System]";
                                                        mes "I'm sorry but you don't have enough points to exchange.";
                                                        mes "You currently have " + #TIMEPOINTS + " Points.";
                                                        close;
                                                        }
                                                    #TIMEPOINTS -= 200;
                                                    getitem 456,40;
                                                    mes "Okay you can use the Mileage Coupon at the Mileage Coupon Exchanger.";
                                                    dispbottom "-200 Mileage points.",0xFF0000;
                                                    dispbottom "Total " + #TIMEPOINTS + " Mileage points.",0xFFFF00;
                                                    close;
                                                    
                                            case 2:
                                                    close;
                                            }
                                case 5:
                                        mes "[Mileage System]";
                                        mes "So you want to exchange";
                                        mes "300 Points into 60 Coupons";
                                        next;
                                            switch (select("Yes","No")) {
                                            case 1:
                                                    mes "[Mileage System]";
                                                        if(#TIMEPOINTS < 300) {
                                                        //mes "[Mileage System]";
                                                        mes "I'm sorry but you don't have enough points to exchange.";
                                                        mes "You currently have " + #TIMEPOINTS + " Points.";
                                                        close;
                                                        }
                                                    #TIMEPOINTS -= 300;
                                                    getitem 456,60;
                                                    mes "Okay you can use the Mileage Coupon at the Mileage Coupon Exchanger.";
                                                    dispbottom "-300 Mileage points.",0xFF0000;
                                                    dispbottom "Total " + #TIMEPOINTS + " Mileage points.",0xFFFF00;
                                                    close;
                                            case 2:
                                                    close;
                                            }
                        
                        
                        }
                }
        }
        }
    }
    end;
}
Viewed 558 times, submitted by Guest.