viewing paste kido mvp ladder/room script | Athena

Posted on the | Last edited on
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
prontera,156,181,5      script  MvP Challenge#Register  100,{
        mes "["+ strnpcinfo(1) +"]";
        if ( getvariableofnpc( .party_id, .main$ ) ) {
                .@remain = getvariableofnpc( .last_register, .main$ ) + getvariableofnpc( .register_delay, .main$ ) - gettimetick(2);
                .@min = .@remain / 60;
                .@sec = .@remain % 60;
                mes "Event will be start again";
                mes "after "+ .@min +" min "+ .@sec +" sec.";
                close;
        }
        mes "Hello "+ strcharinfo(0) +", the MVP challenge is currently available.";
        next;
        mes "["+ strnpcinfo(1) +"]";
        if ( getvariableofnpc( .party_id, .main$ ) ) { // need 1 more time because the stupid next; button
                mes "Hello "+ strcharinfo(0) +", the MVP challenge is currently unavailable";
                close;
        }
        .@pid = getcharid(1);
        if ( !.@pid ) {
                mes "You don't have a party.";
                close;
        }
        if ( getpartyleader( .@pid, 2 ) != getcharid(0) ) {
                mes "Only a party leader can register.";
                close;
        }
        getpartymember .@pid, 1;
        getpartymember .@pid, 2;
        .@origin = getcharid(3);
        for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
                if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
                        attachrid $@partymemberaid[.@i];
                        if ( strcharinfo(3) == strnpcinfo(4) )
                                .@online++;
                }
        }
        attachrid .@origin;
        if ( $@partymembercount < getvariableofnpc( .register_min, .main$ ) ) {
                mes "You must have at least "+ getvariableofnpc( .register_min, .main$ ) +" players in your party";
                close;
        }
        if ( .@online < getvariableofnpc( .register_min, .main$ ) ) {
                mes "You must have "+ getvariableofnpc( .register_min, .main$ ) +" players online in "+ strnpcinfo(4) +" map";
                close;
        }
        announce "Wishing luck for the party ["+ strcharinfo(1) +"] has started the MvP Challenge Event !", bc_all;
        cleanmap getvariableofnpc( .map$, .main$ );
        killmonsterall getvariableofnpc( .map$, .main$ );
        warpparty getvariableofnpc( .map$, .main$ ), 0,0, .@pid, strnpcinfo(4);
        hideoffnpc .main$;
        set getvariableofnpc( .last_register, .main$ ), gettimetick(2);
        set getvariableofnpc( .party_id, .main$ ), .@pid;
        set getvariableofnpc( .round, .main$ ), 0;
        sleep getvariableofnpc( .register_delay, .main$ ) * 1000;
        set getvariableofnpc( .party_id, .main$ ), 0;
        mapwarp getvariableofnpc( .map$, .main$ ), "prontera",156,181;
        end;
OnInit:
        .main$ = "MvP Challenger#main"; // send all variables into 1 npc, that's my style
        end;
}
 
guild_vs2,49,50,4       script  MvP Challenger#main     100,{
        mes "["+ strnpcinfo(1) +"]";
        if ( getpartyleader( getcharid(1), 2 ) != getcharid(0) ) {
                mes "You are not the leader of your party.";
                close;
        }
        mes "Activate next round ?";
        mes "Remaining rounds : "+( .totalround - .round );
        next;
        if ( select( "Yes", "No" ) == 2 ) close;
        mes "["+ strnpcinfo(1) +"]";
        mes "Ok ! Round ["+( .round +1 )+"] will begin shortly";
        close2;
        .round++;
        for ( .@i = 0; .@i < .mobamount[ .round ]; .@i++ )
                monster .map$, 49,49, "--ja--", .mobid[ rand( .mobsize ) ], 1, strnpcinfo(0)+"::OnMvPChallengeKill";
        mapannounce .map$, "Round ["+ .round +"]. En Garde !!!", bc_map;
        hideonnpc strnpcinfo(0);
        end;
 
OnMvPChallengeKill:
        if ( mobcount( .map$, strnpcinfo(0)+"::OnMvPChallengeKill" ) ) {
                announce mobcount( .map$, strnpcinfo(0)+"::OnMvPChallengeKill" )+ " monster(s) left to defeat." ,bc_map;
                end;
        }
        .@pid = getcharid(1);
        if ( .@pid != .party_id ) end;
        getpartymember .@pid, 1;
        getpartymember .@pid, 2;
        for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
                if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
                        attachrid $@partymemberaid[.@i];
                        if ( strcharinfo(3) == strnpcinfo(4) )
                                getitem .itemid[ .round ], .amount[ .round ];
                }
        }
        hideoffnpc strnpcinfo(0);
        if ( .round < .totalround ) end;
        announce "Congratulations to ["+ strcharinfo(1) +"] for completing MvP Challenge Event", bc_all;
        mapwarp .map$, "prontera",156,181;
        .round = 0;
        end;
 
OnPCDieEvent:
OnPCLogoutEvent:
        if ( strcharinfo(3) != .map$ || !getcharid(1) ) end;
        if ( getcharid(1) != .party_id ) end;
        warp "Save", 0,0;
        if ( getmapusers( .map$ ) ) end;
        .round = 0;
        killmonsterall .map$;
        end;
       
OnInit:
        .register_delay = 3600; // how long can the party able to make use of the time for the map, this also deny entrance for other party to get in  
        .register_min = 2; // minimum amount of party members must have to join in this event
 
        setarray .mobid[0],1852,1514,1853,1576,1847,1894,1399,1802,1874,1885,1980,1038,1039,1046,1059,1086,1087,1112,1115,1147,1150,1157,1159,1190,1251,1252,1272,1312,1373,1389,1418,1492,1511,1583,1623,1630,1658,1685,1688,1719,1708,1734,1751,1768,1779,1785,1832,1871; // mob id
        .totalround = 5; // maximum rounds
        setarray .mobamount[1],3,5,7,9,10;
        setarray .itemid[1],673,675,7829,7828,12103;
        setarray .amount[1],250,100,3,3,1;
 
        .mobsize = getarraysize( .mobid );
        .map$ = strnpcinfo(4);
        mapwarp .map$, "prontera",156,181;
        end;
}
 
guild_vs2       mapflag partylock
guild_vs2       mapflag nomemo
guild_vs2       mapflag nowarp
guild_vs2       mapflag nowarpto
guild_vs2       mapflag noteleport
guild_vs2       mapflag nosave  SavePoint
guild_vs2       mapflag noreturn
Viewed 693 times, submitted by AnnieRuru.