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!

A_Li_N - Completely Custom {Alpha}

A_Li_N

Knight
I haven't tried compiling it on 2.0 yet, simply because I haven't had time. Bought a house and have been, literally, working on it for the entire week, about 12-14 hours a day. Oi.

As for it working with 2.0, I don't see any reason it wouldn't work with the server in and of itself, but it might have some problems when ran on .net 2.0.

When I have time, I will be working on this system (mixing the time with a program I'm working on for my business) and getting it to run more efficiently and revamping how the gump code works. I'll also be 'mingling' the CM and ACC into one system, as they pretty much do the same thing and nearly all my systems use the CM to some extent. Also, I will be following through with my plan on scrapping the spell system in exchange for something all of my own making. This will take time, but once I get a working base ACC/CM, I will be removing this one and dropping most support. The new system will only run on 2.0. Sorry for any inconvenience this may cause everyone.

Again, this is going to take quite a bit of time, as my life has taken a big change and I have a lot of work to do to get back to being 'comfortable' enough to have leisure to script.
 

Pyro-Tech

Knight
Just so people have it....here is the errors you get from compiling this version as is:

Code:
 + Custom/New Scripts/Systems/A_Li_N - Completely Custom - 06-05-28 - 1851/Compl
ete Spell System/-=+ 01 Core/CSpellbook.cs:
    CS0234: Line 8: The type or namespace name 'Scripts' does not exist in the n
amespace 'Server' (are you missing an assembly reference?)
    CS0246: Line 21: The type or namespace name 'CommandEventArgs' could not be
found (are you missing a using directive or an assembly reference?)
 + Custom/New Scripts/Systems/A_Li_N - Completely Custom - 06-05-28 - 1851/Publi
c Gates/PGSystem.cs:
    CS0246: Line 53: The type or namespace name 'CommandEventArgs' could not be
found (are you missing a using directive or an assembly reference?)
    CS0246: Line 63: The type or namespace name 'CommandEventArgs' could not be
found (are you missing a using directive or an assembly reference?)
 + Custom/New Scripts/Systems/A_Li_N - Completely Custom - 06-05-28 - 1851/ACCGu
mp.cs:
    CS0246: Line 18: The type or namespace name 'CommandEventArgs' could not be
found (are you missing a using directive or an assembly reference?)

there are some which may be able to be fixed as there is an faq about the command thing....and lucid's as of this posting compiles, but won't bring up any of the gumps so.....
 

dutch331

Wanderer
crash

I like this script alot but I got this crash error twice 2 hrs apart in the middle of the night with nobody on the shard. Can you help with what it means? Not sure what corrupt memory is for this script or how to fix it?
 

dutch331

Wanderer
sorry

I'm sorry I can't believe I forgot that. I was running late for work and was trying to hurry. Here is the error report

Code:
Server Crash Report
===================

RunUO Version 2.0, Build 2357.32527
Operating System: Microsoft Windows NT 5.0.2195 Service Pack 4
.NET Framework: 2.0.50727.42
Time: 6/26/2006 2:36:22 AM
Mobiles: 5572
Items: 105689
Clients:
- Count: 0

Exception:
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at Server.Mobiles.PremiumSpawner.InternalTimer.OnTick()
   at Server.Timer.Slice()
   at Server.Core.Main(String[] args)
 
dutch331

#146
06-26-2006, 06:57 PM
dutch331
vbmenu_register("postmenu_535432", true);
Neophyte
Join Date: Sep 2004
Age: 48
Posts: 31
Rep Power: 0



sorry
I'm sorry I can't believe I forgot that. I was running late for work and was trying to hurry. Here is the error report

Code:
Server Crash Report===================RunUO Version 2.0, Build 2357.32527Operating System: Microsoft Windows NT 5.0.2195 Service Pack 4.NET Framework: 2.0.50727.42Time: 6/26/2006 2:36:22 AMMobiles: 5572Items: 105689Clients:- Count: 0Exception:System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at Server.Mobiles.PremiumSpawner.InternalTimer.OnTick() at Server.Timer.Slice() at Server.Core.Main(String[] args)​
That crash isn't from Alien's system.
 

A_Li_N

Knight
Code:
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at Server.Mobiles.[b]PremiumSpawner[/b].InternalTimer.OnTick()
   at Server.Timer.Slice()
   at Server.Core.Main(String[] args)
:)
 

VertiCody

Sorceror
Hey, this is the only error I'm getting, i've fixed the rest real good, and I couldn't find the fix...

Code:
Errors:
 + customs/New/Complete Spell System/-=+ 01 Core/CSpellbook.cs:
    CS0246: Line 21: The type or namespace name 'CommandEventArgs' could not be
found (are you missing a using directive or an assembly reference?)


Thank you if you can help me...

Vert

EDIT: God I'm a dummy, here's the script...

Code:
using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Network;
using Server.Spells;
using Server.Targeting;
using Server.Scripts.Commands;

namespace Server.ACC.CSS
{
	public class CSpellbook : Item
	{
		public static void Initialize()
		{
			Commands.Register( "FillBook", AccessLevel.GameMaster, new CommandEventHandler( FillBook_OnCommand ) );
		}

		[Usage( "FillBook" )]
		[Description( "Completely fills a targeted spellbook with scrolls." )]
		[COLOR="Red"]private static void FillBook_OnCommand( CommandEventArgs e )[/COLOR]		{
			e.Mobile.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( FillBook_OnTarget ) );
			e.Mobile.SendMessage( "Target the spellbook to fill." );
		}

		private static void FillBook_OnTarget( Mobile from, object obj )
		{
			if ( obj is CSpellbook )
			{
				CSpellbook book = (CSpellbook)obj;

				if( book == null || book.Deleted )
					return;

				book.Fill();
				book.Full = true;

				from.SendMessage( "The spellbook has been filled." );

				CommandLogging.WriteLine( from, "{0} {1} filling spellbook {2}", from.AccessLevel, CommandLogging.Format( from ), CommandLogging.Format( book ) );
			}
			else
			{
				from.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( FillBook_OnTarget ) );
				from.SendMessage( "That is not a spellbook. Try again." );
			}
		}

		public override bool AllowEquipedCast( Mobile from ){ return true; }
		public override bool DisplayLootType { get{ return false; } }

		public virtual School School{ get{ return School.Invalid; } }
		public virtual ArrayList SchoolSpells{ get{ return SpellInfoRegistry.GetSpellsForSchool( this.School ); } }
		public virtual int BookCount{ get{ return SchoolSpells.Count; } }

		private ulong m_Content;
		private int   m_Count;
		private bool  m_Full;
		private int   m_Mark = 0;

		[CommandProperty( AccessLevel.GameMaster )]
		public int SpellCount{ get{ return m_Count; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public ulong Content
		{
			get{ return m_Content; }
			set
			{
				if ( m_Content != value )
				{
					m_Content = value;

					m_Count = 0;

					while ( value > 0 )
					{
						m_Count += (int)(value & 0x1);
						value >>= 1;
					}

					InvalidateProperties();
				}
			}
		}

		//public int Mark{ get{ return m_Mark; } set{ m_Mark = value; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public bool Full{ get{ return m_Full; } set{ m_Full = value; } }

		public CSpellbook() : this( (ulong)0, CSSettings.FullSpellbooks )
		{
		}

		public CSpellbook( bool full ) : this( (ulong)0, full )
		{
		}

		public CSpellbook( ulong content, bool full ) : this( content, 0xEFA, full )
		{
		}

		public CSpellbook( ulong content, int itemID, bool full ) : base( itemID )
		{
			Name = "Arcane Tome";

			Weight = 3.0;
			Layer = Layer.OneHanded;
			LootType = LootType.Blessed;

			Content = content;

			if( full )
				Fill();
		}

		public CSpellbook( Serial serial ) : base( serial )
		{
		}

		public void Fill()
		{
			m_Full = true;

			if( this.BookCount == 64 )
				this.Content = ulong.MaxValue;
			else
				this.Content = (1ul << this.BookCount) - 1;
		}

		public bool AddSpell( Type type )
		{
			if( !SchoolSpells.Contains( type ) )
				return false;

			m_Content |= (ulong)1 << SchoolSpells.IndexOf( type );
			++m_Count;

			InvalidateProperties();
			return true;
		}

		public bool HasSpell( Type type )
		{
			if( SchoolSpells.Contains( type ) && SpellInfoRegistry.CheckRegistry( this.School, type ) )
				return( (m_Content & ((ulong)1 << SchoolSpells.IndexOf( type ))) != 0 );

			return false;
		}

		public static bool MobileHasSpell( Mobile m, School school, Type type )
		{
			if( m == null || m.Deleted || m.Backpack == null || school == School.Invalid || type == null )
				return false;

			foreach( Item i in m.Backpack.Items )
			{
				if( i is CSpellbook )
				{
					CSpellbook book = (CSpellbook)i;
					if( book.School == school && book.HasSpell( type ) )
						return true;
				}
			}
			return false;
		}

		public override void GetProperties( ObjectPropertyList list )
		{
			base.GetProperties( list );
			list.Add( 1042886, m_Count.ToString() ); // ~1_NUMBERS_OF_SPELLS~ Spells
		}

		public override void OnSingleClick( Mobile from )
		{
			base.OnSingleClick( from );
			this.LabelTo( from, 1042886, m_Count.ToString() );
		}

		public override bool OnDragDrop( Mobile from, Item dropped )
		{
			if ( dropped is CSpellScroll && dropped.Amount == 1 )
			{
				CSpellScroll scroll = (CSpellScroll)dropped;

				if ( !SchoolSpells.Contains( scroll.SpellType ) )
				{
					return false;
				}
				else if ( HasSpell( scroll.SpellType ) )
				{
					from.SendLocalizedMessage( 500179 ); // That spell is already present in that spellbook.
					return false;
				}
				else
				{
					AddSpell( scroll.SpellType );
					scroll.Delete();

					from.Send( new PlaySound( 0x249, GetWorldLocation() ) );
					return true;
				}
			}
			else if( dropped is SpellScroll && dropped.Amount == 1 )
			{
				SpellScroll scroll = (SpellScroll)dropped;

				Type type = SpellRegistry.Types[ scroll.SpellID ];

				if ( !SchoolSpells.Contains( type ) )
				{
					return false;
				}
				else if ( HasSpell( type ) )
				{
					from.SendLocalizedMessage( 500179 ); // That spell is already present in that spellbook.
					return false;
				}
				else
				{
					AddSpell( type );
					scroll.Delete();

					from.Send( new PlaySound( 0x249, GetWorldLocation() ) );
					return true;
				}
			}
			else
			{
				return false;
			}
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version

			writer.Write( m_Full );
			writer.Write( m_Content );
			writer.Write( m_Count );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			LootType = LootType.Blessed;

			int version = reader.ReadInt();

			switch ( version )
			{
				case 0:
				{
					m_Full = reader.ReadBool();
					m_Content = reader.ReadULong();
					m_Count = reader.ReadInt();

					break;
				}
			}
		}
	}
}
 
Top