viewing paste Unknown #577 | 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
prontera,0,0,0  script  LMS 123,{
mes .n$;
mes "Hello there "+strcharinfo(0)+", what do you want to do?";
mes "How may I help you?";
 
next;
 
if(getgmlevel() >= .gml){
    menu "GM Menu",GM_Menu,"Player Menu",-;
    }
    
    switch(select("- Join LMS:- Redeem Reward:- Exit")){
        
        case 1:
            if(!.LMS_Reg){
                mes "I'm Sorry"+strcharinfo(0)+"but the registration isn't opened yet";
                close;
            }
                if(.limit && getmapusers(.map$) >= .limit) {
                mes "I'm sorry but the event room for LMS is already full";
                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;
    
                set .p_ct,.p_ct + 1;
                set @lms,1;
                setarray .lms_ppl$[getarraysize(.lms_ppl$)],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:
            close;
        }
        
GM_Menu:
    mes .n$;
    mes "The event is currently "+( (.LMS_Eve)?"^00FF00Online":"^FF0000Offline")+"^000000.";
    mes "What do you want to do?";
    
    if(select("- Start/Stop Event:- Nevermind") - 1) close;
    next;
    mes .n$;
    mes "Do you really want to "+( (.LMS_Eve)?"^00FF00start":"^FF0000stop")+"^000000 the event?";
 
    if(select("- Yes:- No") - 1)  close;
    next;
 
    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;
    
OnTimer:
switch(getnpctimer(0)) {
 
    case 60000:
    announce .n$+": Registration will last for 1 minute, please hurry!!!",bc_all;
    end;
    
    case 120000:
    stopnpctimer;
    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/60000)+" 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
    startnpctimer;
    end;
    
    default:
    if(getnpctimer(0) < ((.dur/2)+120000) || getnpctimer(0) < (.dur+120000)) break;
    stopnpctimer;
    if(getnpctimer(0) == ((.dur/2)+120000) ) {
        mapannounce .map$,.n$+: "+(.dur/60000)/2+" Minutes has passed!!!",bc_map;
        if(getmapusers(.map$) == 0 && .LMS_Eve) 
            announce .n$+": It seems like that all users have left the event mapm therefore I won't be able to declare the winner!!!",bc_map;
        
    } else if(getnpctimer(0) == (.dur+120000) ) 
        mapannounce .map$,.n$+: +(.dur/60000)+" Minutes has passed, I will now end the event!!!",bc_all;
    
    break;
}
 
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!!";
        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 .n$,"["+strnpcinfo(1)+"]";
set .gm,60; // GM Access
set .init,0;
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,100; // Reward Amount
set .rew_id,512; // Item ID
 
// Player Limit:
// 0 == Unlimited
set .limit,30;
 
// Map on which LMS will be executed
set .map$,"force_3-1";
end;
}
Viewed 782 times, submitted by Guest.