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!

[RunUO 2.0 RC1] Lucid Nagual's <<_All Spells System_>>

Boulder

Sorceror
classas

licid
how can i make a gate for players that makes sure they pic a class before teleporting from a area
 

facsmth

Wanderer
Okay... I downloaded tortoise. I'll also be sure to make a few backup folders. Funny thing: I set all my skills to 100 and when I tried to cast the chivalry spell Divine Fury, it warned me I needed 45 skill even though I clearly had it set at 100.0. WTH?
 
Boulder

Boulder said:
licid
how can i make a gate for players that makes sure they pic a class before teleporting from a area
OK I made a class moongate. However, it requires an update that I haven't released yet. I will be eliminating all previous modules and combining them into a PlayerModule. My class, race, level and bod systems will use the same module and will become a part of my core. I will also be adding many neat [optional] features. One will be a modification so that the Wedding Script could be used with the PlayerModule. Another example is an optional AFK command, ect. It is important that I add as many features as possible before releasing the module in order to keep the module serialization at zero upon release. We all know that future updates will make the version number climb so it is best to load it with extra serialized properties for expansion.

The Scoop:
I'd also like it to be known that I am working on many fixes. It may seem like I am sitting idle but that is not true. I work a long work week and don't have the time that I used to. Luckily I have advanced a bit with my programming abilities and can script more quickly than normal. Daat has also asked me to take over OWLTR and I plan on making many changes [options] to that system as well. An update to OWLTR from SE to ML will be very difficult. ML have introduced new woods!!! This creates a huge issue. The reward system is built and balanced for the existing wood types. Adding the OSI wood types will cause issues with existing shards that currently use OWLTR. Those shards have the current OWLTR resources. How do I eliminate them and bring in the new wood types? What will those shards do with the existing BODs?

I have also started on a SkillModule for custom skills. I have scripted a CustomSkillCheck and added a basic delay for skill gain to make things harder for those who macro. Once this is complete I will make all the custom spell systems into real skills. I am also going to add a new skill called "Farming" with that system. I have been working on modified versions of Davids Harvest System to be used for farming. I will add more optional features to it and I will also be trimming down the code [which is a big headache]. The first wave of edits have already trimmed down a lot of code.

I have been repairing the Control Center and adding the Login check for the module there. I am also adding a spawning system for the Magics Trainer. The Magics Trainer will spawn in three areas: Central Britain [Felucca & Trammel] and Tokuno [Zento Bank]. The Magics Trainer will give players the opportunity to reselect a class [or skill] in a specific magic [with the option of charging gold]. I will try and add an option to choose between the Magics Trainer or a Class Stone. The Class Stone has been completed and will be part of the AS System. However, if I complete the Custom Skills soon I will eliminate the Class System and these will be used to train in a custom spell [skill].

I am also getting ready to work with a programmer in Canada. We will be tackling the spell icon issues. I hope to mimic a dragable system. I have also started on new spell icons [art] and will need someone to teach me how to work with new art and patching.

So hang in there....most of the work is already complete.

Thanks for letting me ramble. ;)

Edit: Oh BTW I am also working on adding the Crafting Experience Point System to the PlayerModule, too. For those who have requested it. I haven't forgotten.
 

uo_maltese

Wanderer
omg what a lame problem

i've got this lame problem.

When i load the server it runs smoothly... not problems but then when it comes to loading the world i get an error that there is a board and it needs to be deleted... what am i supposed to do about that pls?
 
uo_maltese

uo_maltese said:
i've got this lame problem.

When i load the server it runs smoothly... not problems but then when it comes to loading the world i get an error that there is a board and it needs to be deleted... what am i supposed to do about that pls?
I'm not aware of a board script that comes with this system. Looks like you are blaming the wrong person.
 

Boulder

Sorceror
error

id updated to svn 92
have most errors fix got one left

Code:
RunUO - [www.runuo.com] Version 2.0, Build 2478.36565
Core: Running on .NET Framework Version 2.0.50727
Scripts: Compiling C# scripts...failed (1 errors, 2 warnings)
Warnings:
 + Spells/@@Other Shit/-=+ Full Spellbook +=-/Full Spellbook/TomeOfKnowledge.cs:

    CS0162: Line 589: Unreachable code detected
 + Spells/@@Other Shit/Reagent Book/RegBook.cs:
    CS0162: Line 309: Unreachable code detected
Errors:
 + Spells/Staff/Ultima VII System/SleepingBody.cs:
    CS0161: Line 158: 'Server.Items.SleepingBody.GetWorldPacketFor(Server.Networ
k.NetState)': not all code paths return a value
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.
here is the script
Code:
using System;
using System.Collections;
using Server;
using Server.Engines.PartySystem;
using Server.Misc;
using Server.Guilds;
using Server.Mobiles;
using Server.Network;
using Server.ContextMenus;

namespace Server.Items
{
	public class SleepingBody : Container 
	{
		private Mobile m_Owner;
		private string m_SleepingBodyName;	// Value of the SleepingNameAttribute attached to the owner when he died -or- null if the owner had no SleepingBodyNameAttribute; use "the remains of ~name~"
		private bool m_Blessed;
		
		private ArrayList m_EquipItems;		// List of items equiped when the owner died. Ingame, these items display /on/ the SleepingBody, not just inside
		private bool m_spell;
	private DateTime m_NextSnoreTrigger;
		[CommandProperty( AccessLevel.GameMaster )]
		public Mobile Owner
		{
			get{ return m_Owner; }
		}

		public ArrayList EquipItems
		{
			get{ return m_EquipItems; }
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public bool Invuln
		{
			get{ return m_Blessed; }
		}

		[Constructable] 
		public SleepingBody( Mobile owner, bool blessed ) : this( owner, blessed, true )
		{
		}

		[Constructable] 
		public SleepingBody( Mobile owner, bool blessed, bool isSpell ) : base( 0x2006 )
		{
			Stackable = true; // To supress console warnings, stackable must be true
			Amount = owner.Body; // protocol defines that for itemid 0x2006, amount=body
			Stackable = false;
			m_Blessed = blessed;
			Movable = false;

			m_Owner = owner;
			Name = m_Owner.Name;
			m_SleepingBodyName = GetBodyName( owner );
			Hue = m_Owner.Hue;
			Direction = m_Owner.Direction;
			m_spell = isSpell;

			m_EquipItems = new ArrayList();
			AddFromLayer( m_Owner, Layer.FirstValid, ref m_EquipItems );
			AddFromLayer( m_Owner, Layer.TwoHanded, ref m_EquipItems );
			AddFromLayer( m_Owner, Layer.Shoes, ref m_EquipItems );
			AddFromLayer( m_Owner, Layer.Pants, ref m_EquipItems );
			AddFromLayer( m_Owner, Layer.Shirt, ref m_EquipItems );
			AddFromLayer( m_Owner, Layer.Helm, ref m_EquipItems );
			AddFromLayer( m_Owner, Layer.Gloves, ref m_EquipItems );
			AddFromLayer( m_Owner, Layer.Ring, ref m_EquipItems );
			AddFromLayer( m_Owner, Layer.Neck, ref m_EquipItems );
			AddFromLayer( m_Owner, Layer.Hair, ref m_EquipItems );
			AddFromLayer( m_Owner, Layer.Waist, ref m_EquipItems );
			AddFromLayer( m_Owner, Layer.InnerTorso, ref m_EquipItems );
			AddFromLayer( m_Owner, Layer.Bracelet, ref m_EquipItems );
			AddFromLayer( m_Owner, Layer.FacialHair, ref m_EquipItems );
			AddFromLayer( m_Owner, Layer.MiddleTorso, ref m_EquipItems );
			AddFromLayer( m_Owner, Layer.Earrings, ref m_EquipItems );
			AddFromLayer( m_Owner, Layer.Arms, ref m_EquipItems );
			AddFromLayer( m_Owner, Layer.Cloak, ref m_EquipItems );
			AddFromLayer( m_Owner, Layer.OuterTorso, ref m_EquipItems );
			AddFromLayer( m_Owner, Layer.OuterLegs, ref m_EquipItems );
			AddFromLayer( m_Owner, Layer.LastUserValid, ref m_EquipItems );
		
			
		}
		
		private void AddFromLayer( Mobile from, Layer layer, ref ArrayList list ) 
		{
			if( list == null )
				list = new ArrayList();

			Item worn = from.FindItemOnLayer( layer );
			if ( worn != null )
			{
				Item item = new Item(); 
				item.ItemID = worn.ItemID;
				item.Hue = worn.Hue;
				item.Layer = layer;
				DropItem( item );
				list.Add( item ); 
			}
		}

		public override void OnDoubleClick( Mobile from )
		{
			from.SendLocalizedMessage( 1001018 ); // You cannot perform negative acts on your target.
		}
public override bool HandlesOnMovement{ get{ return true; } } // Tell the core that we implement OnMovement

		public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
		{
			from.SendLocalizedMessage( 1005468, "", 0x8A5 ); // Me Sleepy.

			return false;
		}

		public override bool OnDragDrop(Mobile from, Item dropped)
		{
			from.SendLocalizedMessage( 1005468, "", 0x8A5 ); // Me Sleepy.

			return false;
		}
      
		public override bool CheckContentDisplay( Mobile from )
		{
			return false;
		}

		public override bool DisplaysContent{ get{ return false; } }

		public override void OnAfterDelete()
		{
			
			

			if( m_Owner != null )
			{
				m_Owner.Z = this.Z;
				m_Owner.Blessed = this.m_Blessed;
			}

			for( int i = 0; i < m_EquipItems.Count; i++ )
			{
				object o = m_EquipItems[i];
				if( o != null && o is Item )
				{
					Item item = (Item)o;
					item.Delete();
				}
			}

			base.OnAfterDelete();
		}
		
		public SleepingBody( Serial serial ) : base( serial )
		{
		}

		[COLOR="Blue"]protected override Packet GetWorldPacketFor( NetState state )[/COLOR]
		{
			base.SendInfoTo( state );

			if ( ItemID == 0x2006 )
			{
				state.Send( new SleepingBodyContent( state.Mobile, this ) );
				state.Send( new SleepingBodyEquip( state.Mobile, this ) );
			}
		}

		public override void AddNameProperty( ObjectPropertyList list )
		{
			if ( m_SleepingBodyName != null )
				list.Add( m_SleepingBodyName );
			else
				list.Add( 1049644, String.Format( "Sleeping {0}", Name ) );
		}

		public override void OnSingleClick( Mobile from )
		{
			LabelTo( from, m_SleepingBodyName == null ? String.Format( "Sleeping {0}", Name ) : m_SleepingBodyName );
		}
			
		public static string GetBodyName( Mobile m )
		{
			Type t = m.GetType();

			object[] attrs = t.GetCustomAttributes( typeof( SleepingNameAttribute ), true );

			if ( attrs != null && attrs.Length > 0 )
			{
				SleepingNameAttribute attr = attrs[0] as SleepingNameAttribute;

				if ( attr != null )
					return attr.Name;
			}

			return m.Name;
		}
	
		public override void Serialize( GenericWriter writer ) 
		{ 
			base.Serialize( writer ); 

			writer.Write( (int) 1 ); 

			writer.Write(m_spell); // version 1

			writer.Write(m_Owner); // version 0
			writer.Write(m_SleepingBodyName);
			writer.Write(m_Blessed);

			writer.WriteItemList( m_EquipItems, true );
		} 

		public override void Deserialize( GenericReader reader ) 
		{ 
			m_spell = true;
			base.Deserialize( reader ); 

			int version = reader.ReadInt(); 
			switch( version )
			{
				case 1:
				{
					m_spell = reader.ReadBool();
					goto case 0;
				}
				case 0:
				{
					m_Owner = reader.ReadMobile();
					m_SleepingBodyName = reader.ReadString();
					m_Blessed = reader.ReadBool();

					m_EquipItems = reader.ReadItemList();
					break;
				}
			}
			m_NextSnoreTrigger = DateTime.Now;

			// Delete on Server restart if spell action
			if( m_spell )
				this.Delete();
		} 
		public bool CheckRange( Point3D loc, Point3D oldLoc, int range )
		{
			return CheckRange( loc, range ) && !CheckRange( oldLoc, range );
		}

		public bool CheckRange( Point3D loc, int range )
		{
			return ( (this.Z + 8) >= loc.Z && (loc.Z + 16) > this.Z )
				&& Utility.InRange( GetWorldLocation(), loc, range );
		}

		public override void OnMovement( Mobile m, Point3D oldLocation )
		{
			base.OnMovement( m, oldLocation );

			if ( m.Location == oldLocation )
				return;

			if ( CheckRange( m.Location, oldLocation, 5 ) && DateTime.Now >= m_NextSnoreTrigger )
			{
				m_NextSnoreTrigger = DateTime.Now + TimeSpan.FromSeconds(Utility.Random(5,10));

				if(this != null&&this.Owner!=null)
				{
					this.PublicOverheadMessage(0,Owner.SpeechHue,false,"zZz"); 
					Owner.PlaySound(  Owner.Female ? 819 : 1093); 
				}
			}
		}
		
	}
}
can some one help me
 

Boulder

Sorceror
for svn92 sleeping body.cs

found a fix
scripts/spells/staff/ultimaVllsystem/sleepingbody.cs
go to line 158 look at this:
public override void SendInfoTo( NetState state )
{
base.SendInfoTo( state );

if ( ItemID == 0x2006 )

change to:

public override void SendInfoTo( NetState state, bool sendOplPacket )
{
base.SendInfoTo( state, sendOplPacket );

if ( ItemID == 0x2006 )

hope this helps some one
 

Malaperth

Wanderer
I seem to have a problem with the Sleep spell.

When the spell is cast, the original body has it's Z set -100 (I assume that's so noone including staff can see the body), however, when either the spell wears off, or the Awaken spell is cast, the original body is still at -100 of it's original Z.

I've looked over and over that code and can't for the life of me figure out how/why that's happening.

I haven't made any edits to any of the spells.

Any idea?
 
Malaperth said:
I seem to have a problem with the Sleep spell.

When the spell is cast, the original body has it's Z set -100 (I assume that's so noone including staff can see the body), however, when either the spell wears off, or the Awaken spell is cast, the original body is still at -100 of it's original Z.

I've looked over and over that code and can't for the life of me figure out how/why that's happening.

I haven't made any edits to any of the spells.

Any idea?
I didn't write those spells. I only wrote the undead and avatar spells. The others were written by other people and then added to this system.
 

Malaperth

Wanderer
Well, thanks to David and Mortis, there is a simple fix for the problem with the Sleep spell. I also noticed that players can cast the spell on staff and it would do horrible things to Blessed mobiles/NPCs, so I added a fix for those as well.

Replace your Sleep.cs with this one if you want to fix those two issues I mentioned.

Code:
using System;
using System.Collections;
using Server;
using Server.Targeting;
using Server.Items;

namespace Server.Spells.Third
{
	public class SleepSpell : Spell
	{
		private SleepingBody m_Body;
		private bool m_Blessed;
		private static SpellInfo m_Info = new SpellInfo(
				"Sleep", "In Zu",
				SpellCircle.Third,
				206,
				9002,
				Reagent.SpidersSilk,
				Reagent.BlackPearl,
				Reagent.Nightshade
			);

		public SleepSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
		{
		}

		public override void OnCast()
		{
			Caster.Target = new InternalTarget( this );
		}

		public void Target( Mobile m )
		{
			if ( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if(m.Blessed || m.AccessLevel != AccessLevel.Player)
            {
                Caster.SendMessage("You cannot put that to sleep.");
            }
			else
				{
				SpellHelper.Turn( Caster, m );
	if(this.Scroll!=null)
				Scroll.Consume();
				Effects.SendLocationParticles( EffectItem.Create( new Point3D( m.X, m.Y, m.Z + 16 ), Caster.Map, EffectItem.DefaultDuration ), 0x376A, 10, 15, 5045 );
				m.PlaySound( 0x3C4 );

				m.Hidden = true;
				m.Frozen=true;
				m.Squelched=true;
			
			ArrayList sleepequip = new ArrayList();
			
			
				Item hat = m.FindItemOnLayer(Layer.Helm);
				if(hat!=null)
				{
					sleepequip.Add(hat);
				}
				SleepingBody body = new SleepingBody(m, m_Blessed);
						body.Map=m.Map;
				body.Location=m.Location;
				m_Body=body;
				m.Z-=100;
			
				m.SendMessage("You fall asleep");

				RemoveTimer( m );

				TimeSpan duration = TimeSpan.FromSeconds( Caster.Skills[SkillName.Magery].Value * 1.2 ); // 120% of magery

				Timer t = new InternalTimer( m, duration, m_Body);

				m_Table[m] = t;

				t.Start();
			}

			
		}

		private static Hashtable m_Table = new Hashtable();

		public static void RemoveTimer( Mobile m )
		{
			Timer t = (Timer)m_Table[m];

			if ( t != null )
			{
				t.Stop();
				m_Table.Remove( m );
			}
		}

		private class InternalTimer : Timer
		{
			private Mobile m_Mobile;
			private Item m_Body;

			public InternalTimer( Mobile m, TimeSpan duration, Item body ) : base( duration )
			{
				m_Mobile = m;
				m_Body=body;
			}

			protected override void OnTick()
			{
				m_Mobile.RevealingAction();
				m_Mobile.Frozen=false;
				m_Mobile.Squelched=false;
			
				
			
				if(m_Body!=null)
				{
				    m_Mobile.SendMessage("You wake up!");
                    m_Mobile.Z = m_Body.Z;
                    m_Body.Delete();
					m_Mobile.Animate(21, 6, 1, false, false, 0);
				}
				RemoveTimer( m_Mobile );
			}
		}

		public class InternalTarget : Target
		{
			private SleepSpell m_Owner;

			public InternalTarget( SleepSpell owner ) : base( 12, false, TargetFlags.Beneficial )
			{
				m_Owner = owner;
			}

			protected override void OnTarget( Mobile from, object o )
			{
				if ( o is Mobile )
				{
					m_Owner.Target( (Mobile)o );
				}
			}

			protected override void OnTargetFinish( Mobile from )
			{
				m_Owner.FinishSequence();
			}
		}
	}
}
 
Malaperth said:
Well, thanks to David and Mortis, there is a simple fix for the problem with the Sleep spell. I also noticed that players can cast the spell on staff and it would do horrible things to Blessed mobiles/NPCs, so I added a fix for those as well.

Replace your Sleep.cs with this one if you want to fix those two issues I mentioned.

Code:
using System;
using System.Collections;
using Server;
using Server.Targeting;
using Server.Items;
 
namespace Server.Spells.Third
{
    public class SleepSpell : Spell
    {
        private SleepingBody m_Body;
        private bool m_Blessed;
        private static SpellInfo m_Info = new SpellInfo(
                "Sleep", "In Zu",
                SpellCircle.Third,
                206,
                9002,
                Reagent.SpidersSilk,
                Reagent.BlackPearl,
                Reagent.Nightshade
            );
 
        public SleepSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
        {
        }
 
        public override void OnCast()
        {
            Caster.Target = new InternalTarget( this );
        }
 
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if(m.Blessed || m.AccessLevel != AccessLevel.Player)
            {
                Caster.SendMessage("You cannot put that to sleep.");
            }
            else
                {
                SpellHelper.Turn( Caster, m );
    if(this.Scroll!=null)
                Scroll.Consume();
                Effects.SendLocationParticles( EffectItem.Create( new Point3D( m.X, m.Y, m.Z + 16 ), Caster.Map, EffectItem.DefaultDuration ), 0x376A, 10, 15, 5045 );
                m.PlaySound( 0x3C4 );
 
                m.Hidden = true;
                m.Frozen=true;
                m.Squelched=true;
 
            ArrayList sleepequip = new ArrayList();
 
 
                Item hat = m.FindItemOnLayer(Layer.Helm);
                if(hat!=null)
                {
                    sleepequip.Add(hat);
                }
                SleepingBody body = new SleepingBody(m, m_Blessed);
                        body.Map=m.Map;
                body.Location=m.Location;
                m_Body=body;
                m.Z-=100;
 
                m.SendMessage("You fall asleep");
 
                RemoveTimer( m );
 
                TimeSpan duration = TimeSpan.FromSeconds( Caster.Skills[SkillName.Magery].Value * 1.2 ); // 120% of magery
 
                Timer t = new InternalTimer( m, duration, m_Body);
 
                m_Table[m] = t;
 
                t.Start();
            }
 
 
        }
 
        private static Hashtable m_Table = new Hashtable();
 
        public static void RemoveTimer( Mobile m )
        {
            Timer t = (Timer)m_Table[m];
 
            if ( t != null )
            {
                t.Stop();
                m_Table.Remove( m );
            }
        }
 
        private class InternalTimer : Timer
        {
            private Mobile m_Mobile;
            private Item m_Body;
 
            public InternalTimer( Mobile m, TimeSpan duration, Item body ) : base( duration )
            {
                m_Mobile = m;
                m_Body=body;
            }
 
            protected override void OnTick()
            {
                m_Mobile.RevealingAction();
                m_Mobile.Frozen=false;
                m_Mobile.Squelched=false;
 
 
 
                if(m_Body!=null)
                {
                    m_Mobile.SendMessage("You wake up!");
                    m_Mobile.Z = m_Body.Z;
                    m_Body.Delete();
                    m_Mobile.Animate(21, 6, 1, false, false, 0);
                }
                RemoveTimer( m_Mobile );
            }
        }
 
        public class InternalTarget : Target
        {
            private SleepSpell m_Owner;
 
            public InternalTarget( SleepSpell owner ) : base( 12, false, TargetFlags.Beneficial )
            {
                m_Owner = owner;
            }
 
            protected override void OnTarget( Mobile from, object o )
            {
                if ( o is Mobile )
                {
                    m_Owner.Target( (Mobile)o );
                }
            }
 
            protected override void OnTargetFinish( Mobile from )
            {
                m_Owner.FinishSequence();
            }
        }
    }
}
K thank you. I don't have the time to fix other people's scripts at the moment. I only have one day off a week now and I am dedicating that time to my own scripts.
 

Malaperth

Wanderer
Sorry, Lucid, I didn't mean to make that sound like anything against you at all. I apologize if it sounded that way. I just wanted to help.
 
Malaperth said:
Sorry, Lucid, I didn't mean to make that sound like anything against you at all. I apologize if it sounded that way. I just wanted to help.
Oh no. I just wanted to explain to you why I couldn't help you with this one. I'm sry. This is my one night off and hoping to update Advanced Archery to eliminate the serilization issue.
 

Malaperth

Wanderer
Well, if your systems weren't so large and so popular, you wouldn't have that problem :)

Anyway. I'm going through all the spells and have noticed some other things. Some might call them bugs, others personal preference choices, but I'm going to address them. I'd have PM'ed all this to you, but your PM box is full :)
 
Malaperth said:
Well, if your systems weren't so large and so popular, you wouldn't have that problem :)

Anyway. I'm going through all the spells and have noticed some other things. Some might call them bugs, others personal preference choices, but I'm going to address them. I'd have PM'ed all this to you, but your PM box is full :)
I will except all the help I can get :). And I don't have any issues with them being posted, but if there are a lot of fixes it is best to email them too me so I can provide everyone with an update. I greaty appreciate you telling me of the fixes cause most of the time I have to pull away from my projects to do the fixes myself :). Yeah, my PM box is very full..........I will try to empty it real quick. Sorry bout that a ton of people message me for help and I give it most of the time. BRB...............
 

Boulder

Sorceror
all spells

how do i get full ranger spell book to players the also is no cafting scrolls to add to book im i missing somthing
 
Boulder said:
how do i get full ranger spell book to players the also is no cafting scrolls to add to book im i missing somthing
Type: [add fullran
And a list will pop up select the fullrangerspellbook.

You must be talking about the FARMER book. That has not been completed yet. I am currently working on a custom skill system and will be including Farming in the future release. Oh and don't add that book and double click it cause it can crash your shard.
 
Top