prontera,234,200,4 script Invasion NPC 4_F_NFLOSTGIRL,{
set .GM,50;//GM Level to access the GM Menu. Default: 50
// GM menu
//It allows GMs Level 50 or more to Start and Stop invasions.
if (getgmlevel()>.GM) {
if (.mobs_left) {
mes "An invasion is in progress..";
mes "map = "+.maps$[.rand_map];
mes "^FF0000"+.mobs_left+"^000000 Goblins left";
mes " ";
mes "Stop invasion?";
if(select("No:Yes")==1) close;
donpcevent "Invasion NPC::OnTimer1805000";
mes "Invasion stopped";
announce "The Invasion has been stopped by "+strcharinfo(0),bc_all;
close;
}
mes "Start an invasion?";
if(select("Yes:No")==2) close;
donpcevent "Invasion NPC::OnStart";
mes "Invasion started in "+.maps$[.rand_map]+".";
close;
}
// If a player clicks the NPC, it displays:
mes .mobs_left+" have invaded "+.maps$[.rand_map]+"!";
close;
/////////////////////////
//The actual NPC Script//
/////////////////////////
OnStart:
set .mobs_left, 1;
setarray .maps$[0], "prontera","morocc","payon","alberta","izlude","aldebaran","xmas","comodo","yuno","amatsu","gonryun","umbala","louyang","jawaii","ayothaya","lighthalzen","einbech","hugel","rachel"; // 3 maps to pick from, you can change them.
set .rand_map, rand(19); // pick a random map
initnpctimer;
announce "Satan Morroc Invasion Begin.", bc_all,"0x666666",0;
end;
OnTimer5000: // 5 seconds later after the first broadcast
announce "Get rid of these Satan Morocc!", bc_all,"0x666666",0;
sleep2 10000;
announce "We need your help!", bc_all,"0x666666",0;
sleep2 10000;
announce "They're destroying our precious city here in [ "+.maps$[.rand_map]+" ] Town. Hurry Up!", bc_all,"0x666666",0;
monster .maps$[.rand_map],0,0,"Satan Morroc",$invasion_mvp_id,1,"Invasion NPC::OnMyMobDead";
set .mobs_left, 1;
end;
OnTimer1805000: // 30 minutes later, kills all the mobs.
killmonster .maps$[.rand_map],"Invasion NPC::OnMyMobDead";
set .mobs_left, 1;
OnStop://When the event is stopped by a GM, or all monsters dead.
stopnpctimer;
end;
OnNPCKillEvent:
if(killedrid == $invasion_mvp_id) {
announce strcharinfo(0)+" has defeated Satan Morocc!", bc_all;
getitem 675,1;
}
end;
OnMyMobDead://When a Satans is killed
set .mobs_left, .mobs_left-1;
if (.mobs_left==0) {
//announce strcharinfo(0)+" has defeated Satan Morocc!", bc_all,"0xFFFF33",0;
//If you'd like to give a prize
//to the last player who killed a Goblin
//Uncomment the following line, and fill accordingly:
//getitem 675,1;
//getitem 677,1;
donpcevent "Invasion NPC::OnStop";
} else {
dispbottom "["+.mobs_left+"/1] Satan Morocc left.";
}
end;
//Uncomment these lines to have the NPC do the invasion every hour
//OnMinute00:
donpcevent "Invasion NPC::OnStart";
//Uncomment these lines to have the NPC do the invasion every 3 hours.
OnClock0000:
OnClock0300:
OnClock0600:
OnClock0900:
OnClock1200:
OnClock1500:
OnClock1800:
OnClock1201:
donpcevent "Invasion NPC::OnStart";
OnInit:
$invasion_mvp_id = 1917;
}