Jump to content
  • 0

Spawn Monster rate depend player on map


LearningRO

Question


  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

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

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  477
  • Reputation:   269
  • Joined:  06/13/17
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  16
  • Reputation:   7
  • Joined:  06/06/19
  • Last Seen:  

using *getmapusers logic is one of the options

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  477
  • Reputation:   269
  • Joined:  06/13/17
  • Last Seen:  

*getmapunits
*getmapusers
*OnPCLoadMapEvent
*initnpctimer;

add some "OnMyMobDead" label on *monster.

you can use any of this combinations to do what you want. 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

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 ?

 

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