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!

†D_PR Travel Book†

Darkness_PR

Wanderer
†D_PR Travel Book†

†D_PR Travel Book Ver 1.1†

Description:
*Complete traveling book that works like a recall spell. So it will follow the same rules as a recal spell. This was done due to the many exploits of the other systems or travel books out there.

*This version of the travel book allows you have hidden location to your players. This was done so staff members have somewhere to have their own locations.

*This travel book allows you to have 16 sections and 16 locations in each section.

*This travel book have the location for all facets Felucca, Trammel, Malas, Ilshennar & Tokuno all can by modify in BOTData.xml

Intallation:
*All the files contained in the zip file goes to your Custom Script folder or where ever you save you custom scripts. The BOTData.xml goes in you Data folder, this will allow you to see the location in game if you dont place BOTData.xml in the Data folder it wont show the location in game.
*After you do this simply save & restart your sever.

Extras:
*To hide locations from your players simply open you BOTData.xml and and where it says gm= "false"; change it to gm = "true" so it will look something like this
Code:
<category title="GM Spots" map="Felucca" hue="1000" gm="true">

*To have the book appear in a players backpack when they logg in into the shard with a new player simply add this code to you CharacterCreation.cs
Code:
PackItem( new BookOfTraveling.BookOfTraveling( ) );

*Since i have added Ilsh & Khaldun locations to this version you will need to modify your SpellHelper.cs so you are able to recall to that area. Its very straight foward to modify. SpellHelper.cs is located in RunUO/Scripts/Spells/Base
After you open it around line 460 you will find this
Code:
private static bool[,] m_Rules = new bool[,]
 			{
 		    		/*T2A(Fel)    	Ilshenar	    Wind(Tram),	Wind(Fel),    Dungeons(Fel),	Solen(Tram),    Solen(Fel), CrystalCave(Malas),    Gauntlet(Malas),	Gauntlet(Ferry),    Stronghold */
 /* Recall From */	{ false,    	true,	    	true,	    false,		false,    		true,    		false,    	false,	    		false,    		    false,		    	true },
 /* Recall To */		{ false,		false,    		false,    	false,	    false,		    false,		    false,		false,    		    false,		    	false,	    		false },
 /* Gate From */		{ false,		false,    		false,    	false,	    false,		    false,		    false,		false,    		    false,		    	false,	    		false },
 /* Gate To */		{ false,		false,    		false,    	false,	    false,		    false,		    false,		false,    		    false,		    	false,	    		false },
 /* Mark In */		{ false,		false,    		false,    	false,	    false,		    false,		    false,		false,    		    false,		    	false,	    		false },
 /* Tele From */		{ true,		    true,		    true,		true,    	true,	    	true,	    	true,	    false,		    	true,	    		true,    			false },
 /* Tele To */		{ true,		    true,		    true,		true,    	true,	    	true,	    	true,	    false,		    	true,	    		false,    			false },
 			};
change it to
Code:
		private static bool[,] m_Rules = new bool[,]
 			{
 		    		/*T2A(Fel)    	Ilshenar	    Wind(Tram),	Wind(Fel),    Dungeons(Fel),	Solen(Tram),    Solen(Fel), CrystalCave(Malas),    Gauntlet(Malas),	Gauntlet(Ferry),    Stronghold */
 /* Recall From */	{ true,    		true,    		true,    	false,	    false,		    true,		    false,		false,    		    false,		    	false,	    		true },
 /* Recall To */		{ true,		    true,		    false,		false,    	false,	    	false,	    	false,	    false,		    	false,	    		false,    			false },
 /* Gate From */		{ false,		false,    		false,    	false,	    false,		    false,		    false,		false,    		    false,		    	false,	    		false },
 /* Gate To */		{ false,		false,    		false,    	false,	    false,		    false,		    false,		false,    		    false,		    	false,	    		false },
 /* Mark In */		{ true,		    false,		    false,		false,    	false,	    	false,	    	false,	    false,		    	false,	    		false,    			false },
 /* Tele From */		{ true,		    true,		    true,		true,    	true,	    	true,	    	true,	    false,		    	true,	    		true,    			false },
 /* Tele To */		{ true,		    true,		    true,		true,    	true,	    	true,	    	true,	    false,		    	true,	    		false,    			false },
 			};
As you can see i only changed the part from Ilsh which is the second column and only the part that says /* Recall To */ and also the first column which is the T2A which Khaldun falls into that category

FYI:
This is a thank you from DuGrand and myself to all the RunUO Community.
Thanks to LucidNagal for his help in this travel book.
Thanks to everyone that supported this travel book system.
 

Attachments

  • Book of Traveling Ver. 1.zip
    9 KB · Views: 318

Raider

Wanderer
Darkness_PR said:
†D_PR Travel Book Ver 1.1†

Description:
*Complete traveling book that works like a recall spell. So it will follow the same rules as a recal spell. This was done due to the many exploits of the other systems or travel books out there.

*This version of the travel book allows you have hidden location to your players. This was done so staff members have somewhere to have their own locations.

*This travel book allows you to have 16 sections and 16 locations in each section.

*This travel book have the location for all facets Felucca, Trammel, Malas, Ilshennar & Tokuno all can by modify in BOTData.xml

Intallation:
*All the files contained in the zip file goes to your Custom Script folder or where ever you save you custom scripts. The BOTData.xml goes in you Data folder, this will allow you to see the location in game if you dont place BOTData.xml in the Data folder it wont show the location in game.
*After you do this simply save & restart your sever.

Extras:
*To hide locations from your players simply open you BOTData.xml and and where it says gm= "false"; change it to gm = "true" so it will look something like this
Code:
<category title="GM Spots" map="Felucca" hue="1000" gm="true">

*To have the book appear in a players backpack when they logg in into the shard with a new player simply add this code to you CharacterCreation.cs
Code:
PackItem( new BookOfTraveling.BookOfTraveling( ) );

*Since i have added Ilsh & Khaldun locations to this version you will need to modify your SpellHelper.cs so you are able to recall to that area. Its very straight foward to modify. SpellHelper.cs is located in RunUO/Scripts/Spells/Base
After you open it around line 460 you will find this
Code:
private static bool[,] m_Rules = new bool[,]
 			{
 		    		/*T2A(Fel)    	Ilshenar	    Wind(Tram),	Wind(Fel),    Dungeons(Fel),	Solen(Tram),    Solen(Fel), CrystalCave(Malas),    Gauntlet(Malas),	Gauntlet(Ferry),    Stronghold */
 /* Recall From */	{ false,    	true,	    	true,	    false,		false,    		true,    		false,    	false,	    		false,    		    false,		    	true },
 /* Recall To */		{ false,		false,    		false,    	false,	    false,		    false,		    false,		false,    		    false,		    	false,	    		false },
 /* Gate From */		{ false,		false,    		false,    	false,	    false,		    false,		    false,		false,    		    false,		    	false,	    		false },
 /* Gate To */		{ false,		false,    		false,    	false,	    false,		    false,		    false,		false,    		    false,		    	false,	    		false },
 /* Mark In */		{ false,		false,    		false,    	false,	    false,		    false,		    false,		false,    		    false,		    	false,	    		false },
 /* Tele From */		{ true,		    true,		    true,		true,    	true,	    	true,	    	true,	    false,		    	true,	    		true,    			false },
 /* Tele To */		{ true,		    true,		    true,		true,    	true,	    	true,	    	true,	    false,		    	true,	    		false,    			false },
 			};
change it to
Code:
		private static bool[,] m_Rules = new bool[,]
 			{
 		    		/*T2A(Fel)    	Ilshenar	    Wind(Tram),	Wind(Fel),    Dungeons(Fel),	Solen(Tram),    Solen(Fel), CrystalCave(Malas),    Gauntlet(Malas),	Gauntlet(Ferry),    Stronghold */
 /* Recall From */	{ true,    		true,    		true,    	false,	    false,		    true,		    false,		false,    		    false,		    	false,	    		true },
 /* Recall To */		{ true,		    true,		    false,		false,    	false,	    	false,	    	false,	    false,		    	false,	    		false,    			false },
 /* Gate From */		{ false,		false,    		false,    	false,	    false,		    false,		    false,		false,    		    false,		    	false,	    		false },
 /* Gate To */		{ false,		false,    		false,    	false,	    false,		    false,		    false,		false,    		    false,		    	false,	    		false },
 /* Mark In */		{ true,		    false,		    false,		false,    	false,	    	false,	    	false,	    false,		    	false,	    		false,    			false },
 /* Tele From */		{ true,		    true,		    true,		true,    	true,	    	true,	    	true,	    false,		    	true,	    		true,    			false },
 /* Tele To */		{ true,		    true,		    true,		true,    	true,	    	true,	    	true,	    false,		    	true,	    		false,    			false },
 			};
As you can see i only changed the part from Ilsh which is the second column and only the part that says /* Recall To */ and also the first column which is the T2A which Khaldun falls into that category

FYI:
This is a thank you from DuGrand and myself to all the RunUO Community.
Thanks to LucidNagal for his help in this travel book.
Thanks to everyone that supported this travel book system.
question tho since i am only letting my admins and gm use this book not players if i edited spell helper wouldnt that allow the regular players recall to those place in a regular rune book
 

Darkness_PR

Wanderer
Raider said:
question tho since i am only letting my admins and gm use this book not players if i edited spell helper wouldnt that allow the regular players recall to those place in a regular rune book
yes it would allow players to do it...
 

Raider

Wanderer
I get 2 errors wont complie this is the error
Code:
failed (2 errors, 22 warnings)
 - Warning: Scripts\CustomScripts\Book of Traveling Ver. 1.1\BookOfTraveling.cs:
 CS0108: (line 25, column 31) The keyword new is required on 'BookOfTraveling.Bo
okOfTraveling.Weight' because it hides inherited member 'Server.Item.Weight'
 - Error: Scripts\CustomScripts\Book of Traveling Ver. 1.1\BookOfTraveling.cs: C
S0198: (line 39, column 4) A static readonly field cannot be assigned to (except
 in a static constructor or a variable initializer)
 - Error: Scripts\CustomScripts\Book of Traveling Ver. 1.1\BookOfTraveling.cs: C
Also if you try to add this on your banker to sell it reads this error too
Code:
 - Error: Scripts\Mobiles\Vendors\SBInfo\SBBanker.cs: CS0118: (line 29, column 5
8) 'BookOfTraveling' denotes a 'namespace' where a 'class' was expected
Any idea whats wrong here Thank you:(
 

Erica

Knight
Found a small error on BOTDataxml for trammel it shouldnt be Ocllo in trammel its Haven and felucca is Ocllo so trammel has wrong name .Also i am still getting the errors i posted on top.
 

dracana

Sorceror
Raider said:
I get 2 errors wont complie this is the error
Code:
failed (2 errors, 22 warnings)
 - Warning: Scripts\CustomScripts\Book of Traveling Ver. 1.1\BookOfTraveling.cs:
 CS0108: (line 25, column 31) The keyword new is required on 'BookOfTraveling.Bo
okOfTraveling.Weight' because it hides inherited member 'Server.Item.Weight'
 - Error: Scripts\CustomScripts\Book of Traveling Ver. 1.1\BookOfTraveling.cs: C
S0198: (line 39, column 4) A static readonly field cannot be assigned to (except
 in a static constructor or a variable initializer)
 - Error: Scripts\CustomScripts\Book of Traveling Ver. 1.1\BookOfTraveling.cs: C
Also if you try to add this on your banker to sell it reads this error too
Code:
 - Error: Scripts\Mobiles\Vendors\SBInfo\SBBanker.cs: CS0118: (line 29, column 5
8) 'BookOfTraveling' denotes a 'namespace' where a 'class' was expected
Any idea whats wrong here Thank you:(

I had this issue as well and fixed it by changing the following in BookOfTraveling.cs...

1. Change "Weight" on line 25 to "OverWeight"
2. Change "( Weight != True )" at the end of line 99 to "( OverWeight != True )"
3. Save BookOfTraveling.cs and restart server.

The lines should look like this after changed...
25: public static readonly bool OverWeight = false;//Change to true to allow travel while over weight.

99: else if ( Server.Misc.WeightOverloading.IsOverloaded( from ) && ( OverWeight != true ) )

For the second error, how did you add to banker... post code.
 

dracana

Sorceror
Erica said:
Found a small error on BOTDataxml for trammel it shouldnt be Ocllo in trammel its Haven and felucca is Ocllo so trammel has wrong name .Also i am still getting the errors i posted on top.

Yes and I noticed that the coords for Fire Entrance are incorrect and there is no Minoc in the Trammel cities section... I changed the following in my BOTData.xml

Under Trammel Cities...
Add <location name="Minoc" x="2496" y="563" z="0" />

Under Trammel Dungeons...
change <location name="Fire Entrance" x="5211" y="2323" z="32" />
to <location name="Fire Entrance" x="5760" y="2908" z="15" />

Also, there are two Ice entries in Trammel Dungeons...
<location name="Ice Entrance" x="1999" y="81" z="4" />
<location name="Ice Brit Entrance" x="1999" y="81" z="4" />
I removed the "Ice Brit Entrance" from mine.

Besides that, great script D_Pr! I love it and it has made life so easy on my shard:)
 

Erica

Knight
dracana said:
I had this issue as well and fixed it by changing the following in BookOfTraveling.cs...

1. Change "Weight" on line 25 to "OverWeight"
2. Change "( Weight != True )" at the end of line 99 to "( OverWeight != True )"
3. Save BookOfTraveling.cs and restart server.

The lines should look like this after changed...
25: public static readonly bool OverWeight = false;//Change to true to allow travel while over weight.

99: else if ( Server.Misc.WeightOverloading.IsOverloaded( from ) && ( OverWeight != true ) )

For the second error, how did you add to banker... post code.
Thanks for the posting fix works now.
 

Erica

Knight
dracana said:
Yes and I noticed that the coords for Fire Entrance are incorrect and there is no Minoc in the Trammel cities section... I changed the following in my BOTData.xml

Under Trammel Cities...
Add <location name="Minoc" x="2496" y="563" z="0" />

Under Trammel Dungeons...
change <location name="Fire Entrance" x="5211" y="2323" z="32" />
to <location name="Fire Entrance" x="5760" y="2908" z="15" />

Also, there are two Ice entries in Trammel Dungeons...
<location name="Ice Entrance" x="1999" y="81" z="4" />
<location name="Ice Brit Entrance" x="1999" y="81" z="4" />
I removed the "Ice Brit Entrance" from mine.

Besides that, great script D_Pr! I love it and it has made life so easy on my shard:)
Also Gargoyle city is wrong on entrance its backwards the ancient Citadel is set for gargolye city and gargoyle city it set for ancient citadel so just change those 2 destination. Also dracana have any idea how i can put this book on bankers cause i get this error wont complie. have any idea if so please show me how this can be added to a banker for players to buy off bankers thanks. Heres Error i get when trying to add to banker
Code:
 - Error: Scripts\Mobiles\Vendors\SBInfo\SBBanker.cs: CS0118: (line 29, column 5
8) 'BookOfTraveling' denotes a 'namespace' where a 'class' was expected
 

Erica

Knight
X-SirSly-X said:
at the top section of the banker, add this line of code:


Code:
using BookOfTraveling;

:)
if you mean SBBanker.cs Script tryed get same errors
Code:
using System;
using System.Collections;
using Server.Items;
using BookOfTraveling;
namespace Server.Mobiles
{
	public class SBBanker : SBInfo
	{
		private ArrayList m_BuyInfo = new InternalBuyInfo();
		private IShopSellInfo m_SellInfo = new InternalSellInfo();

		public SBBanker()
		{
		}

		public override IShopSellInfo SellInfo { get { return m_SellInfo; } }
		public override ArrayList BuyInfo { get { return m_BuyInfo; } }

		public class InternalBuyInfo : ArrayList
		{
			public InternalBuyInfo()
			{
				Add( new GenericBuyInfo( "1047016", typeof( CommodityDeed ), 5, 20, 0x14F0, 0x47 ) );
				Add( new GenericBuyInfo( "1041243", typeof( ContractOfEmployment ), 1252, 20, 0x14F0, 0 ) );

				if ( Multis.BaseHouse.NewVendorSystem )
					Add( new GenericBuyInfo( "1062332", typeof( VendorRentalContract ), 1252, 20, 0x14F0, 0x672 ) );
			}
		}

		public class InternalSellInfo : GenericSellInfo
		{
			public InternalSellInfo()
			{
			}
		}
	}
}
 

Erica

Knight
X-SirSly-X said:
post your entire code please.
hope thats what you meant i edited my post on top if thats not what your asking me tell me what code you want me to post.
 

Erica

Knight
X-SirSly-X said:
i dont see the travel book being listed.
its here posted wrong one but get the error with this one
Code:
using System;
using System.Collections;
using Server.Items;
using BookOfTraveling;
namespace Server.Mobiles
{
	public class SBBanker : SBInfo
	{
		private ArrayList m_BuyInfo = new InternalBuyInfo();
		private IShopSellInfo m_SellInfo = new InternalSellInfo();

		public SBBanker()
		{
		}

		public override IShopSellInfo SellInfo { get { return m_SellInfo; } }
		public override ArrayList BuyInfo { get { return m_BuyInfo; } }

		public class InternalBuyInfo : ArrayList
		{
			public InternalBuyInfo()
			{
				Add( new GenericBuyInfo( "1047016", typeof( CommodityDeed ), 5, 20, 0x14F0, 0x47 ) );
				Add( new GenericBuyInfo( "1041243", typeof( ContractOfEmployment ), 1252, 20, 0x14F0, 0 ) );
                        Add( new GenericBuyInfo( typeof( BookOfTraveling ), 65000, 20, 0x22C5, 0 ) );

				if ( Multis.BaseHouse.NewVendorSystem )
					Add( new GenericBuyInfo( "1062332", typeof( VendorRentalContract ), 1252, 20, 0x14F0, 0x672 ) );
			}
		}

		public class InternalSellInfo : GenericSellInfo
		{
			public InternalSellInfo()
			{
			}
		}
	}
}
and this is the book of traveling script
Code:
using System;
using System.Collections;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Multis;
using System.IO;
using System.Xml;
//using Server.Factions;
	
namespace BookOfTraveling
{
	public class BookOfTraveling : Item , ISecurable
	{
		private static ArrayList m_Locations = new ArrayList();
		private static ArrayList m_Categories = new ArrayList();
		private SecureLevel m_Level;
		public static readonly bool Sigil = false;//Change to true to allow travel 
		public static readonly bool Felucca = false;//Change to true to allow travel from this facets dungeons.
		public static readonly bool Trammel = false;//Change to true to allow travel from this facets dungeons.
		public static readonly bool Ilshenar = false;//Change to true to allow travel from this facets dungeons.
		public static readonly bool Malas = false;//Change to true to allow travel from this facets dungeons.
		public static readonly bool Criminal = false;//Change to true to allow travel while criminal.
		public static readonly bool Combat = false;//Change to true to allow travel while engaged in combat.
		public static readonly bool OverWeight = false;//Change to true to allow travel while over weight.

		
		[CommandProperty( AccessLevel.GameMaster )]
		public SecureLevel Level
		{
			get{ return m_Level; }
			set{ m_Level = value; }
		}
		
		[Constructable]
		public BookOfTraveling() : base( 0x22C5 )
		{	
			Name = "book of traveling";
			//Weight = 3.0;
			LootType = LootType.Blessed;
			m_Level = SecureLevel.CoOwners;
		}
		
		public static void FillBookLocation( string description, int x, int y, int z, Map map, string title, int hue, bool gm )
		{	
				m_Locations.Add( new BookOfTravelingLocation( new Point3D( x, y, z ), map, description, title, hue, gm ) );
		}
		
		public static void FillBookCategory( Map map, string title, int hue, bool gm )
		{	
				m_Categories.Add( new BookOfTravelingCategory( map, title, hue, gm ) );
		}
		
		public ArrayList Locations
		{
			get{ return m_Locations; }
		}
		
		public ArrayList Categories
		{
			get{ return m_Categories; }
		}

		public override void OnDoubleClick( Mobile from )
		{
			/*if ( from.InRange( GetWorldLocation(), 1 ) )
			{
				from.CloseGump( typeof( BookOfTravelingGump ) );
				from.SendGump( new BookOfTravelingGump( from, m_Categories, m_Locations, this  ) );
			}*/
         		if ( from.Region is Server.Regions.Jail )
         		{
                  	from.SendLocalizedMessage( 1041530, "", 0x35 ); // You'll need a better jailbreak plan then that!
         		}
         		else if ( from.Region is Server.Regions.FeluccaDungeon && ( Felucca != true ) )
         		{
            		from.SendMessage( "You cannot use this book here" );
         		}
         		else if ( from.Region is Server.Regions.TrammelDungeon && ( Trammel != true ) )
         		{
            		from.SendMessage( "You cannot use this book here" );
         		}
         		else if ( from.Region is Server.Regions.MalasDungeon && ( Malas != true ) )
         		{
            		from.SendMessage( "You cannot use this book here" );
         		}
         		else if ( from.Region is Server.Regions.IlshenarDungeon && ( Ilshenar != true ) )
         		{
              		from.SendMessage( "You cannot use this book here." );
         		}
         		else if ( from.Criminal && ( Criminal != true ) )
         		{
            		from.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
         		}
         		else if ( BookOfTraveling.CheckCombat( from ) && ( Combat != true ) )
         		{
            		from.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
         		}
         		else if ( Server.Misc.WeightOverloading.IsOverloaded( from ) && ( OverWeight != true ) )
         		{
            		from.SendLocalizedMessage( 502359, "", 0x22 ); // Thou art too encumbered to move.
         		}
				else if ( Server.Factions.Sigil.ExistsOn( from ) )//else if ( Factions.Sigil.ExistsOn( from )  && ( Sigil != true ) )
				{
					from.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
				}
				else
         		{
 					if ( IsChildOf( from.Backpack ) )
					{
						from.CloseGump( typeof( BookOfTravelingGump ) );
						from.SendGump( new BookOfTravelingGump( from, m_Categories, m_Locations, this  ) );
					}
                	else 
					{
                       	from.SendMessage( "This must be in your pack to use" ); // This must be in your pack to use.     
					}
				}
      		}
      		private static TimeSpan CombatHeatDelay = TimeSpan.FromSeconds( 60.0 );
      		private static bool RestrictTravelCombat = true;

      		public static bool CheckCombat( Mobile from )
      		{
         		if ( !RestrictTravelCombat )
            		return false;

         		for ( int i = 0; i < from.Aggressed.Count; ++i )
         	{
            		AggressorInfo info = (AggressorInfo)from.Aggressed[i];

            		if ( info.Defender.Player && (DateTime.Now - info.LastCombatTime) < CombatHeatDelay )
               		return true;
         	}

         	return false;
      	} 
	//}

		public bool CheckAccess( Mobile m )
		{
			if ( !IsLockedDown || m.AccessLevel >= AccessLevel.GameMaster )
				return true;

			BaseHouse house = BaseHouse.FindHouseAt( this );

			if ( house != null && house.IsAosRules && (house.Public ? house.IsBanned( m ) : !house.HasAccess( m )) )
				return false;

			return ( house != null && house.HasSecureAccess( m, m_Level ) );
		}
		
		public BookOfTraveling( Serial serial ) : base( serial )
		{
		}
		
		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
			writer.Write( (int) m_Level );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
			m_Level = (SecureLevel)reader.ReadInt();
		}
	}

	public class BookOfTravelingCategory
	{
		private Map m_Map;
		private string m_Category;
		private int m_Hue;
		private bool m_Gm;
		
		public Map Map
		{
			get{ return m_Map; }
		}
		
		public string Category
		{
			get{ return m_Category; }
		}
		
		public int Hue
		{
			get{ return m_Hue; }
		}
		
		public bool Gm
		{
			get{ return m_Gm; }
		}

		public BookOfTravelingCategory( Map map, string category, int hue, bool gm )
		{
			m_Map = map;
			m_Category = category;
			m_Hue = hue;
			m_Gm = gm;
		}

		public BookOfTravelingCategory( GenericReader reader )
		{
		}

		public void Serialize( GenericWriter writer )
		{
		}
	}
	
	public class BookOfTravelingLocation
	{
		private Point3D m_Location;
		private Map m_Map;
		private string m_Description;
		private string m_Category;
		private int m_Hue;
		private bool m_Gm;

		public Point3D Location
		{
			get{ return m_Location; }
		}

		public Map Map
		{
			get{ return m_Map; }
		}

		public string Description
		{
			get{ return m_Description; }
		}
		
		public string Category
		{
			get{ return m_Category; }
		}
		
		public int Hue
		{
			get{ return m_Hue; }
		}
		
		public bool Gm
		{
			get{ return m_Gm; }
		}

		public BookOfTravelingLocation( Point3D location, Map map, string description, string category, int hue, bool gm )
		{
			m_Location = location;
			m_Map = map;
			m_Description = description;
			m_Category = category;
			m_Hue = hue;
			m_Gm = gm;
		}

		public BookOfTravelingLocation( GenericReader reader )
		{
		}

		public void Serialize( GenericWriter writer )
		{

		}
	}

	public class BOTData
	{
		public static void Configure()
		{
			EventSink.WorldLoad += new WorldLoadEventHandler( OnLoad );
		}
		
		private static void OnLoad()
		{
			string filePath = Path.Combine( "data", "botdata.xml" );

			if ( !File.Exists( filePath ) )
				return;

			try
			{
				XmlDocument doc = new XmlDocument();
				doc.Load( filePath );
	
				XmlElement node = doc["botdata"];
				
				foreach( XmlElement xe in node.GetElementsByTagName( "category" ) )
				{
					string title = xe.GetAttribute( "title" );
					string smap = xe.GetAttribute( "map" );
					int hue = XmlConvert.ToInt32( xe.GetAttribute( "hue" ) );
					bool gm = XmlConvert.ToBoolean(xe.GetAttribute( "gm" ) );
					Map map = null;
					
					map = Map.Parse( smap );
						
					BookOfTraveling.FillBookCategory( map, title, hue, gm );
					
					Load( xe, map, title, hue, gm );
				}
			}
			catch( Exception e )
			{ 
				Console.WriteLine( "Warning: Exception caught:" );
				Console.WriteLine( e );
			}
		}
		
		public static void Load( XmlElement node, Map map, string title, int hue, bool gm )
		{
			try
			{	
				foreach ( XmlElement xe in node.GetElementsByTagName( "location" ) )
				{	
					string name = xe.GetAttribute( "name" );						
					int x = XmlConvert.ToInt32( xe.GetAttribute( "x" ) );
					int y = XmlConvert.ToInt32( xe.GetAttribute( "y" ) );
					int z = XmlConvert.ToInt32( xe.GetAttribute( "z" ) );
					
					BookOfTraveling.FillBookLocation( name, x, y, z, map, title, hue, gm );
				}		
			}
			catch( Exception e )
			{ 
				Console.WriteLine( "Warning: Exception caught:" );
				Console.WriteLine( e );
			}
		}
	}
}
As you can see i tryed it and still get this error
Code:
 - Error: Scripts\Mobiles\Vendors\SBInfo\SBBanker.cs: CS0118: (line 29, column 5
8) 'BookOfTraveling' denotes a 'namespace' where a 'class' was expected
 

X-SirSly-X

Sorceror
doh forgot to explain the other part of the problem.... ok the issue with this script is that the namespace:

Code:
namespace BookOfTraveling
{
and item:
Code:
	public class BookOfTraveling : Item , ISecurable
	{

both have the same name. So just change the name of the item to this:

Code:
BookOfTravelingBook

And remember to change every refference to the book to that as well in the other scripts.

Or you could change the namespace to something different as well.

Which explains the error you got:

Code:
 - Error: Scripts\Mobiles\Vendors\SBInfo\SBBanker.cs: CS0118: (line 29, column 5
8) 'BookOfTraveling' denotes a 'namespace' where a 'class' was expected

the runuo engine looks for namespaces (groupings of objects) first, and then the actual class ( objects & items) second.

so basically it was trying to load the name namespace on the banker instead of the item.


Code:
        Add( new GenericBuyInfo( "Book of Traveling", typeof( BookOfTravelingBook ), 65000, 20, 0x22C5, 0 ) );

hope that helps!

-Sly
 

Erica

Knight
X-SirSly-X said:
doh forgot to explain the other part of the problem.... ok the issue with this script is that the namespace:

Code:
namespace BookOfTraveling
{
and item:
Code:
	public class BookOfTraveling : Item , ISecurable
	{

both have the same name. So just change the name of the item to this:

Code:
BookOfTravelingBook

And remember to change every refference to the book to that as well in the other scripts.

Or you could change the namespace to something different as well.

Which explains the error you got:

Code:
 - Error: Scripts\Mobiles\Vendors\SBInfo\SBBanker.cs: CS0118: (line 29, column 5
8) 'BookOfTraveling' denotes a 'namespace' where a 'class' was expected

the runuo engine looks for namespaces (groupings of objects) first, and then the actual class ( objects & items) second.

so basically it was trying to load the name namespace on the banker instead of the item.


Code:
        Add( new GenericBuyInfo( "Book of Traveling", typeof( BookOfTravelingBook ), 65000, 20, 0x22C5, 0 ) );

hope that helps!

-Sly
Ahh i see what you mean i changed the 3 scripts from traveling books was namespace BookOfTraveling changed it to namespace Server.Items on the 3 scripts that said namespace BookOfTraveling and now it works tryed on my test shard first only one problem tho which is going to be a pain in the butt it ask to delete before compling so meaning is going to take me a long time to replace those books to the ones that had it .
 

X-SirSly-X

Sorceror
eh, not really, keep the old book & system the way you have it, and make a new bookoftraveling system, now in the old book (the actual item) add something like this:

Code:
    public override void OnDoubleClick( Mobile from )
    {
			PlayerMobile mobile = from as PlayerMobile;
			
			
			mobile.AddToBackpack( new BookOfTraveling02() );
			mobile.SendMessage("Here is the new travel book!");
			this.Delete(); 
		}

that will delete the old one, and give them a new one, just run it like this for a month or so, and that will get the old items removed. Then just delete the old BOT files, it will still pop up asking to delete, but it wont be bad.
 

Icon

Wanderer
Ahh the book does not take regents to cast? cause its not checking to see if have any on me and i can recall /use it without any on me..


Hk
 
Top