Jump to content
  • 0

Looking for an Invasion Scriptwith mob selection


Question

Posted

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.

2 answers to this question

Recommended Posts

  • 1
Posted (edited)
-	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(.@T$,.set$[rand(getarraysize(.set$))],",");
	for(.@i = 0; .@i < getarraysize(.@T$); .@i++){
		explode(.@TT$,.@T$[.@i],":");
		if(getarraysize(.@TT$) > 2){
			if(atoi(.@TT$[3]) == 0)
				.@amount = atoi(.@TT$[1]);
			else
				.@amount = rand(atoi(.@TT$[2]),atoi(.@TT$[3]));
			
		} else
			.@amount = atoi(.@TT$[1]);
		monster .current_map$,0,0,"--ja--",atoi(.@TT$[0]),.@amount,strnpcinfo(0) + "::OnMobDead";
		deletearray .@TT$[0],getarraysize(.@TT$);
	}
	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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...