Jump to content
  • 0
Rivers

Looking for an Invasion Scriptwith mob selection

Question

good day,

I'm looking for a simple Invasion script that will spawn, either a set or random amount, of a specific monster set. I'm looking to use this for Seasonal Invasions, like Christmas mobs for Christmas season invasions.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 1
-	script	invasion	-1,{
	
OnInit:
	setarray .map$,"prontera","izlude";
	function add_set;
	function create_set;
	create_set();
end;

OnMinute00:
	function start_set;
	start_set();
end;

OnMobDead:
	if(!mobcount(.current_map$,strnpcinfo(0) + "::OnMobDead")){
OnTimer900000:
		function end_set;
		end_set();
	}
end;
	
//= Add your new set here.
function	create_set	{
	//= add_set("Mob ID:Mob Amount{:Min amount:Max amount},....."); If min/max amount is added mob amount will be ignored. 
	add_set("1001:50,1002:20:70:100");
	add_set("1005:50:10:20,1001:20");
}

function	add_set	{
	.set$[getarraysize(.set$)] = getarg(0);
	return;
}
	
function	start_set	{
	.current_map$ = .map$[rand(getarraysize(.map$))];
	killmonster .current_map$,strnpcinfo(0) + "::OnMobDead";
	explode([email protected]$,.set$[rand(getarraysize(.set$))],",");
	for([email protected] = 0; [email protected] < getarraysize([email protected]$); [email protected]++){
		explode([email protected]$,[email protected]$[[email protected]],":");
		if(getarraysize([email protected]$) > 2){
			if(atoi([email protected]$[3]) == 0)
				[email protected] = atoi([email protected]$[1]);
			else
				[email protected] = rand(atoi([email protected]$[2]),atoi([email protected]$[3]));
			
		} else
			[email protected] = atoi([email protected]$[1]);
		monster .current_map$,0,0,"--ja--",atoi([email protected]$[0]),[email protected],strnpcinfo(0) + "::OnMobDead";
		deletearray [email protected]$[0],getarraysize([email protected]$);
	}
	announce "Invasion : Invasion has started in " + .current_map$ + ".",bc_blue;
	initnpctimer;
	end;
}

function	end_set	{
	announce "Invasion : All monster has been killed.",bc_blue;
	killmonster .current_map$,strnpcinfo(0) + "::OnMobDead";
	end;
}

}

 

Edited by crazyarashi
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.