viewing paste Unknown #585 | C

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
prontera,143,170,4  script  LMS 67,{
    mes set(.n$,"["+strnpcinfo(1)+"]");
    mes "Hello there " + strcharinfo(0) + ", what do you want to do?";
    mes " ";
    if (getgmlevel() >= .gml) mes "> The event is currently "+( (.LMS_Eve)?"^00FF00Online":"^FF0000Offline")+"^000000.";
    next;
 
    set .@Menu$, "- Join LMS:- Redeem Reward:" + (getgmlevel() >= .gml?"Start/Stop Event":"") + ":- Exit";
    switch (select(.@Menu$)) {
        case 1:
            if (!.LMS_Reg) {
                mes "I'm Sorry" + strcharinfo(0) + " but the registration isn't opened yet";
                close;
            }
            mes "Are you sure in joining Last Man Standing Event?";
            next;
            if (select("- Yes! I would like to participate!","- Wrong move, EXIT") - 1) {
                mes .n$;
                mes "See you again, when you are ready.";
                close;
            }
            mes .n$;
            mes "That's the spirit!!!";
            mes "I will warp you know to the map where the event will be hold.";
            close2;
 
            if (.limit && .p_ct >= .limit) {
                message strcharinfo(0), "Oh no, the event room for LMS reach the limit of participants!";
                end;
            }
 
            set .p_ct,.p_ct + 1;
            set @lms,1;
            setarray .lms_ppl$[.p_ct - 1],strcharinfo(0);
            warp .map$,0,0;
            if (.intra) sc_start SC_Intravision,.dur,1;
            end;
        case 2:
            mes .n$;
            if (!@lms) {
                mes "I'm sorry, but you are not qualified to recieve an reward.";
                close;
            }
            mes "Congratulation in surviving Last Man Standing, here is your reward.";
            close2;
            getitem .rew_id,.rew_am;
            end;
        case 3:
            mes .n$;
            mes "Do you really want to "+( (.LMS_Eve)?"^00FF00start":"^FF0000stop")+"^000000 the event?";
            next;
 
            if (select("- Yes:- No") == 1)  close;
 
            if (.LMS_Eve) donpcevent strnpcinfo(3)+"::OnDisable"; else donpcevent strnpcinfo(3)+"::OnStart";
            mes .n$;
            mes "The event has been "+( (.LMS_Eve)?"^00FF00started":"^FF0000stopped")+"^000000.";
            mes "See ya.";
    }
    close;
        
    OnStart:
        announce .n$+": The event, Last Man Standing, will be started shortly.",bc_all;
        sleep 10000;
        announce .n$+": The maximum players which can join "+ ( (.limit)?"are "+.limit:"is Unlimited")+".",bc_all;
        sleep 10000;
        announce .n$+": I will open the registration for 2 minutes.",bc_all;
        sleep 10000;
        announce .n$+": I just need to finish the preparations!",bc_all;
 
        if (getmapusers(.map$) > 0) {
            mapannounce .map$,.n$+": You all will be warped in 10 seconds back to prontera, since this map will be used for an event, Last Man Standing.",bc_map;
            sleep 10000;
            mapwarp .map$,"prontera.gat",150,180;
        }
 
        sleep 10000;
        set .LMS_Reg,1; // Registration enabled
        announce .n$+": Registration is now opened, please hurry!!!",bc_all;
        initnpctimer;
        end;
 
    OnTimer60000: // Every minute
        stopnpctimer;
        set .time_ch,.time_ch + 1;
        switch(.time_ch) {
            case 1:
                announce .n$+": Registration will last for 1 minute, please hurry!!!",bc_all;
                break;
            case 2:
                set .LMS_Reg,0;
                announce .n$+": Registration has been closed!!!",bc_all;
                sleep 10000;
                if (.p_ct < 2) {
                    announce .n$+": But it seems too less have registered, so I have to cancel it!!!",bc_all;
                    goto OnDisable;
                }
                announce .n$+": "+.p_ct+" players have registered!!!",bc_all;
                sleep 10000;
                announce .n$+": The event will last "+.dur+" minutes.",bc_all;
                setmapflag .map$,mf_nowarpto;
                setmapflag .map$,mf_nowarp;
                setmapflag .map$,mf_nosave;
                setmapflag .map$,mf_nomemo;
                setmapflag .map$,mf_nomemo;
                setmapflag .map$,mf_pvp;
                setmapflag .map$,mf_partylock;
                setmapflag .map$,mf_pvp_noparty;
                set .LMS_Eve,1; // Event started
                end;
            default:
                // +2 = Previous 2 minutes for registering time
                if (.time_ch < ((.dur/2)+2) || .time_ch < (.dur+2)) break;
                if (.time_ch == ((.dur/2)+2) ) {
                    mapannounce .map$, .n$ + ": " + .dur/2 + " Minutes has passed!!!",bc_all;
                if (getmapusers(.map$) == 0 && .LMS_Eve) {
                    announce .n$+": It seems like that all users have left the event map therefore I won't be able to declare the winner!!!",bc_all;
                } else if (.time_ch == (.dur+2) ) {
                    mapannounce .map$,.n$+": "+.dur+" Minutes has passed, I will now end the event!!!",bc_all;
                }
                break;
        }
 
        initnpctimer;
        end;
 
    OnDisable:
        if(!.LMS_Eve) end; // No need to continue if the event hasn't even started
 
        removemapflag .map$,mf_nowarpto;
        removemapflag .map$,mf_nowarp;
        removemapflag .map$,mf_nomemo;
        removemapflag .map$,mf_nomemo;
        removemapflag .map$,mf_pvp;
        removemapflag .map$,mf_partylock;
        removemapflag .map$,mf_pvp_noparty;
 
        deletearray .lms_ppl$[0],128;
        set .LMS_Eve,0;
        set .p_ct,0; // Reseting Player Counter
 
        announce .n$ + ": The event, Last Man Standing, has ended!!!",bc_all;
        mapannounce .map$,.n$+": You all will be warped in 10 seconds back to prontera.",bc_all;
        sleep 10000;
        mapwarp .map$,"prontera.gat",150,180;
        end;
            
    OnPCDieEvent:
        if (!.LMS_Eve) end;
        if (strcharinfo(3) != .map$) end;
        if (killerrid != getcharid(3)) dispbottom .n$+": You have been killed by "+rid2name(killerrid)+"!!";
        set @lms,0;
        warp "prontera",150,180;
        sleep2 2000; // Slowing down the script
 
        if (getmapusers(.map$) == 2) {
            mapannounce .map$,.n$+": Wuhu!! Only 2 players remain, let's see who is the better player!!", bc_all;
        } else if (getmapusers(.map$) == 1) {
            announce .n$+": The winner of the Last Man Standing event is "+ rid2name(killerrid)+".",bc_all;
            goto OnDisable;
        } else if (getmapusers(.map$) == 0) {
            goto OnDisable;
        }
        set .p_ct,.p_ct - 1;
        for ( set .@b,0; .@b < getarraysize(.lms_ppl$); set .@b,.@b + 1) {
            if (strcharinfo(0) == .lms_ppl$[.@b]) deletearray .lms_ppl$[.@b],1;
        }
        end;
 
    OnPCLogoutEvent:
        if (!.LMS_Eve) end;
        if (strcharinfo(3) != .map$) end;
        for ( set .@b,0; .@b < getarraysize(.lms_ppl$); set .@b,.@b + 1) {
            if (strcharinfo(0) == .lms_ppl$[.@b]) deletearray .lms_ppl$[.@b],1;
        }
        set .p_ct,.p_ct - 1;
        end;
 
    OnInit:
        set .gm,60; // GM Access
        set .dur,1800000;
 
        // Intravision (Maya Purple Card Effect - Able to see hidden player)
        // This effect is to prevent players to cheat by using "Cloaking" and similiar skills
        // 0 = Off
        // 1 = On
        set .intra,1;
 
        set .rew_am,1; // Reward Amount
        set .rew_id,607; // Item ID
 
        // Player Limit:
        // 0 == Unlimited
        set .limit,30;
 
        // Map on which LMS will be executed
        set .map$,"guild_vs4";
        end;
}
Viewed 1032 times, submitted by Myzter.