Jump to content
  • 0

Spawn Monster rate depend player on map


Question

Posted

Hi, i want to make gold room, and i want to setting spawn mobs depend how many players in the map

 

like if player <5 Only respawn 50

if player >5 & <10 respawn monster 100

its possible?

thanks

4 answers to this question

Recommended Posts

  • 1
Posted

This is my way of doing this.

 

-	script	goldroom	-1,{

OnGoldKilled:
	sleep 1500;		//Respawn time 1000 = second
	.@mc = getmapunits(BL_MOB,"jupe_ele");	//Mob Count
	.@pc = getmapunits(BL_PC,"jupe_ele");	//Player Count
	for(.@i=0;.@i<getarraysize(.setting);.@i+=2)
		if(.@pc >= .setting[.@i])
			.@summon = .setting[.@i+1];
	if(!.@summon && .@mc <= .initial)
		monster "jupe_ele",0,0,"GOLD MOB",1002,1,strnpcinfo(0)+"::OnGoldKilled";
	else
		monster "jupe_ele",0,0,"GOLD MOB",1002,(.@summon-.@mc)+1,strnpcinfo(0)+"::OnGoldKilled";
end;

OnInit:
	.initial = 50;	//Normal Mob Count 
	setarray .setting[0],5,100,10,150,15,200;	//Player Count, Mob Count{,PC, MC) (5 player = 100 monster, 10 Player = 150 monster.. etc..)
	monster "jupe_ele",0,0,"GOLD MOB",1002,.initial,strnpcinfo(0)+"::OnGoldKilled";
end;
}

 

  • Upvote 1
  • 0
Posted
4 hours ago, Haruka Mayumi said:

This is my way of doing this.

 


-	script	goldroom	-1,{

OnGoldKilled:
	sleep 1500;		//Respawn time 1000 = second
	.@mc = getmapunits(BL_MOB,"jupe_ele");	//Mob Count
	.@pc = getmapunits(BL_PC,"jupe_ele");	//Player Count
	for(.@i=0;.@i<getarraysize(.setting);.@i+=2)
		if(.@pc >= .setting[.@i])
			.@summon = .setting[.@i+1];
	if(!.@summon && .@mc <= .initial)
		monster "jupe_ele",0,0,"GOLD MOB",1002,1,strnpcinfo(0)+"::OnGoldKilled";
	else
		monster "jupe_ele",0,0,"GOLD MOB",1002,(.@summon-.@mc)+1,strnpcinfo(0)+"::OnGoldKilled";
end;

OnInit:
	.initial = 50;	//Normal Mob Count 
	setarray .setting[0],5,100,10,150,15,200;	//Player Count, Mob Count{,PC, MC) (5 player = 100 monster, 10 Player = 150 monster.. etc..)
	monster "jupe_ele",0,0,"GOLD MOB",1002,.initial,strnpcinfo(0)+"::OnGoldKilled";
end;
}

 

Thank you all ?

 

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...