viewing paste Unknown #21258 | 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
prontera,98,254,5   script  Event   792,{
    mes "[" + strnpcinfo( 1 ) + "]";
    mes "Do you want to take part in this event?";
    next;
    switch( select( "Enter.:Cancel." ) ) {
        case 1:
            percentheal 100, 100;
            warp "quiz_01", 237, 270;
            mapannounce "quiz_01", "Player " + strcharinfo( 0 ) + " entered the event.", bc_map;
        break;
        case 2:         
            mes "[" + strnpcinfo( 1 ) + "]";
            mes "Come again if you change your mind.";
            close;
        break;
    }
}
 
quiz_01,182,183,5   script  Event3  -1,{
    waitingroom "Waiting", 0;
    
    OnStartEvent:
    OnMinute50:
        if ( .status ) {
            dispbottom "Error: Event is allready running.";
            end;
        }
 
        announce "The Event has started, you have 1 minute to join!", bc_all;
        set .status, 1;
        enablenpc "Event";
 
        sleep( 30000 );
        announce "You have 30 seconds left!", bc_all;
        
        sleep( 15000 );
        announce "You have 15 seconds left!", bc_all;
     
        sleep( 10000 );
        disablenpc "Event";
 
        if( getmapusers( "quiz_01" ) <= 1 ) {
            announce "Not enough people participated and the event ends without a result.", bc_all;
            set .status, 0;
            mapwarp "quiz_01", "prontera", 96, 244;
            end;
        }
 
        announce "The Event has started!", bc_all;
 
        set .currentWave, 0;
        OnNextWave:
            set .mobCount, 2;
            set .currentWave, .currentWave + 1;
            
            for( set .@i, 0; .@i < .mvpCount; set .@i, .@i + 1 ) {
                .@monsterId = .@mvps[ rand( .mvpCount ) ];
                monster "quiz_01", 0, 0, getmonsterinfo(  .@monsterId, 0 ), .@monsterId, 1, strnpcinfo( 3 ) + "::OnMobDead";
            }
    end;
    
    OnMobDead:
        if ( !.status ) end;
 
        set .mobCount, .mobCount - 1;
        set .@playersLeft, getmapusers( "quiz_01" );
 
        if( .mobCount == 1 )
            mapannounce "quiz_01","One MVP and " + .@playersLeft  + " players left on wave #" + .currentWave + ".", bc_map;
 
        if( .mobCount == 0 ) {
            announce "All MVPs have been killed on wave #" + .currentWave + " a new one will spawn!", bc_all;
            goto OnNextWave;
        }
    end;
 
    OnStopEvent:
        set .@stopEvent, 1;
    OnPCLogoutEvent:
    OnPCDieEvent:
        set .@playersLeft, getmapusers( "quiz_01" );
        if( .@playersLeft == 1 || .@stopEvent ) {
            killmonsterall "quiz_01";
            set .status, 0;
 
            if( !.@stopEvent ) {
                set .@accountIdCount, query_sql( "SELECT`account_id` FROM `char`", .@accountIds );
                
                for( set .@i, 0; .@i < .@accountIdCount; set .@i, .@i + 1 ) {
                    if( attachrid( .@accountIds[ .@i ] ) ) {
                        if( strcharinfo( PC_MAP ) == "quiz_01" )
                            break;
                    }
 
                    sleep( 100 );
                }
 
                percentheal 100, 100;
                announce "Player " + strcharinfo( PC_NAME )  + " won the event! Congratulations!", bc_all;
                getitem .priceId, .priceAmount;
                sleep2( 5000 );
                warp "prontera", 96, 244;
            }
 
            announce "A GM endet the event.", bc_all;
            sleep( 5000 );
            mapwarp "quiz_01", "prontera", 96, 244;
        }
    end;
    
    OnInit:
        bindatcmd( "startevent", strnpcinfo(3) + "::OnStartEvent" );
        bindatcmd( "stopevent", strnpcinfo(3) + "::OnStopEvent" );  
 
        setarray .mvps, 1751, 1708, 1832, 1650, 1647, 1649, 1651, 1646, 1648;
        set .mvpCount, getarraysize( .mvps );
        set .priceId, 7720 ;
        set .priceAmount, 1;
        disablenpc "Event";
    end;
}
 
quiz_01 mapflag nowarp
quiz_01 mapflag nowarpto
quiz_01 mapflag noteleport
quiz_01 mapflag nosave  SavePoint
quiz_01 mapflag nomemo
quiz_01 mapflag nobranch
quiz_01 mapflag nopenalty
quiz_01 mapflag pvp off
quiz_01 mapflag gvg off
Viewed 877 times, submitted by Guest.