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; }