Go Back   RunUO - Ultima Online Emulation > RunUO > RunUO Post Archive

RunUO Post Archive The Archvie

Reply
 
Thread Tools Display Modes
Old 07-18-2004, 10:57 PM   #1 (permalink)
Forum Novice
 
Join Date: Jul 2004
Age: 22
Posts: 216
Default How do I make chaos and order bases? etc

Firstly to do this you will need to know how to define your own regions. I recommend using the tool Region Editor found on the Pandora's Box website to get an accurate region.

Then using this nice FAQ you can define your new region.

Once you have your new region set up and ready, you must override the method which handels people entering it. Here:
Code:
public override bool OnMoveInto( Mobile from, Direction d, Point3D newLocation, Point3D oldLocation )
Then you would need to get the Guild information:

Code:
Guild g = from.Guild as Guild;
Then the actual logical tests come into play:

Code:
if (from.AccessLevel > AccessLevel.Player)// This is so staff can still enter
		{
		return true;
		}	
		if (from.Player == false) //So npcs and other monsters such as pets can move around
		{
		return true; //Change this to false if you don't want NPC's running around		
		}	
		else if ( g == null || g.Type != GuildType.Chaos) //This is the bit where the actual
		{						  //check on the guild is made		
		from.SendLocalizedMessage( 501284 ); // You may not enter.
		return false;
		}
		
		return true; //Everything else has been accounted for so this returns true for chaos folk.
As we are using many other namespaces for lots of spells we must not forget to add this in!

Code:
using System;
using Server;
using Server.Items;
using Server.Multis;
using Server.Mobiles;
using Server.Spells;
using Server.Spells.Seventh;
using Server.Spells.Fourth;
using Server.Spells.Sixth;
using Server.Guilds;
So there you have it. If you still need to copy, or reference to a working region then i'll post my entire region for extra help. Enjoy.

Code:
using System;
using Server;
using Server.Items;
using Server.Multis;
using Server.Mobiles;
using Server.Spells;
using Server.Spells.Seventh;
using Server.Spells.Fourth;
using Server.Spells.Sixth;
using Server.Guilds;
namespace Server.Regions
{
	public class Chaos : Region
	{
		public static void Initialize()
		{
			Region.AddRegion( new Chaos( Map.Ilshenar ) );
		}

		public Chaos( Map map ) : base( "", "Chaos", map )
		{
		}

		public override bool AllowHousing( Mobile from, Point3D p )
		{
			if ( from.AccessLevel == AccessLevel.Player )
				return false;
			else
				return true;
		}


		public override TimeSpan GetLogoutDelay( Mobile m )
		{
			
				return TimeSpan.Zero;
		
		}
		
		public override bool OnBeginSpellCast( Mobile from, ISpell s )
		{
			if ( from.AccessLevel == AccessLevel.Player )
				from.SendLocalizedMessage( 502629 ); // You cannot cast spells here.

			return ( from.AccessLevel > AccessLevel.Player );
		}

		public override bool OnCombatantChange( Mobile from, Mobile Old, Mobile New )
		{
			return ( from.AccessLevel > AccessLevel.Player );
		}
		public override bool OnMoveInto( Mobile from, Direction d, Point3D newLocation, Point3D oldLocation )
		{

			Guild g = from.Guild as Guild;

		if (from.AccessLevel > AccessLevel.Player)// This is so staff can still enter
		{
		return true;
		}	
		if (from.Player == false) //So npcs and other monsters such as pets can move around
		{
		return true; //Change this to false if you don't want NPC's running around		
		}	
		else if ( g == null || g.Type != GuildType.Chaos) //This is the bit where the actual
		{						  //check on the guild is made		
		from.SendLocalizedMessage( 501284 ); // You may not enter.
		return false;
		}
		
		return true; //Everything else has been accounted for so this returns true for chaos folk.
	}

		public override void OnEnter( Mobile m )
		{
		m.SendMessage("You have entered the Chaos Domain");		
	        }
		public override void OnExit( Mobile m )	
		{
		m.SendMessage("You have left the Chaos Domain");
		}
      }
}
plus is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5