viewing paste Unknown #53382 | Athena

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
-   script  NoviceVsZombie  -1,{
OnInit:
    RegisterSchedule("*",02,12,"RFYL Novice");
    
    // item reward
    setarray .item,
        501, 10,
        502, 5;
 
    // zombiestart - gm manual start
    bindatcmd "zombiestart", strnpcinfo(0)+"::OnStart",60,60;
    
    // @zombie - player join event
    bindatcmd "zombie", strnpcinfo(0)+"::OnJoinEvent";
    
    // Event cooldown
    .event_cd = 60 * 60 * 1; // 1hr
    
    // Mapflags
    setarray .@mapflag,
        mf_nowarp,
        mf_nowarpto,
        mf_noskill,
        mf_noteleport,
        mf_nomemo,
        mf_nosave,
        mf_noicewall,
        mf_nobranch,
        mf_noreturn,
        mf_nocommand;
        
    for ( .@i = 0; .@i < getarraysize(.@mapflag); .@i++)
        setmapflag "quiz_01", .@mapflag[.@i];
        
    .@min = gettime(DT_MINUTE)*60;
    .@sec = gettime(DT_SECOND);
    .event_time = (gettimetick(2) - ( .@min + .@sec )) + .event_cd - 5;
    end;
    
OnJoinEvent:
    mes " [ Event Status ] ";
    if ( !.start ) mes "Next schedule starts in ^FF0000"+ Time2Str(.event_time) +"^000000.";
    if ( .start == 1 ) mes "Event is currently active.";
    if ( .start == 2 ) mes "Event is currently on-going.";
    next;
    switch(select(
        "Novice v Zombie Event - "+ ((.start == 1) ? "^00ff00Join Event":((.start == 2) ? "^00ff00Event On-Going":"^ff0000Not Available"))+"^000000" )) {
    case 1:
        if ( !.start ) {
            mes "Event is not available.";
            close;
        } else if ( .start == 2 ) {
            mes "Event is on-going";
            close;
        }
        if ( BaseLevel > 10 || Class != 0 ) {
            mes "Only Lv 10 Novice can enter.";
            close;
            }
        if ( CharStatus > 10 || Class != 0 ) {
            mes "Only Stats 10 Below can enter.";
            close;
        }
        else {
            getinventorylist;
            if ( @inventorylist_amount ) {
                mes "You store all your items first.";
                close2;
                @inventorylist_amount = false;
                end;
            }
            sc_end SC_ALL;
            sc_start SC_DECREASEAGI,600000,10;
            percentheal 100,100;
            warp "quiz_01",42,369;
        }
    }
    end;
 
OnStart: .@force = true;
    .@time = gettimetick(2);
    .@min = gettime(DT_MINUTE)*60;
    .@sec = gettime(DT_SECOND);
    if ( .event_time > .@time && !.@force || .start && !.@force ) end; // doesnt start if cd isn't done.
    .event_time = (.@time - ( .@min + .@sec )) + .event_cd - 5;  
    .start = 1;
    killmonsterall "quiz_01";
    announce "Event Manager: We are going to have a Novice Vs. Zombie event.",0;
    sleep 10000;
    announce "Event Manager: For those who wants to join, use @niko",0;
    sleep 10000;
    announce "Event Manager: Novice Vs. Zombie Event will be closing after 1 minute", 0;
        sleep 20000;
    announce "Event Manager: Last 30 second", 0;
    sleep 10000;
        announce "Event Manager: For those who wants to join, use @niko", 0;
        sleep 10000;
        announce "Event Manager: Last 10 second to join", 0;
        sleep 5000;
        announce "Event Manager: 5", 0;
        sleep 1000;
        announce "Event Manager: 4", 0;
        sleep 1000;
        announce "Event Manager: 3", 0;
        sleep 1000;
        announce "Event Manager: 2", 0;
        sleep 1000;
        announce "Event Manager: 1", 0;
    sleep 1000;
    announce "Event Manager: The entry to the event is now closed.", 0;
    if ( getmapusers("quiz_01") <= 1 ) {
        announce "Event Manager: Not enough participants.",0;
        .start = false;
        mapwarp "quiz_01", "prontera", 150, 180; // warp out.
        end;
    }
    .start = 2;
    sleep 3500;
    mapannounce "quiz_01","We're about to begin the event.",bc_map,0x0ceedb;
    sleep 2500;
    mapannounce "quiz_01","The rules are simple.",bc_map,0x0ceedb;
    sleep 2500;
    mapannounce "quiz_01","Zombies will be spawned in the map.",bc_map,0x0ceedb;
    sleep 2500;
    mapannounce "quiz_01","and will apear every 20 seconds.",bc_map,0x0ceedb;
    sleep 2000;
    mapannounce "quiz_01","Last man surviving wins.",bc_map,0x0ceedb;
    sleep 2000;
    mapannounce "quiz_01","That's all. Let's begin.",bc_map,0x0ceedb;
    sleep 3000;
    monster "quiz_01",42,369,"Zombie",1036,4;
    initnpctimer;
    end;
    
OnTimer20000: // 20 seconds timer and also player check on how many left in map
    monster "quiz_01",42,369,"Zombie",1036,10;
    setnpctimer 0;
    end;
    
OnPCDieEvent:
    if ( .start && strcharinfo(3) == "quiz_01" ) {
        warp "prontera",rand(148,163),rand(167,186);
        if ( getmapusers("quiz_01") == 1 ) {
            stopnpctimer;
            killmonsterall "quiz_01";
            .@size = getmapunits(BL_PC,"quiz_01",.@aid);
            .@amt = getarraysize(.item);
            .start = false;
            attachrid .@aid;
            announce strcharinfo(0)+" has won the Novice v Zombie Event.",bc_all,0x0ceedb;
            for ( .@j = 0; .@j < .@amt; .@j += 2 )
                getitem .item[.@j], .item[.@j+1];               
            warp "prontera",rand(148,163),rand(167,186);
            end;
        }
    }
    end;
}
Viewed 647 times, submitted by Guest.