RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

In-game Customizable Regions in a Box [V3.6]

ASayre

RunUO Developer
In-game Customizable Regions in a Box [V3.6]

Summary:
These customizable regions allow Staff to be able to add and remove and customize regions without needing a script update. The staff member can allow/disallow Spells/Skills And much more.



Description:
UPDATES:
4/21 [3.6]:
/sigh. I DID have the guarded bug fixed, but, when I uploaded it, I didn't upload the working file with the fix. So. Here it is. Tested and everything. (For once)

Also fixed the priority bugs, Wans't a bug with priority, just the region not updating at the right times... I think I tested it all accordingly and stuff and it all seemed to work.. so, test it out for me & tell me! :)

Fixed bug where Showbounds didn't have the top-right corner piece.

ShoBounds will now tell you teh region priority of the region if you target a mobile.

4/21 [3.5]:
Fixed the other half of Guard Bug. Should be 100% fixed and bug free now.

Added command [RegionBounds . This command will work for ANY Region. Just target a Mobile to display the bounds for that Mobile, or Target a RegionControl to display the bounding areas for that.

That features uses effects and not an actual item to reduce lag and so it's not permanent. This is intended.

Because of this features, Scripters can use the static methods in there to show bounds of ANY region or ANY rectangle2D that they want. Just use Functions ->

Code:
static void ShowRegionBounds( Region r )
static void ShowRectBounds( Rectangle2D r, Map m )

As always, Please post any more suggestions or Bugs, Yaada yaada!

4/17 [3.2]:
Allowed the Region to just use the default light level... Set LightLevel to a negative number.

Fixed bugs where the Saved Guarded status would, after restart, become the opposite of what it was before.

Please re-download & remember to Post any bugs or Suggestions :)

4/14 [3.1]:
Allowed these regions to be Guardable! :) you can either use any of the commands for normal guarded regins as well as setting it via [props. This WILL save :)

Allowed resticting of Potions

Allowed restricting of Looting your own corpse, Other player corpses, And NPC corpses.

Allowed setting the light level.

Please re-download & remember to Post any bugs or Suggestions :)



This used to be a Subscriber-only release but I've now released it here for the public, along with some more minor Bug Fixes.

Please post any suggestions and/or Bugs and I'll try to fix or implement it :)

Installation:
Unzip and place this in your script folder. To add it ingame, type

[add RegionControl

Then double click & [props it.
 

Attachments

  • CustomRegion 3-6.zip
    8.5 KB · Views: 6,682

Maromba

Wanderer
Sem condicao

I am Brazilian!

Gostei muito do seu scripts é de coisas assim que precisamos e não dos que andam saindo atualmente.

I like very!

:D
 

Wildcard

Sorceror
I just want to say this is a great script and i love it. I like how your able to set the music for a particular region.

One thing that i think would make it better is if you could make it so that the lightlevel of a region could be adjusted. And perhaps a toggle between the region being guardable or not.

Thank you for releaseing this great script.
 

ASayre

RunUO Developer
Wildcard said:
I just want to say this is a great script and i love it. I like how your able to set the music for a particular region.

One thing that i think would make it better is if you could make it so that the lightlevel of a region could be adjusted. And perhaps a toggle between the region being guardable or not.

Thank you for releaseing this great script.

Okays, I'll prolyl implement a lightlevel that can be changed & stuff, as far as it being guarded....

I've been a bit hesitant with that cause a), It mitgh cause problems, and b) I don't want this script to be a replacement to good ol' scripting your regions.... Just a supplement to it.

Maybe if I get enough people asking to toggle guarded... I'll look into it.
 

Trixie

Wanderer
ASayre8 said:
Maybe if I get enough people asking to toggle guarded... I'll look into it.

First off, I would like to thank you for this script. It is going to make my life so much easier. As I have a custom map, editing my regions has been a nightmare.
The guard toggle would be a welcome addition. I have tried to get a new region I had added to become guardable but without success so far.
Once again, my thanks for this script.
 
Wow!

WOW! Once and a while someone comes up with something really useful and you sure did just that. : ) You probably put alot of work into this. Thank you!
 

Kennyd

Sorceror
I agree with the other people..
This script will be very useful to alot of people...

That's why I gave you a 5/5 :)
 

Mortis

Knight
Wildcard said:
I just want to say this is a great script and i love it. I like how your able to set the music for a particular region.

One thing that i think would make it better is if you could make it so that the lightlevel of a region could be adjusted. And perhaps a toggle between the region being guardable or not.

Thank you for releaseing this great script.

It is very easy to add the regions as guarded your self. I did it this way.

Change line 13 in Custom Region.cs to

Code:
		public CustomRegion( RegionControl m, Map map ) : base( "", "Custom Region", map, typeof( ArcherGuard ) )

Now when making a region it will automatically be set guarded.

You can use [toggleguarded to change that or replace Region Control gump with this one.

RegionControllGump
Code:
using System;
using Server;
using Server.Gumps;
using Server.Items;
using Server.Network;
using Server.Regions;

namespace Server.Gumps
{
	public class RegionControlGump : Gump
	{
		RegionControl m_Controller;
		public RegionControlGump( RegionControl r )	: base( 25, 25 )
		{
			m_Controller = r;

			Closable=true;
			Dragable=true;
			Resizable=false;

			AddPage(0);

			AddBackground(23, 32, 612, 256, 9270);
			AddAlphaRegion(19, 29, 618, 263);
			AddButton(55, 46, 5569, 5570, (int)Buttons.SpellButton, GumpButtonType.Reply, 0);
			AddButton(55, 128, 5581, 5582, (int)Buttons.SkillButton, GumpButtonType.Reply, 0);
			AddButton(50, 205, 7006, 7006, (int)Buttons.AreaButton, GumpButtonType.Reply, 0);
			AddButton(355, 46, 5587, 5588, (int)Buttons.GuardOnButton, GumpButtonType.Reply, 0);
			AddButton(355, 128, 5585, 5586, (int)Buttons.GuardOffButton, GumpButtonType.Reply, 0);

			AddLabel(152, 70, 1152, "Edit Restricted Spells");
			AddLabel(152, 153, 1152, "Edit Restricted Skills");
			AddLabel(152, 234, 1152, "Add Region Area");
			AddLabel(452, 70, 1152, "Toggle Guarded Off");
			AddLabel(452, 153, 1152, "Toggle Guarded On");
			AddImage(353, 54, 3953);
			AddImage(353, 180, 3955);
			AddImage(453, 54, 3953);
			AddImage(453, 180, 3955);

		}
		
		public enum Buttons
		{
			SpellButton = 1,
			SkillButton,
			AreaButton,
			GuardOnButton,
			GuardOffButton
		}

		public override void OnResponse( NetState sender, RelayInfo info )
		{
			if( m_Controller == null || m_Controller.Deleted )
				return;

			Mobile m = sender.Mobile;

			switch( info.ButtonID )
			{
				case 1:
				{
					m.CloseGump( typeof( SpellRestrictGump ) );
					m.SendGump( new SpellRestrictGump( m_Controller.RestrictedSpells ) );

					m.CloseGump( typeof( RegionControlGump ) );
					m.SendGump( new RegionControlGump( m_Controller ));
					break;
				}
				case 2:
				{

					m.CloseGump( typeof( SkillRestrictGump ) );
					m.SendGump( new SkillRestrictGump( m_Controller.RestrictedSkills ) );

					m.CloseGump( typeof( RegionControlGump ) );
					m.SendGump( new RegionControlGump( m_Controller ));
					break;
				}
				case 3:
				{
					m.CloseGump( typeof( RegionControlGump ) );
					m.SendGump( new RegionControlGump( m_Controller ) );

					m.CloseGump( typeof( RemoveAreaGump ) );

					m.SendGump( new RemoveAreaGump( m_Controller ) );

					m_Controller.ChooseArea( m );
					break;
			              }
				case 4:
				{

					GuardedRegion reg = m.Region as GuardedRegion;

				if ( reg == null )
				{
						m.SendMessage( 33, "You are not in the guarded area." );
						m.SendMessage( 33, "You will have to go there  to turn the guards off." );
				}
			 	else  if ( reg.Disabled )
                                           	{
						m.SendMessage( 3, "The guards in this region have not changed." );
                                           	}
				else if ( !reg.Disabled )
                                           	{
						reg.Disabled = !reg.Disabled;
			              		m.SendMessage( 3, "The guards in this region have been disabled." );
                                           	}
						m.SendGump( new RegionControlGump( m_Controller ) );
						break;
				}
				case 5:
				{

						GuardedRegion reg = m.Region as GuardedRegion;

				if ( reg == null )
				{
						m.SendMessage( 33, "You are not in a The guarded area." );
						m.SendMessage( 33, "You will have to go there to turn the guards on." );
				}
                                           	else if ( !reg.Disabled )
                                           	{
						m.SendMessage( 3, "The guards in THIS region have not changed." );
                                           	}

                                           	else if ( reg.Disabled )
                                           	{
			              		reg.Disabled = !reg.Disabled;
			              		m.SendMessage( 3, "The guards in THIS region have been enabled." );
                                           	}
						m.SendGump( new RegionControlGump( m_Controller ) );
						break;
				}
			}
		}
	}
}

You have to actually be in the region you made for it to toggle guards.

There is a check in to make sure your in a guardable region so the server does not crash.

This is for any one who would like this feature.
 

ASayre

RunUO Developer
Mortis said:
It is very easy to add the regions as guarded your self. I did it this way.
You have to actually be in the region you made for it to toggle guards.

There is a check in to make sure your in a guardable region so the server does not crash.

This is for any one who would like this feature.

That works as a temp fix, but, It can cause other problems with soem of the other features of RegionControl that i'd need to change. Hence it not being in.


Edit: Well, sicne all these people DO want it guardable... I'll work on implementing it later today after I get back home.

Features coming in new Version in a few days that I've done but not tested..

Restrict Looting of Corpses, Restrict Potion use, Change lightlevel & prolly Gonnas allow a check for guarded regions and stuff now.
 

Mortis

Knight
ASayre8 said:
That works as a temp fix, but, It can cause other problems with soem of the other features of RegionControl that i'd need to change. Hence it not being in.


Edit: Well, sicne all these people DO want it guardable... I'll work on implementing it later today after I get back home.

Features coming in new Version in a few days that I've done but not tested..

Restrict Looting of Corpses, Restrict Potion use, Change lightlevel & prolly Gonnas allow a check for guarded regions and stuff now.

Ok. It all seemed to work ok for me as the package is right now.

But you know what your going to be doing to it later on better than I do.
 

ASayre

RunUO Developer
Just so I know while I'm working on this & since I know I cna now restrict certain items...

Any other items anyone wants restricted? I have corpses & potions & ethys.... Anything else?
 

Mortis

Knight
Well just athought. As long as you are asking.

Certain weapons? Like artifacts or even base weapons. Like BaseRanged, BaseBashing and BaseSwords.
 

ASayre

RunUO Developer
Mortis said:
Well just athought. As long as you are asking.

Certain weapons? Like artifacts or even base weapons. Like BaseRanged, BaseBashing and BaseSwords.

Well, right now I only have thing that work by double-clicking... I'll eentually ytry and find a way to restrict weapons.. just... Not yet.
 

ASayre

RunUO Developer
Updated! [V3.1]

Updated it with the features yall wanted! :)

4/14 [3.1]:
Allowed these regions to be Guardable! :) you can either use any of the commands for normal guarded regins as well as setting it via [props. This WILL save :)

Allowed resticting of Potions

Allowed restricting of Looting your own corpse, Other player corpses, And NPC corpses.

Allowed setting the lightlevel

Please re-download & remember to Post any bugs or Suggestions :)
 

Wildcard

Sorceror
Thanks for making the option to make the regions guardable and the option to adjust the lightlevel. Again, Thanks for releasing this script.
 

Lynnewellen

Wanderer
great tool

If you are asking for possible things to restrict........................maybe resources like ore or housing.............allowed or not allowed. those are more possibilities.
 

ASayre

RunUO Developer
Lynnewellen said:
If you are asking for possible things to restrict........................maybe resources like ore or housing.............allowed or not allowed. those are more possibilities.

Housing restriction is already an option.
 

hcker2000

Wanderer
I didn't see this in there (I could have missed it. its very early in the morning). Could you make a way to set the regions priority that way your could make over laping regions. I'm sure you know what I'm talking about but if not just ask hehe :D
 
Top