viewing paste Unknown #21350 | 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
function        script  PKM_getSlave    { //Function to return random slave
        return callfunc("F_Rand",1725,1031,1595,1572);
}
 
prontera,150,150,4      script  Recruiter#PKM   810,{
.@n$ = "[Recruiter]";
        if( BaseLevel < 70 ) {
                mes .@n$;
                mes "I'm sorry, you need to be a bit higher in level to withstand the fight I'm offering.";
                close;
        }
        .@p = getcharid(PC_PARTY);
        if( !.@p ) {
                mes .@n$;
                mes "The fight ahead is a hard one, you won't survive without someone to help you out! Go find a party!";
                close;
        }
        if( getpartyleader(.@p,2) != getcharid(0) ) {
                mes .@n$;
                mes "Only party leader can sign you all up.";
                close;
        }
        if( !instance_check_party(.@p,2,70) ) {
                mes .@n$;
                mes "I'm sorry, you need a party of at least 2 members to join in the fight. Come back when you're ready.";
                close;
        }
        mes .@n$;
        mes "I see you have a strong party to support you. Would you like a battle to prove your worth?";
        next;
        switch(select("Yes!:Nope")) {
        case 1:
                mes .@n$;
                .@id = instance_create("Boss Fight",.@p);
                if( .@id < 0 ) {
                        debugmes "PKM: Instance creation failed for party " + getpartyname(.@p) + " (PID: " + .@p + ") with code " + .@id;
                        mes "I sense a disturbance in force. Try again later a bit.";
                        close;
                }
                if( instance_attachmap("poring_w01",.@id,1,"PBattle") == "" ) {
                        debugmes "PKM: Instance creation failed for party " + getpartyname(.@p) + " (PID: " + .@p + ") on attaching map";
                        mes "I sense a disturbance in force. Try again later a bit.";
                        close;
                }
                instance_set_timeout(3600,300,.@id); // 1 hour to complete, 5 minutes alive time
                mes "Prepare for a challenge!";
                close2;
                instance_attach .@id;
                instance_init .@id;
                getpartymember .@p,1;
                getpartymember .@p,2;
                for( .@i = 0; .@i < $@partymembercount; .@i++ ) {
                        debugmes .@i + ": " + $@partymemberaid[.@i] + "/" + $@partymembercid[.@i];
                        if( attachrid($@partymemberaid[.@i]) && getcharid(0) == $@partymembercid[.@i] ) {
                                warp instance_mapname("poring_w01",.@id),0,0;
                                'Pcounter++;
                        }
                }
                end;
        default:
                mes .@n$;
                mes "So shall it be.";
                close;
        }
}
 
poring_w01,0,0,0        script  PKMTimer        -1,{
OnInstanceInit:
        initnpctimer;
        end;
 
OnTimer5000:
        if( 'Pcounter < 2 ) {
                instance_announce -1,"Recruiter: What? Did you want to fool me?! Blasphemy! I won't let you fight alone! GET OUT!",bc_yellow|bc_npc;
                stopnpctimer;
                sleep2 3000;
                instance_destroy;
                end;
        }
        instance_announce -1,"Welcome, welcome! My new toys!",bc_yellow|bc_npc;
        end;
       
OnTimer8000:
        'Round = 1;
        instance_announce -1,"Prepare for round 1 of your battle!",bc_yellow|bc_npc;
        end;
       
OnTimer11000:
        instance_announce -1,"[3]",bc_yellow|bc_npc;
        end;
       
OnTimer12000:
        instance_announce -1,"[2]",bc_yellow|bc_npc;
        end;
       
OnTimer13000:
        instance_announce -1,"[1]",bc_yellow|bc_npc;
        end;
       
OnTimer14000:
        instance_announce -1,"Fight!",bc_yellow|bc_npc;
        areamonster instance_mapname("poring_w01"),80,90,123,105,"--en--",1582,1,instance_npcname(strnpcinfo(0))+"::OnWave1Dead";
        end;
       
OnWave1Dead:
        instance_announce -1,"Oh, you fight back...",bc_yellow|bc_npc;
        sleep 3000;
        'Round++;
        instance_announce -1,"But it's not over yet! Time for round 2!",bc_yellow|bc_npc;
        sleep 2000;
        'slave = callfunc("PKM_getSlave");
OnRestartWave2:
        'count = 25;
        areamonster instance_mapname("poring_w01"),80,90,123,105,"--en--",1582,1,instance_npcname(strnpcinfo(0))+"::OnBoss2Dead";
        areamonster instance_mapname("poring_w01"),80,90,123,105,"--en--",'slave,'count,instance_npcname(strnpcinfo(0))+"::OnSlave2Dead";
        end;
 
OnSlave2Dead:
        'count--;
        end;
 
OnBoss2Dead:
        if( 'count ) {
                killmonsterall instance_mapname("poring_w01");
                donpcevent instance_npcname(strnpcinfo(0)) + "::OnRestartWave2";
                end;
        }
        instance_announce -1,"Good job!",bc_yellow|bc_npc;
        sleep 3000;
        'Round++;
        if( 'Round <= 1 + 'Pcounter ) {
                instance_announce -1,"But it's not over yet! Time for round " + 'Round + "!",bc_yellow|bc_npc;
                sleep 2000;
                'slave = callfunc("PKM_getSlave");
                'count = 25;
                areamonster instance_mapname("poring_w01"),80,90,123,105,"--en--",1582,1,instance_npcname(strnpcinfo(0))+"::OnBoss2Dead";
                areamonster instance_mapname("poring_w01"),80,90,123,105,"--en--",'slave,'count,instance_npcname(strnpcinfo(0))+"::OnSlave2Dead";
                end;   
        } else {
                instance_announce -1,"You think you can defeat me? Time for last fight!",bc_yellow|bc_npc;
                sleep 2000;
                areamonster instance_mapname("poring_w01"),80,90,123,105,"--en--",1582,1,instance_npcname(strnpcinfo(0))+"::OnBoss3Dead";
                end;   
        }
 
OnBoss3Dead:
        instance_announce -1,"Congratulations, fight is finished.",bc_yellow|bc_npc;
        // Anything else you might want
        sleep 5000;
        instance_warpall "prontera",150,152;
        instance_destroy;
        end;
}
Viewed 710 times, submitted by unknown.