viewing paste I love to use sleep timer | Athena

Posted on the | Last edited on
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
prontera,155,185,5      script  start   1_F_MARIA,{
        if ( .start ) {
                mes "capture all the flags to win faster !";
                close;
        }
        select "Start";
        donpcevent strnpcinfo(0)+"::OnStart";
        close;
OnStart:
        disablenpc "start";
        enablenpc "Flag_1#1";
        enablenpc "Flag_2#2";
        enablenpc "Flag_3#3";
        enablenpc "Flag_4#4";
        enablenpc "Flag_5#5";
// YES I MEAN THIS PART ! SO NEAT !!!!
        sleep 1000000000; // use awake to get into while loop
        while ( true ) {
                if ( .sleepcounter )
                        .score += .point[ .capturedamount ];
                if ( .score >= 100 ) break;
                bg_updatescore "prontera", 0, .score;
                .sleepcounter++;
                sleep .tick[ .capturedamount ]; // DYNAMIC TIMER ~ oh yes
        }
//      until here
        bg_updatescore "prontera", 0, 100;
        announce "You win !", bc_all;
        sleep 3000;
        .start = .capturedid = .capturedamount = .score = .sleepcounter = 0;
        for ( .@i = 1; .@i <= 5; .@i++ ) {
                disablenpc "Flag_"+ .@i +"#"+ .@i;
                setnpcdisplay "Flag_"+ .@i +"#"+ .@i, GUILD_FLAG;
        }
        enablenpc "start";
        bg_updatescore "prontera", 0, 0;
        end;
OnInit:
//      copy paste this part from that script ...
//      I even make this CONFIGURABLE !!
        .tick[1] = 12000; // when capture 1 flag ...
        .point[1] = 1; // 12 seconds to gain 1 point
 
        .tick[2] = 9000; // when capture 2 flags ...
        .point[2] = 1; // 9 seconds to gain 1 point
 
        .tick[3] = 6000; // when capture 3 flags ...
        .point[3] = 1; // 6 seconds to gain 1 point
 
        .tick[4] = 3000; // when capture 4 flags ...
        .point[4] = 1; // 3 seconds to gain 1 point
 
        .tick[5] = 1000; // when capture ALL flags ...
        .point[5] = 3; // gain 3 points every second !
 
        for ( .@i = 1; .@i <= 5; .@i++ )
                disablenpc "Flag_"+ .@i +"#"+ .@i;
        end;
}
-       script  Flag    FAKE_NPC,{
        .@flagid = atoi( strnpcinfo(2) );
        if ( getvariableofnpc( .capturedid, "start" ) & (1 << .@flagid) ) {
                dispbottom "You already captured this flag";
                end;
        }
        progressbar "", 3;
        set getvariableofnpc( .capturedid, "start" ), getvariableofnpc( .capturedid, "start" ) | 1 << .@flagid;
        set getvariableofnpc( .capturedamount, "start" ), getvariableofnpc( .capturedamount, "start" ) + 1;
        set getvariableofnpc( .sleepcounter, "start" ), 0;
        setnpcdisplay strnpcinfo(0), 1_FLAG_EAGLE;
        awake "start";
        end;
}
prontera,151,180,4      duplicate(Flag) Flag_1#1        GUILD_FLAG
prontera,153,180,4      duplicate(Flag) Flag_2#2        GUILD_FLAG
prontera,155,180,4      duplicate(Flag) Flag_3#3        GUILD_FLAG
prontera,157,180,4      duplicate(Flag) Flag_4#4        GUILD_FLAG
prontera,159,180,4      duplicate(Flag) Flag_5#5        GUILD_FLAG
 
prontera        mapflag battleground    2
Viewed 778 times, submitted by AnnieRuru.