sec_in01,170,180,3 script Soccer Ball 480,{
mes "[ Soccerball ]";
if (!.Status)
mes "There is no event at the moment!";
else {
mes "There are "+.Spawn+" soccerball left in "+.Map$+"!";
mes "Find and kill the soccerball to gain "+getitemname(.Prize)+"!";
}
if (.Status || getgmlevel() < .GM) close;
mes "Start the event?";
next;
if(select("- No:- Yes") == 1) close;
donpcevent strnpcinfo(0)+"::OnClock0100";
mes "[ Soccerball ]";
mes "Event started!";
close;
OnInit:
set .Prize,7227; // Reward item ID
set .Amount,1; // Reward item amount
set .GM,99; // GM level required to access NPC
setarray .Maps$[0],"payon"; // Possible maps
end;
OnClock0200:
OnClock0600:
OnClock1000:
OnClock1400:
OnClock1800:
OnClock2200:
if (.Status) end;
set .Status,1;
set .Spawn,rand(1,3); // How many soccerball should spawn?
set .Map$,.Maps$[rand(getarraysize(.Maps$))];
killmonster .Map$,"All";
monster .Map$,0,0,"Soccerball!",1792,.Spawn,strnpcinfo(0)+"::OnMobKilled";
announce "Soccerball has been summon!",0;
sleep 5000;
announce "Total of "+.Spawn+" soccerball have been spawned in "+.Map$+"!",0;
end;
OnMobKilled:
set .Spawn, .Spawn - 1;
getitem .Prize, .Amount;
if (.Spawn) announce "[ "+strcharinfo(0)+" ] has killed a soccerball. There are now "+.Spawn+" soccerball(s) left.",bc_map;
else {
announce "The soccerball event has ended. All the soccerball have been killed.",bc_map;
set .Status,0;
}
end;
}
On this script when monster will die you will go to OnMobKilled:
Then add this onMobKilled:
If you want item when the monster killed : getitem .Prize, .Amount;
If you want player die add : atcommand "@nuke "+strcharinfo(0)+"
If you want to summon a new monster add : monster .Map$,0,0,"Soccerball!",1792,.Spawn,strnpcinfo(0)+"::OnMobKilled";