Jump to content
  • 0

CUSTOMIZED LEVELING ROOM


mysticarts13

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  12/24/21
  • Last Seen:  

Hi everyone. Is it possible to create like an "unpassable" set of cells in a map (like a wall) but only for monsters? It's to keep them inside the supposed "cage" in my leveling room (if that makes any sense >.< ). Players should be able to get inside and attack from outside the cage (skills and ranged attacks). Any input is greatly appreciated, thank you!

wawa.jpg

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  232
  • Reputation:   86
  • Joined:  06/30/18
  • Last Seen:  

10 hours ago, Troll said:

He probably meant something like this.

q99OFDx.gif
 


The code provided by **WinterFox** works too as well. Just put the coordinates at the Middle and adjust the radius.

I see. I went with the first solution I came up with from the top of my head. But it isn't that hard to do it the way you are showing either.
You simply can use an invisible npc with an OnTouchNPC label that teleports the mob back into the desired area.

-	script	EXAMPLE_SPAWN	-1,{
	OnInit:
		areamonster("prontera", 151, 149, 155, 143, "", "poring", 2);
}

-	script	MOB_BOUNDARY_CELL	-1,{
	OnTouchNPC:
		unitwarp(getattachedrid(), "this", 153, 147);
}

prontera,150,150,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#01	-1,0,0
prontera,151,150,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#02	-1,0,0
prontera,152,150,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#03	-1,0,0
prontera,153,150,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#04	-1,0,0
prontera,154,150,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#05	-1,0,0
prontera,155,150,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#06	-1,0,0
prontera,156,150,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#07	-1,0,0

prontera,150,149,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#08	-1,0,0
prontera,150,148,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#09	-1,0,0
prontera,150,147,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#10	-1,0,0
prontera,150,146,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#11	-1,0,0
prontera,150,145,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#12	-1,0,0
prontera,150,144,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#13	-1,0,0

prontera,150,144,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#14	-1,0,0
prontera,151,144,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#15	-1,0,0
prontera,152,144,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#16	-1,0,0
prontera,153,144,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#17	-1,0,0
prontera,154,144,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#18	-1,0,0
prontera,155,144,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#19	-1,0,0
prontera,156,144,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#20	-1,0,0

prontera,156,149,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#21	-1,0,0
prontera,156,148,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#22	-1,0,0
prontera,156,147,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#23	-1,0,0
prontera,156,146,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#24	-1,0,0
prontera,156,145,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#25	-1,0,0
prontera,156,144,0	duplicate(MOB_BOUNDARY_CELL)	MOB_BOUNDARY_CELL#26	-1,0,0

 

Edited by Winterfox
  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  896
  • Reputation:   117
  • Joined:  05/23/12
  • Last Seen:  

U can use areamonster. Idk if the monster only available to walk in this area but every monster spawned gets an uid and un can check the position. If it out of the position u could kill and respawn them. Maybe it's easier.

 

Rynbef~

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  232
  • Reputation:   86
  • Joined:  06/30/18
  • Last Seen:  

Try this:
 

-	script	MOB_BOUNDARY	-1,{
	OnInit:
		// CONFIG
		.map$ = "prontera";
		.check_interval = 1000;

		.center_x = 150;
		.center_y = 150;
		.range_x = 5;
		.range_y = 5;

		// CONFIG END
		.start_x = .center_x - .range_x;
		.start_y = .center_y - .range_y;
		.end_x =  .center_x + .range_x;
		.end_y =  .center_y + .range_y;

		areamonster(.map$, .start_x, .start_y, .end_x, .end_y, "", "poring", 1);

		freeloop(1);
		while(true) {
			deletearray(.@mobs, getarraysize(.@mobs));
			getmapunits(BL_MOB, .map$, .@mobs);

			for(.@i = 0; .@i < getarraysize(.@mobs); .@i++) {
				getunitdata(.@mobs[.@i], .@mob_data);
				if(
					(.@mob_data[UMOB_X] < .start_x || .@mob_data[UMOB_X] > .end_x) ||
					(.@mob_data[UMOB_Y] < .start_y || .@mob_data[UMOB_Y] > .end_y)
				) {
					unitstopwalk(.@mobs[.@i], USW_FORCE_STOP);
					getfreecell(.map$, .@x, .@y, .center_x, .center_y, .range_x, .range_y);
					unitwalk(.@mobs[.@i], .@x, .@y);
				}
			}

			sleep(.check_interval);
		}
		freeloop(0);
}

Simply set the map, center coordinates and range for the area you want the mobs to be able to move in. Once they step outside the area, they will stop and walk back into it.

Edited by Winterfox
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  24
  • Reputation:   6
  • Joined:  03/17/21
  • Last Seen:  

2 hours ago, Winterfox said:

Try this:
 

-	script	MOB_BOUNDERY	-1,{
	OnInit:
		// CONFIG
		.map$ = "prontera";
		.check_interval = 1000;

		.center_x = 150;
		.center_y = 150;
		.range_x = 5;
		.range_y = 5;

		// CONFIG END
		.start_x = .center_x - .range_x;
		.start_y = .center_y - .range_y;
		.end_x =  .center_x + .range_x;
		.end_y =  .center_y + .range_y;

		areamonster(.map$, .start_x, .start_y, .end_x, .end_y, "", "poring", 1);

		freeloop(1);
		while(true) {
			deletearray(.@mobs, getarraysize(.@mobs));
			getmapunits(BL_MOB, .map$, .@mobs);

			for(.@i = 0; .@i < getarraysize(.@mobs); .@i++) {
				getunitdata(.@mobs[.@i], .@mob_data);
				if(
					(.@mob_data[UMOB_X] < .start_x || .@mob_data[UMOB_X] > .end_x) ||
					(.@mob_data[UMOB_Y] < .start_y || .@mob_data[UMOB_Y] > .end_y)
				) {
					unitstopwalk(.@mobs[.@i], USW_FORCE_STOP);
					getfreecell(.map$, .@x, .@y, .center_x, .center_y, .range_x, .range_y);
					unitwalk(.@mobs[.@i], .@x, .@y);
				}
			}

			sleep(.check_interval);
		}
		freeloop(0);
}

Simply set the map, center coordinates and range for the area you want the mobs to be able to move in. Once they step outside the area, they will stop and walk back into it.

He probably meant something like this.

q99OFDx.gif
 

On 2/11/2024 at 1:55 PM, mysticarts13 said:

Hi everyone. Is it possible to create like an "unpassable" set of cells in a map (like a wall) but only for monsters? It's to keep them inside the supposed "cage" in my leveling room (if that makes any sense >.< ). Players should be able to get inside and attack from outside the cage (skills and ranged attacks). Any input is greatly appreciated, thank you!

wawa.jpg


The code provided by **WinterFox** works too as well. Just put the coordinates at the Middle and adjust the radius.

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