viewing paste Royal Rumble v2 | 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 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 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324
//===== eAthena Script ======================================= 
//= Royal Rumble Event
//===== By: ==================================================
//= Masao
//===== Current Version: =====================================
//= 2.0
//===== Compatible With: =====================================
//= Any Athena Version
//===== Description: =========================================
//= Starts an little PvP Event when a total of 10 Players
//= have Signed Up. After that every 30 seconds
//= a new Player will be warped onto the PvP Map until
//= all 10 Players have been warped.
//===== Additional Comments: =================================
//= Version 1.0 [Masao]
//= Verison 1.1 added GM Control Panel & Autostart [Masao]
//= Version 2.0 complete re-script [Masao]
//============================================================
prontera,155,185,4  script  Royal Rumble    946,{
 
    set .@n$,"[Royal Rumble]";
 
    if (getgmlevel() >= 40) goto L_GMCP;
 
    mes .@n$;
    mes "Hello "+strcharinfo(0)+",";
    mes "I'm the Royal Rumble NPC, you can Sign Up here for the Royal Rumble Event!";
    mes "";
    mes "So, would you like to Sign Up?";
    next;
    menu "Yes, please!",-,"Royal Rumble?!",L_R,"No, thanks.",L_E;
    
    if(.rrp == 10)
    {
        mes .@n$;
        mes "I'm sorry but the Event already begun!";
        close;
    }
 
    set .rrp,.rrp+1;
    set .rra[.rrp],getcharid(3);
    set @rre,1;
    set @rre2,1;
    if(.rrp < 10)
    {
        mes .@n$;
        mes "Allright, you have been signed up. As soon as the Event beginns you'll see an Broadcast.";
        close;
    }
    mes .@n$;
    mes "Allright, you have been signed up. The Event beginns now!";
    close2;
    initnpctimer;
    disablenpc "Royal Rumble";
    announce "The Royal Rumble Event beginns now! The first 2 players will now be warped into the Royal Rumble Arena!",bc_all;
    end;
 
L_R:
    mes .@n$;
    mes "The Rules are very easy!";
    mes "Just Sign Up to the Game and then wait until a total of 10 Players have Signed Up, as soon as this happens the Game will start.";
    mes "When the Event starts 2 Players will be warped onto an PvP Map, then they fight each other, the loser get warped out and the Winner stays.";
    mes "And after the first 2 Players have been warped in, every 30 Seconds a new Player will be warped onto the Map.";
    mes "As soon as the last player is killed on the Map the Game will end and the last survivor is the Winner!";
    mes "And that's all, have Fun and good Luck!";
    close;
 
L_E:
    mes .@n$;
    mes "Ok, bye.";
    close;
 
L_GMCP:
    mes .@n$;
    mes "Hello "+strcharinfo(0)+",";
    mes "what can i do for you?";
    switch(select("Start Event!:End Event.:Set Prize:Cancel")) {
        case 1:
            next;
            mes .@n$;
            mes "Allright, the Event starts now!";
            close2;
            enablenpc "Royal Rumble";
            for(set .@i,0;.@i<=.rrp;set .@i,.@i+1)
            {
                if(attachrid(.rra[.@i])){
                    if (@rre == 1) {
                        set @rre,0;
                        set @rre2,0;
                        detachrid;
                    }
                }
            }
            set .rrp,0;
            deletearray .rra[0],128;
            mapwarp "guild_vs3","prontera",155,185;
            announce "The Royal Rumble Event is Open now!",bc_all;
            end;
        case 2:
            next;
            mes .@n$;
            mes "Allright, the Event ends now!";
            close2;
            disablenpc "Royal Rumble";
            for(set .@i,0;.@i<=.rrp;set .@i,.@i+1)
            {
                if(attachrid(.rra[.@i])){
                    if (@rre == 1) {
                        set @rre,0;
                        set @rre2,0;
                        detachrid;
                    }
                }
            }
            set .rrp,0;
            deletearray .rra[0],128;
            mapwarp "guild_vs3","prontera",155,185;
            announce "The Royal Rumble Event has been ended by an GM!",bc_all;
            end;
        case 3:
            next;
            mes .@n$;
            mes "The current Prize is "+getitemname($rr_id)+", would you like to change it?";
            switch(select("No:Yes")) {
                case 1:
                    next;
                    mes .@n$;
                    mes "Ok, bye.";
                    close;
                case 2:
                    next;
                    mes .@n$;
                    mes "Ok, then please insert now the new Item ID";
                    input $rr_id;
                    next;
                    mes .@n$;
                    mes "And now the Amount please.";
                    input $rr_amount;
                    next;
                    mes .@n$;
                    mes "Allright, so the Prize now is ^008000"+$rr_amount+" "+getitemname($rr_id)+"^000000";
                    close;
            }
        case 4:
            next;
            mes .@n$;
            mes "Ok, bye";
            close;
    }
 
OnPCDieEvent:
    getmapxy .@m$,.@x,.@y,0;
    if(.@m$ == "guild_vs3")
    {
        for(set .@i,0;.@i<=.rrp;set .@i,.@i+1)
        {
            if(attachrid(.rra[.@i])){
                if (@rre == 1) {
                    set @rre,0;
                    warp "prontera",155,185;
                }
                detachrid;
            }
        }
        set .rrp,.rrp-1;
    }
    end;
 
OnPCLogoutEvent:
    getmapxy .@m$,.@x,.@y,0;
    if(.@m$ == "guild_vs3")
    {
        for(set .@i,0;.@i<=.rrp;set .@i,.@i+1)
        {
            if(attachrid(.rra[.@i])){
                if (@rre == 1) {
                    set @rre,0;
                    save "prontera",155,185;
                }
                detachrid;
            }
        }
        set .rrp,.rrp-1;
    }
    end;
 
OnPCKillEvent:
    getmapxy .@m$,.@x,.@y,0;
    if(.@m$ == "guild_vs3")
    {
        if(.rrp <= 1)
        {
            for(set .@i,0;.@i<=.rrp;set .@i,.@i+1)
            {
                if(attachrid(.rra[.@i])){
                    if (@rre == 1) 
                    {
                        dispbottom "Congratulations "+strcharinfo(0)+"!";
                        dispbottom "You won the Royal Rumble Event!";
                        dispbottom "Here is your Prize, and see you next time!";
                        getitem $rr_id,$rr_amount;
                        set @rre,0;
                        warp "prontera",155,185;
                    }
                    detachrid;
                    announce strcharinfo(0)+" won this Game of Royal Rumble! Congratulations!",bc_all;
                }
            }
            deletearray .rra[0],128;
        }
    }
    end;
 
OnTimer1000:
    for(set .@i,0;.@i<=.rrp;set .@i,.@i+1)
    {
        if(attachrid(.rra[.@i])){
            if (@rre2 == 1) {
                set @rre2,0;
                warpchar "guild_vs3",0,0,.rra[.@i];
            }
            end;
        }
    }
    end;
OnTimer1100:
    for(set .@i,0;.@i<=.rrp;set .@i,.@i+1)
    {
        if(attachrid(.rra[.@i])){
            if (@rre2 == 1) {
                set @ree2,0;
                warpchar "guild_vs3",0,0,.rra[.@i];
            }
            end;
        }
    }
    end;
OnTimer30000:
OnTimer60000:
OnTimer90000:
OnTimer120000:
OnTimer150000:
OnTimer180000:
OnTimer210000:
OnTimer240000:
OnTimer270000:
OnTimer300000:
    for(set .@i,0;.@i<=.rrp;set .@i,.@i+1)
    {
        if(attachrid(.rra[.@i])){
            if (@rre2 == 1) {
                set @rre2,0;
                warpchar "guild_vs3",0,0,.rra[.@i];
            }
            end;
        }
    }
    end;
 
OnClock0400:
OnClock0800:
OnClock1200:
OnClock1600:
OnClock2000:
OnClock0000:
    enablenpc "Royal Rumble";
    for(set .@i,0;.@i<=.rrp;set .@i,.@i+1)
    {
        if(attachrid(.rra[.@i])){
            if (@rre == 1) {
                set @rre,0;
                set @rre2,0;
            }
            detachrid;
        }
    }
    set .rrp,0;
    deletearray .rra[0],128;
    mapwarp "guild_vs3","prontera",155,185;
    announce "The Royal Rumble Event starts now! You have 3 Minutes to Sign Up!",bc_all;
    end;
    
OnClock0403:
OnClock0803:
OnClock1203:
OnClock1603:
OnClock2003:
OnClock0003:
    if(.rrp < 10)
    {
        disablenpc "Royal Rumble";
        announce "The Royal Rumble Event is closed now! Since there were not 10 Players the Event will not take place.",bc_all;
        for(set .@i,0;.@i<=.rrp;set .@i,.@i+1)
        {
            if(attachrid(.rra[.@i])){
                if (@rre == 1) {
                    set @rre,0;
                    set @rre2,0;
                }
                detachrid;
            }
        }
        set .rrp,0;
        deletearray .rra[0],128;
    }
    end;
 
OnInit:
    disablenpc "Royal Rumble";
    end;
}
 
//============== Mapflags ====================
guild_vs3   mapflag nogo
guild_vs3   mapflag pvp_noguild
guild_vs3   mapflag pvp_noparty
guild_vs3   mapflag nobranch
guild_vs3   mapflag nomemo
guild_vs3   mapflag nopenalty
guild_vs3   mapflag noreturn
guild_vs3   mapflag noteleport
guild_vs3   mapflag nowarp
guild_vs3   mapflag nowarpto
guild_vs3   mapflag noicewall
Viewed 870 times, submitted by Guest.