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!

[Core - Spellweaving] Skills.cs

DjMatrix

Wanderer
[Core - Spellweaving] Skills.cs

This Code qualify Spellweaving Skills

Code:
/***************************************************************************
 *                                 Skills.cs
 *                            -------------------
 *   begin                : May 1, 2002
 *   copyright            : (C) The RunUO Software Team
 *   email                : [email protected]
 *
 *   $Id: Skills.cs,v 1.4 2005/01/22 04:25:04 krrios Exp $
 *   $Author: krrios $
 *   $Date: 2005/01/22 04:25:04 $
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

using System;
using System.Collections;
using System.IO;
using Server.Network;
using System.Xml;

namespace Server
{
	public delegate TimeSpan SkillUseCallback( Mobile user );

	public enum SkillLock : byte
	{
		Up = 0,
		Down = 1,
		Locked = 2
	}

	public enum SkillName
	{
		Alchemy = 0,
		Anatomy = 1,
		AnimalLore = 2,
		ItemID = 3,
		ArmsLore = 4,
		Parry = 5,
		Begging = 6,
		Blacksmith = 7,
		Fletching = 8,
		Peacemaking = 9,
		Camping = 10,
		Carpentry = 11,
		Cartography = 12,
		Cooking = 13,
		DetectHidden = 14,
		Discordance = 15,
		EvalInt = 16,
		Healing = 17,
		Fishing = 18,
		Forensics = 19,
		Herding = 20,
		Hiding = 21,
		Provocation = 22,
		Inscribe = 23,
		Lockpicking = 24,
		Magery = 25,
		MagicResist = 26,
		Tactics = 27,
		Snooping = 28,
		Musicianship = 29,
		Poisoning = 30,
		Archery = 31,
		SpiritSpeak = 32,
		Stealing = 33,
		Tailoring = 34,
		AnimalTaming = 35,
		TasteID = 36,
		Tinkering = 37,
		Tracking = 38,
		Veterinary = 39,
		Swords = 40,
		Macing = 41,
		Fencing = 42,
		Wrestling = 43,
		Lumberjacking = 44,
		Mining = 45,
		Meditation = 46,
		Stealth = 47,
		RemoveTrap = 48,
		Necromancy = 49,
		Focus = 50,
		Chivalry = 51,
		Bushido = 52,
		Ninjitsu = 53,
		Spellweaving = 54
	}

	[PropertyObject]
	public class Skill
	{
		private Skills m_Owner;
		private SkillInfo m_Info;
		private ushort m_Base;
		private ushort m_Cap;
		private SkillLock m_Lock;

		public override string ToString()
		{
			return String.Format( "[{0}: {1}]", Name, Base );
		}

		public Skill( Skills owner, SkillInfo info, GenericReader reader )
		{
			m_Owner = owner;
			m_Info = info;

			int version = reader.ReadByte();

			switch ( version )
			{
				case 0:
				{
					m_Base = reader.ReadUShort();
					m_Cap = reader.ReadUShort();
					m_Lock = (SkillLock)reader.ReadByte();

					break;
				}
				case 0xFF:
				{
					m_Base = 0;
					m_Cap = 1000;
					m_Lock = SkillLock.Up;

					break;
				}
				default:
				{
					if ( (version & 0xC0) == 0x00 )
					{
						if ( (version & 0x1) != 0 )
							m_Base = reader.ReadUShort();

						if ( (version & 0x2) != 0 )
							m_Cap = reader.ReadUShort();
						else
							m_Cap = 1000;

						if ( (version & 0x4) != 0 )
							m_Lock = (SkillLock)reader.ReadByte();
					}

					break;
				}
			}
		}

		public Skill( Skills owner, SkillInfo info, int baseValue, int cap, SkillLock skillLock )
		{
			m_Owner = owner;
			m_Info = info;
			m_Base = (ushort)baseValue;
			m_Cap = (ushort)cap;
			m_Lock = skillLock;
		}

		public void SetLockNoRelay( SkillLock skillLock )
		{
			m_Lock = skillLock;
		}

		public void Serialize( GenericWriter writer )
		{
			if ( m_Base == 0 && m_Cap == 1000 && m_Lock == SkillLock.Up )
			{
				writer.Write( (byte) 0xFF ); // default
			}
			else
			{
				int flags = 0x0;

				if ( m_Base != 0 )
					flags |= 0x1;

				if ( m_Cap != 1000 )
					flags |= 0x2;

				if ( m_Lock != SkillLock.Up )
					flags |= 0x4;

				writer.Write( (byte) flags ); // version

				if ( m_Base != 0 )
					writer.Write( (short) m_Base );

				if ( m_Cap != 1000 )
					writer.Write( (short) m_Cap );

				if ( m_Lock != SkillLock.Up )
					writer.Write( (byte) m_Lock );
			}
		}

		public Skills Owner
		{
			get
			{
				return m_Owner;
			}
		}

		public SkillName SkillName
		{
			get
			{
				return (SkillName)m_Info.SkillID;
			}
		}

		public int SkillID
		{
			get
			{
				return m_Info.SkillID;
			}
		}

		[CommandProperty( AccessLevel.Counselor )]
		public string Name
		{
			get
			{
				return m_Info.Name;
			}
		}

		public SkillInfo Info
		{
			get
			{
				return m_Info;
			}
		}

		[CommandProperty( AccessLevel.Counselor )]
		public SkillLock Lock
		{
			get
			{
				return m_Lock;
			}
		}

		public int BaseFixedPoint
		{
			get
			{
				return m_Base;
			}
			set
			{
				if ( value < 0 )
					value = 0;
				else if ( value >= 0x10000 )
					value = 0xFFFF;

				ushort sv = (ushort)value;

				int oldBase = m_Base;

				if ( m_Base != sv )
				{
					m_Owner.Total = (m_Owner.Total - m_Base) + sv;

					m_Base = sv;

					m_Owner.OnSkillChange( this );

					Mobile m = m_Owner.Owner;

					if ( m != null )
						m.OnSkillChange( SkillName, (double)oldBase / 10 );
				}
			}
		}

		[CommandProperty( AccessLevel.Counselor, AccessLevel.GameMaster )]
		public double Base
		{
			get
			{
				return ((double)m_Base / 10.0);
			}
			set
			{
				BaseFixedPoint = (int)(value * 10.0);
			}
		}

		public int CapFixedPoint
		{
			get
			{
				return m_Cap;
			}
			set
			{
				if ( value < 0 )
					value = 0;
				else if ( value >= 0x10000 )
					value = 0xFFFF;

				ushort sv = (ushort)value;

				if ( m_Cap != sv )
				{
					m_Cap = sv;

					m_Owner.OnSkillChange( this );
				}
			}
		}

		[CommandProperty( AccessLevel.Counselor, AccessLevel.GameMaster )]
		public double Cap
		{
			get
			{
				return ((double)m_Cap / 10.0);
			}
			set
			{
				CapFixedPoint = (int)(value * 10.0);
			}
		}

		private static bool m_UseStatMods;

		public static bool UseStatMods{ get{ return m_UseStatMods; } set{ m_UseStatMods = value; } }

		public int Fixed
		{
			get{ return (int)(Value * 10); }
		}

		[CommandProperty( AccessLevel.Counselor )]
		public double Value
		{
			get
			{
				double baseValue = Base;
				double inv = 100.0 - baseValue;

				if ( inv < 0.0 ) inv = 0.0;

				inv /= 100.0;

				double statsOffset = ((m_UseStatMods ? m_Owner.Owner.Str : m_Owner.Owner.RawStr) * m_Info.StrScale) + ((m_UseStatMods ? m_Owner.Owner.Dex : m_Owner.Owner.RawDex) * m_Info.DexScale) + ((m_UseStatMods ? m_Owner.Owner.Int : m_Owner.Owner.RawInt) * m_Info.IntScale);
				double statTotal = m_Info.StatTotal * inv;

				statsOffset *= inv;

				if ( statsOffset > statTotal )
					statsOffset = statTotal;

				double value = baseValue + statsOffset;

				m_Owner.Owner.ValidateSkillMods();

				ArrayList mods = m_Owner.Owner.SkillMods;

				double bonusObey = 0.0, bonusNotObey = 0.0;

				for ( int i = 0; i < mods.Count; ++i )
				{
					SkillMod mod = (SkillMod)mods[i];

					if ( mod.Skill == (SkillName)m_Info.SkillID )
					{
						if ( mod.Relative )
						{
							if ( mod.ObeyCap )
								bonusObey += mod.Value;
							else
								bonusNotObey += mod.Value;
						}
						else
						{
							bonusObey = 0.0;
							bonusNotObey = 0.0;
							value = mod.Value;
						}
					}
				}

				value += bonusNotObey;

				if ( value < Cap )
				{
					value += bonusObey;

					if ( value > Cap )
						value = Cap;
				}

				return value;
			}
		}

		public void Update()
		{
			m_Owner.OnSkillChange( this );
		}
	}

	public class SkillInfo
	{
		private int m_SkillID;
		private string m_Name;
		private string m_Title;
		private double m_StrScale;
		private double m_DexScale;
		private double m_IntScale;
		private double m_StatTotal;
		private SkillUseCallback m_Callback;
		private double m_StrGain;
		private double m_DexGain;
		private double m_IntGain;
		private double m_GainFactor;

		public SkillInfo( int skillID, string name, double strScale, double dexScale, double intScale, string title, SkillUseCallback callback, double strGain, double dexGain, double intGain, double gainFactor )
		{
			m_Name = name;
			m_Title = title;
			m_SkillID = skillID;
			m_StrScale = strScale / 100.0;
			m_DexScale = dexScale / 100.0;
			m_IntScale = intScale / 100.0;
			m_Callback = callback;
			m_StrGain = strGain;
			m_DexGain = dexGain;
			m_IntGain = intGain;
			m_GainFactor = gainFactor;

			m_StatTotal = strScale + dexScale + intScale;
		}

		public SkillUseCallback Callback
		{
			get
			{
				return m_Callback;
			}
			set
			{
				m_Callback = value;
			}
		}

		public int SkillID
		{
			get
			{
				return m_SkillID;
			}
		}

		public string Name
		{
			get
			{
				return m_Name;
			}
			set
			{
				m_Name = value;
			}
		}

		public string Title
		{
			get
			{
				return m_Title;
			}
			set
			{
				m_Title = value;
			}
		}

		public double StrScale
		{
			get
			{
				return m_StrScale;
			}
			set
			{
				m_StrScale = value;
			}
		}

		public double DexScale
		{
			get
			{
				return m_DexScale;
			}
			set
			{
				m_DexScale = value;
			}
		}

		public double IntScale
		{
			get
			{
				return m_IntScale;
			}
			set
			{
				m_IntScale = value;
			}
		}

		public double StatTotal
		{
			get
			{
				return m_StatTotal;
			}
			set
			{
				m_StatTotal = value;
			}
		}

		public double StrGain
		{
			get
			{
				return m_StrGain;
			}
			set
			{
				m_StrGain = value;
			}
		}

		public double DexGain
		{
			get
			{
				return m_DexGain;
			}
			set
			{
				m_DexGain = value;
			}
		}

		public double IntGain
		{
			get
			{
				return m_IntGain;
			}
			set
			{
				m_IntGain = value;
			}
		}

		public double GainFactor
		{
			get
			{
				return m_GainFactor;
			}
			set
			{
				m_GainFactor = value;
			}
		}

		private static SkillInfo[] m_Table = new SkillInfo[54]
			{
				new SkillInfo(  0, "Alchemy",					0.0,	5.0,	5.0,	"Alchemist",	null,	0.0,	0.5,	0.5,	1.0 ),
				new SkillInfo(  1, "Anatomy",					0.0,	0.0,	0.0,	"Healer",		null,	0.15,	0.15,	0.7,	1.0 ),
				new SkillInfo(  2, "Animal Lore",				0.0,	0.0,	0.0,	"Ranger",		null,	0.0,	0.0,	1.0,	1.0 ),
				new SkillInfo(  3, "Item Identification",		0.0,	0.0,	0.0,	"Merchant",		null,	0.0,	0.0,	1.0,	1.0 ),
				new SkillInfo(  4, "Arms Lore",					0.0,	0.0,	0.0,	"Warrior",		null,	0.75,	0.15,	0.1,	1.0 ),
				new SkillInfo(  5, "Parrying",					7.5,	2.5,	0.0,	"Warrior",		null,	0.75,	0.25,	0.0,	1.0 ),
				new SkillInfo(  6, "Begging",					0.0,	0.0,	0.0,	"Beggar",		null,	0.0,	0.0,	0.0,	1.0 ),
				new SkillInfo(  7, "Blacksmithy",				10.0,	0.0,	0.0,	"Smith",		null,	1.0,	0.0,	0.0,	1.0 ),
				new SkillInfo(  8, "Bowcraft/Fletching",		6.0,	16.0,	0.0,	"Bowyer",		null,	0.6,	1.6,	0.0,	1.0 ),
				new SkillInfo(  9, "Peacemaking",				0.0,	0.0,	0.0,	"Bard",			null,	0.0,	0.0,	0.0,	1.0 ),
				new SkillInfo( 10, "Camping",					20.0,	15.0,	15.0,	"Ranger",		null,	2.0,	1.5,	1.5,	1.0 ),
				new SkillInfo( 11, "Carpentry",					20.0,	5.0,	0.0,	"Carpenter",	null,	2.0,	0.5,	0.0,	1.0 ),
				new SkillInfo( 12, "Cartography",				0.0,	7.5,	7.5,	"Cartographer",	null,	0.0,	0.75,	0.75,	1.0 ),
				new SkillInfo( 13, "Cooking",					0.0,	20.0,	30.0,	"Chef",			null,	0.0,	2.0,	3.0,	1.0 ),
				new SkillInfo( 14, "Detecting Hidden",			0.0,	0.0,	0.0,	"Scout",		null,	0.0,	0.4,	0.6,	1.0 ),
				new SkillInfo( 15, "Discordance",				0.0,	2.5,	2.5,	"Bard",			null,	0.0,	0.25,	0.25,	1.0 ),
				new SkillInfo( 16, "Evaluating Intelligence",	0.0,	0.0,	0.0,	"Scholar",		null,	0.0,	0.0,	1.0,	1.0 ),
				new SkillInfo( 17, "Healing",					6.0,	6.0,	8.0,	"Healer",		null,	0.6,	0.6,	0.8,	1.0 ),
				new SkillInfo( 18, "Fishing",					0.0,	0.0,	0.0,	"Fisherman",	null,	0.5,	0.5,	0.0,	1.0 ),
				new SkillInfo( 19, "Forensic Evaluation",		0.0,	0.0,	0.0,	"Detective",	null,	0.0,	0.2,	0.8,	1.0 ),
				new SkillInfo( 20, "Herding",					16.25,	6.25,	2.5,	"Shepherd",		null,	1.625,	0.625,	0.25,	1.0 ),
				new SkillInfo( 21, "Hiding",					0.0,	0.0,	0.0,	"Rogue",		null,	0.0,	0.8,	0.2,	1.0 ),
				new SkillInfo( 22, "Provocation",				0.0,	4.5,	0.5,	"Bard",			null,	0.0,	0.45,	0.05,	1.0 ),
				new SkillInfo( 23, "Inscription",				0.0,	2.0,	8.0,	"Scribe",		null,	0.0,	0.2,	0.8,	1.0 ),
				new SkillInfo( 24, "Lockpicking",				0.0,	25.0,	0.0,	"Rogue",		null,	0.0,	2.0,	0.0,	1.0 ),
				new SkillInfo( 25, "Magery",					0.0,	0.0,	15.0,	"Mage",			null,	0.0,	0.0,	1.5,	1.0 ),
				new SkillInfo( 26, "Resisting Spells",			0.0,	0.0,	0.0,	"Mage",			null,	0.25,	0.25,	0.5,	1.0 ),
				new SkillInfo( 27, "Tactics",					0.0,	0.0,	0.0,	"Warrior",		null,	0.0,	0.0,	0.0,	1.0 ),
				new SkillInfo( 28, "Snooping",					0.0,	25.0,	0.0,	"Pickpocket",	null,	0.0,	2.5,	0.0,	1.0 ),
				new SkillInfo( 29, "Musicianship",				0.0,	0.0,	0.0,	"Bard",			null,	0.0,	0.8,	0.2,	1.0 ),
				new SkillInfo( 30, "Poisoning",					0.0,	4.0,	16.0,	"Assassin",		null,	0.0,	0.4,	1.6,	1.0 ),
				new SkillInfo( 31, "Archery",					2.5,	7.5,	0.0,	"Archer",		null,	0.25,	0.75,	0.0,	1.0 ),
				new SkillInfo( 32, "Spirit Speak",				0.0,	0.0,	0.0,	"Medium",		null,	0.0,	0.0,	1.0,	1.0 ),
				new SkillInfo( 33, "Stealing",					0.0,	10.0,	0.0,	"Rogue",		null,	0.0,	1.0,	0.0,	1.0 ),
				new SkillInfo( 34, "Tailoring",					3.75,	16.25,	5.0,	"Tailor",		null,	0.38,	1.63,	0.5,	1.0 ),
				new SkillInfo( 35, "Animal Taming",				14.0,	2.0,	4.0,	"Tamer",		null,	1.4,	0.2,	0.4,	1.0 ),
				new SkillInfo( 36, "Taste Identification",		0.0,	0.0,	0.0,	"Chef",			null,	0.2,	0.0,	0.8,	1.0 ),
				new SkillInfo( 37, "Tinkering",					5.0,	2.0,	3.0,	"Tinker",		null,	0.5,	0.2,	0.3,	1.0 ),
				new SkillInfo( 38, "Tracking",					0.0,	12.5,	12.5,	"Ranger",		null,	0.0,	1.25,	1.25,	1.0 ),
				new SkillInfo( 39, "Veterinary",				8.0,	4.0,	8.0,	"Veterinarian",	null,	0.8,	0.4,	0.8,	1.0 ),
				new SkillInfo( 40, "Swordsmanship",				7.5,	2.5,	0.0,	"Swordsman",	null,	0.75,	0.25,	0.0,	1.0 ),
				new SkillInfo( 41, "Mace Fighting",				9.0,	1.0,	0.0,	"Armsman",		null,	0.9,	0.1,	0.0,	1.0 ),
				new SkillInfo( 42, "Fencing",					4.5,	5.5,	0.0,	"Fencer",		null,	0.45,	0.55,	0.0,	1.0 ),
				new SkillInfo( 43, "Wrestling",					9.0,	1.0,	0.0,	"Wrestler",		null,	0.9,	0.1,	0.0,	1.0 ),
				new SkillInfo( 44, "Lumberjacking",				20.0,	0.0,	0.0,	"Lumberjack",	null,	2.0,	0.0,	0.0,	1.0 ),
				new SkillInfo( 45, "Mining",					20.0,	0.0,	0.0,	"Miner",		null,	2.0,	0.0,	0.0,	1.0 ),
				new SkillInfo( 46, "Meditation",				0.0,	0.0,	0.0,	"Stoic",		null,	0.0,	0.0,	0.0,	1.0 ),
				new SkillInfo( 47, "Stealth",					0.0,	0.0,	0.0,	"Rogue",		null,	0.0,	0.0,	0.0,	1.0 ),
				new SkillInfo( 48, "Remove Trap",				0.0,	0.0,	0.0,	"Rogue",		null,	0.0,	0.0,	0.0,	1.0 ),
				new SkillInfo( 49, "Necromancy",				0.0,	0.0,	0.0,	"Necromancer",	null,	0.0,	0.0,	0.0,	1.0 ),
				new SkillInfo( 50, "Focus",					0.0,	0.0,	0.0,	"Stoic",		null,	0.0,	0.0,	0.0,	1.0 ),
				new SkillInfo( 51, "Chivalry",					0.0,	0.0,	0.0,	"Paladin",		null,	0.0,	0.0,	0.0,	1.0 ),
				new SkillInfo( 52, "Bushido",					0.0,	0.0,	0.0,	"Samurai",		null,	0.0,	0.0,	0.0,	1.0 ),
				new SkillInfo( 53, "Ninjitsu",					0.0,	0.0,	0.0,	"Ninja",		null,	0.0,	0.0,	0.0,	1.0 ),
				new SkillInfo( 53, "Spellweaving",				0.0,	0.0,	0.0,	"Arcanist",		null,	0.0,	0.0,	0.0,	1.0 ),
			};

		public static SkillInfo[] Table
		{
			get
			{
				return m_Table;
			}
			set
			{
				m_Table = value;
			}
		}
	}

	[PropertyObject]
	public class Skills
	{
		private Mobile m_Owner;
		private Skill[] m_Skills;
		private int m_Total, m_Cap;
		private Skill m_Highest;

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Alchemy{ get{ return this[SkillName.Alchemy]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Anatomy{ get{ return this[SkillName.Anatomy]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill AnimalLore{ get{ return this[SkillName.AnimalLore]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill ItemID{ get{ return this[SkillName.ItemID]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill ArmsLore{ get{ return this[SkillName.ArmsLore]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Parry{ get{ return this[SkillName.Parry]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Begging{ get{ return this[SkillName.Begging]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Blacksmith{ get{ return this[SkillName.Blacksmith]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Fletching{ get{ return this[SkillName.Fletching]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Peacemaking{ get{ return this[SkillName.Peacemaking]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Camping{ get{ return this[SkillName.Camping]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Carpentry{ get{ return this[SkillName.Carpentry]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Cartography{ get{ return this[SkillName.Cartography]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Cooking{ get{ return this[SkillName.Cooking]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill DetectHidden{ get{ return this[SkillName.DetectHidden]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Discordance{ get{ return this[SkillName.Discordance]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill EvalInt{ get{ return this[SkillName.EvalInt]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Healing{ get{ return this[SkillName.Healing]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Fishing{ get{ return this[SkillName.Fishing]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Forensics{ get{ return this[SkillName.Forensics]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Herding{ get{ return this[SkillName.Herding]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Hiding{ get{ return this[SkillName.Hiding]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Provocation{ get{ return this[SkillName.Provocation]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Inscribe{ get{ return this[SkillName.Inscribe]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Lockpicking{ get{ return this[SkillName.Lockpicking]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Magery{ get{ return this[SkillName.Magery]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill MagicResist{ get{ return this[SkillName.MagicResist]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Tactics{ get{ return this[SkillName.Tactics]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Snooping{ get{ return this[SkillName.Snooping]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Musicianship{ get{ return this[SkillName.Musicianship]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Poisoning{ get{ return this[SkillName.Poisoning]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Archery{ get{ return this[SkillName.Archery]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill SpiritSpeak{ get{ return this[SkillName.SpiritSpeak]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Stealing{ get{ return this[SkillName.Stealing]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Tailoring{ get{ return this[SkillName.Tailoring]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill AnimalTaming{ get{ return this[SkillName.AnimalTaming]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill TasteID{ get{ return this[SkillName.TasteID]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Tinkering{ get{ return this[SkillName.Tinkering]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Tracking{ get{ return this[SkillName.Tracking]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Veterinary{ get{ return this[SkillName.Veterinary]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Swords{ get{ return this[SkillName.Swords]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Macing{ get{ return this[SkillName.Macing]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Fencing{ get{ return this[SkillName.Fencing]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Wrestling{ get{ return this[SkillName.Wrestling]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Lumberjacking{ get{ return this[SkillName.Lumberjacking]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Mining{ get{ return this[SkillName.Mining]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Meditation{ get{ return this[SkillName.Meditation]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Stealth{ get{ return this[SkillName.Stealth]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill RemoveTrap{ get{ return this[SkillName.RemoveTrap]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Necromancy{ get{ return this[SkillName.Necromancy]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Focus{ get{ return this[SkillName.Focus]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Chivalry{ get{ return this[SkillName.Chivalry]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Bushido{ get{ return this[SkillName.Bushido]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Ninjitsu{ get{ return this[SkillName.Ninjitsu]; } set{} }

		[CommandProperty( AccessLevel.Counselor )]
		public Skill Spellweaving{ get{ return this[SkillName.Spellweaving]; } set{} }

		[CommandProperty( AccessLevel.Counselor, AccessLevel.GameMaster )]
		public int Cap
		{
			get{ return m_Cap; } 
			set{ m_Cap = value; }
		}

		public int Total
		{
			get{ return m_Total; }
			set{ m_Total = value; }
		}

		public Mobile Owner
		{
			get{ return m_Owner; }
		}

		public int Length
		{
			get{ return m_Skills.Length; }
		}

		public Skill this[SkillName name]
		{
			get{ return this[(int)name]; }
		}

		public Skill this[int skillID]
		{
			get
			{
				if ( skillID < 0 || skillID >= m_Skills.Length )
					return null;

				Skill sk = m_Skills[skillID];

				if ( sk == null )
					m_Skills[skillID] = sk = new Skill( this, SkillInfo.Table[skillID], 0, 1000, SkillLock.Up );

				return sk;
			}
		}

		public override string ToString()
		{
			return "...";
		}

		public static bool UseSkill( Mobile from, SkillName name )
		{
			return UseSkill( from, (int)name );
		}

		public static bool UseSkill( Mobile from, int skillID )
		{
			if ( !from.CheckAlive() )
				return false;
			else if ( !from.Region.OnSkillUse( from, skillID ) )
				return false;
			else if ( !from.AllowSkillUse( (SkillName)skillID ) )
				return false;

			if ( skillID >= 0 && skillID < SkillInfo.Table.Length )
			{
				SkillInfo info = SkillInfo.Table[skillID];

				if ( info.Callback != null )
				{
					if ( from.NextSkillTime <= DateTime.Now && from.Spell == null )
					{
						from.DisruptiveAction();

						from.NextSkillTime = DateTime.Now + info.Callback( from );

						return true;
					}
					else
					{
						from.SendSkillMessage();
					}
				}
				else
				{
					from.SendLocalizedMessage( 500014 ); // That skill cannot be used directly.
				}
			}

			return false;
		}

		public Skill Highest
		{
			get
			{
				if ( m_Highest == null )
				{
					Skill highest = null;
					int value = int.MinValue;

					for ( int i = 0; i < m_Skills.Length; ++i )
					{
						Skill sk = m_Skills[i];

						if ( sk != null && sk.BaseFixedPoint > value )
						{
							value = sk.BaseFixedPoint;
							highest = sk;
						}
					}

					if ( highest == null && m_Skills.Length > 0 )
						highest = this[0];

					m_Highest = highest;
				}

				return m_Highest;
			}
		}

		public void Serialize( GenericWriter writer )
		{
			m_Total = 0;

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

			writer.Write( (int) m_Cap );
			writer.Write( (int) m_Skills.Length );

			for ( int i = 0; i < m_Skills.Length; ++i )
			{
				Skill sk = m_Skills[i];

				if ( sk == null )
				{
					writer.Write( (byte) 0xFF );
				}
				else
				{
					sk.Serialize( writer );
					m_Total += sk.BaseFixedPoint;
				}
			}
		}

		public Skills( Mobile owner )
		{
			m_Owner = owner;
			m_Cap = 7000;

			SkillInfo[] info = SkillInfo.Table;

			m_Skills = new Skill[info.Length];

			//for ( int i = 0; i < info.Length; ++i )
			//	m_Skills[i] = new Skill( this, info[i], 0, 1000, SkillLock.Up );
		}

		public Skills( Mobile owner, GenericReader reader )
		{
			m_Owner = owner;

			int version = reader.ReadInt();

			switch ( version )
			{
				case 3:
				case 2:
				{
					m_Cap = reader.ReadInt();

					goto case 1;
				}
				case 1:
				{
					if ( version < 2 )
						m_Cap = 7000;

					if ( version < 3 )
						/*m_Total =*/ reader.ReadInt();

					SkillInfo[] info = SkillInfo.Table;

					m_Skills = new Skill[info.Length];

					int count = reader.ReadInt();

					for ( int i = 0; i < count; ++i )
					{
						if ( i < info.Length )
						{
							Skill sk = new Skill( this, info[i], reader );

							if ( sk.BaseFixedPoint != 0 || sk.CapFixedPoint != 1000 || sk.Lock != SkillLock.Up )
							{
								m_Skills[i] = sk;
								m_Total += sk.BaseFixedPoint;
							}
						}
						else
						{
							new Skill( this, null, reader );
						}
					}

					//for ( int i = count; i < info.Length; ++i )
					//	m_Skills[i] = new Skill( this, info[i], 0, 1000, SkillLock.Up );

					break;
				}
				case 0:
				{
					reader.ReadInt();

					goto case 1;
				}
			}
		}

		public void OnSkillChange( Skill skill )
		{
			if ( skill == m_Highest ) // could be downgrading the skill, force a recalc
				m_Highest = null;
			else if ( m_Highest != null && skill.BaseFixedPoint > m_Highest.BaseFixedPoint )
				m_Highest = skill;

			m_Owner.OnSkillInvalidated( skill );

			NetState ns = m_Owner.NetState;

			if ( ns != null )
				ns.Send( new SkillChange( skill ) );
		}
	}
}
 
E

Ed_Elric

Guest
just wondering what would be the point in doing this since no one has writen the actual skill?
 

Phantom

Knight
Ed_Elric said:
just wondering what would be the point in doing this since no one has writen the actual skill?

Incase somebody did not know how to do the core, but was skilled enough to do the skill itself.

Its only a craft skill, if I had the information I could do it in a few hours.
 
E

Ed_Elric

Guest
yeh but i think if someone was skilled enough to do that then they could find that in the core also spellweaving is not a crafting skill its a magic skill
 

DjMatrix

Wanderer
Ed_Elric said:
just wondering what would be the point in doing this since no one has writen the actual skill?

Code:
public enum SkillName
{
   -,
   -,
   -,
   Spellweaving = 54
}

Code:
private static SkillInfo[] m_Table = new SkillInfo[54]
{
new SkillInfo( 53, "Spellweaving",				0.0,	0.0,	0.0,	"Arcanist",		null,	0.0,	0.0,	0.0,	1.0 ),
};

Code:
[CommandProperty( AccessLevel.Counselor )]
public Skill Spellweaving{ get{ return this[SkillName.Spellweaving]; } set{} }
 

Phantom

Knight
Ed_Elric said:
yeh but i think if someone was skilled enough to do that then they could find that in the core also spellweaving is not a crafting skill its a magic skill

The name is sort of miss leading.

Magery skills are even easier.
 

Phantom

Knight
DjMatrix said:
is a Arcanist Skill

I thought I knew which one it was, no idea what you mean by Arcanist Skill, does't matter.

The skill itself is easy enough to code, its not like the special abilities that use complex timer combinations to do compare to alot of other things.
 

DjMatrix

Wanderer
Phantom said:
I thought I knew which one it was, no idea what you mean by Arcanist Skill, does't matter.

The skill itself is easy enough to code, its not like the special abilities that use complex timer combinations to do compare to alot of other things.


eheh is OSI ( Origin System Inc. )
 

Phantom

Knight
DjMatrix said:
eheh is OSI ( Origin System Inc. )

Alright?

I know its from OSI I know the skill was added into ML, I just thought I knew what it allowed the player to do based on screenshots.

I still say its more of a craft skill then anything.
 

DjMatrix

Wanderer
Spellweaving is a new skill of magic that allows an arcanist (the official title of a spellweaver) to summon powerful forces of nature and manifest them into various spell effects. Channeling such power is often done in concert with other arcanists. Such cooperative casting allows for arcanists to weave titanic magic that would otherwise be impossible for a mortal to command.

:D
 

Voran

Wanderer
The only item Spellweaving creates is an Arcane Focus (from Arcane Circle) - all the other spells are damages, polymorphs, and a few that look suspiciously like modified versions of Charm and Ring Of Fire.

They all look pretty easy to write, but there aren't many 100% exact statistics for them about yet.
 

Corbo6969

Wanderer
Here's a rundown of spellweaving I found.


Arcane Circles​

Arcane circles are used to increase spell effects and bonusses and can be made by a good carpenter

Spells​

Spells are obtained from the new monsters as scrolls, or learned from your master

Arcane Circle - Myrshalee
Mana Cost: 24
Minimum Skill Needed: 0.1
Casting Delay: 0.5
Duration: 1-5 hours (Skill Level Real / 240, minimum 1) (+1 hour per additional arcanist)
Area of Effect: Caster and up to 5 other arcanists standing within an arcane circle.

The caster and up to four participating arcanists must stand inside an arcane circle. When the caster invokes this spell, a magically charged emerald (called an arcane focus) is created for the caster and each participating arcanist. The arcane focus increases duration, spell damage, healing spell effectiveness, and area of effect for the activator’s Spellweaving spells.


Gift of Renewal - Olorisstra
Mana Cost: 24
Minimum Skill Needed: 0.1
Casting Delay: 3.0
Duration: 1-5 minutes (Skill Level Real / 240, minimum 1)
Area of Effect: Caster or 1 target
Arcane Circle Bonus: +1 health regeneration per additional arcanist. +1 minute duration per additional arcanist. +2% cure poison chance per additional arcanist.

Increases the recipient’s natural health regeneration for the duration of the spell. Can cure poison one time, and then the spell immediately ends. If the recipient gets poisoned after this spell’s initial casting, the spell will attempt to cure poison one time. If the cure poison attempt is successful, then the gift of renewal expires as normal.


Immolating Weapon - Thalshara
Mana Cost: 26
Minimum Skill Needed: 0.1
Casting Delay: 1.0
Duration: 11-15 seconds (10 + (Skill Level Real / 240, minimum 1))
Area of Effect: 1 Weapon (must be equipped by caster)
Arcane Circle Bonus: +1 damage per additional arcanist. +1 second duration per additional arcanist.

Temporarily enchants a bow or melee weapon so that it inflicts extra fire damage per hit.


Attune Weapon - Haeldril
Mana Cost: 26
Minimum Skill Needed: 0.1
Casting Delay: 1.0
Duration: 11-15 seconds (10 + (Skill Level Real / 240, minimum 1)) Area of Effect: 1 Weapon (must be equipped by target)
Arcane Circle Bonus: +1 second duration per additional arcanist.

The arcanist becomes one with an enemy’s weapon. This curse lessens damage inflicted by an enemy’s weapon by 50% for the duration of the spell.


Thunderstorm - Erelonia
Mana Cost: 32
Minimum Skill Needed: 10.1
Casting Delay: 1.5
Duration: Damage is instantaneous. Any victim interrupted while spellcasting receives a penalty to faster cast recovery for a duration of 5 seconds, unless it successfully makes a successful Resisting Spells skill check. Area of Effect: 1 Weapon (must be equipped by target)
Arcane Circle Bonus: +1 damage per additional arcanist. +1 tile radius per additional arcanist. +1 second duration per additional arcanist.

A thunderous boom temporarily smites opponents with physical damage and may reduce spellcasting recovery time for the duration of the spell.


Nature’s Fury - Rauvvrae
Mana Cost: 29
Minimum Skill Needed: 10.1
Casting Delay: 1.5
Duration: 26-30 seconds (25 + (Skill Level Real / 240, minimum 1)) or until slain (whichever comes first)
Area of Effect: 1 insect swarm
Arcane Circle Bonus: +1 damage for each insect swarm attack per additional arcanist. +2 seconds duration per additional arcanist.

Summons a swarm of insects that inflict poison damage upon its victim. The more it is angered, the more damage it inflicts.


Summon Fey - Alalithra
Mana Cost: 31
Minimum Skill Needed: 38.1
Casting Delay: 2.0
Duration: 1-5 minutes (Skill Level Real / 240, minimum 1) or until slain (whichever comes first)
Area of Effect: 1 lesser fey
Arcane Circle Bonus: 1 fey per additional arcanist (5 max). +1 minute duration per additional arcanist.

Summons one or more lesser fey to fight, follow, and guard the arcanist. Note that this spell is acquired through the questing system, and does not drop as loot.


Summon Fiend - Nylisstra
Mana Cost: 31
Minimum Skill Needed: 38.1
Casting Delay: 2.0
Duration: 1-5 minutes (Skill Level Real / 240, minimum 1) or until slain (whichever comes first)
Area of Effect: 1 lesser fiend
Arcane Circle Bonus: +1 fiend per additional arcanist. +1 minute duration per additional arcanist.

Summons one or more lesser fiends to fight, follow, and guard the arcanist. Note that this spell is acquired through the questing system, and does not drop as loot.


Reaper Form - Tarisstree
Mana Cost: 34
Minimum Skill Needed: 24.1
Casting Delay: 2.5
Duration: Permanent until the caster assumes another form
Area of Effect: Caster only
Arcane Circle Bonus: +1% to swing speed increase, spell damage increase, and resists per additional arcanist.

Transforms the caster into a reaper. This provides bonuses to swing speed, spell damage, and resists. However, while in this form, the caster is susceptible to fire and moves at a slower speed.


Wildfire - Haelyn
Mana Cost: 34
Minimum Skill Needed: 52.1
Casting Delay: 2.5
Duration: 1-5 seconds (Skill Level Real / 240, minimum 1)
Area of Effect: 5 tile radius
Arcane Circle Bonus: +1 tile radius per additional arcanist. +1 damage per additional arcanist. +1 second duration per additional arcanist.

A blast of intense fire inflicts fire damage on all opponents within its area of effect. Lasts for several seconds.


Essence of Wind - Anathrae
Mana Cost: 40
Minimum Skill Needed: 52.1
Casting Delay: 3.0
Duration: Damage is instantaneous. Any victim chilled receives a penalty to swing speed increase and faster casting for a duration of 1-5 seconds, unless it successfully makes a successful Resisting Spells skill check.
Area of Effect: 5 tile radius
Arcane Circle Bonus: +1 tile radius per additional arcanist. +1 damage per additional arcanist. +1 second duration per additional arcanist.

A blast of cold air inflicts cold damage on all enemies within its area of effect. Enemies attack and cast spells slower while under this spell’s chill effect. Chill effects last for several seconds.


Dryad Allure - Rathril
Mana Cost
: 40
Minimum Skill Needed: 52.1
Casting Delay: 3.0
Duration: Permanent, until slain
Area of Effect: Caster only
Arcane Circle Bonus: +2% chance to Charm humanoid per additional arcanist.

Like a dryad, allows the caster to charm humanoids (not player characters) and command them to do her bidding.


Ethereal Voyage - Orlavdra
Mana Cost
: 60
Minimum Skill Needed: 24.1
Casting Delay: 3.5
Duration: 26-30 seconds (25 + (Skill Level Real / 240, minimum 1)), or the caster performs a hostile action (whichever comes first)
Area of Effect: Caster only
Arcane Circle Bonus: +2 seconds duration per additional arcanist.

Allows the arcanist to wander around in an ethereal form as if under the effects of monster ignore. Effect ends after the duration expires or when the caster performs a hostile action (whichever comes first). The arcanist is still visible to other player characters and may be attacked by other player characters as normal. Cannot be used during the heat of battle.


Ethereal Voyage - Orlavdra
Mana Cost: 60
Minimum Skill Needed: 24.1
Casting Delay: 3.5
Duration: 26-30 seconds (25 + (Skill Level Real / 240, minimum 1)), or the caster performs a hostile action (whichever comes first)
Area of Effect: Caster only
Arcane Circle Bonus: +2 seconds duration per additional arcanist.

Allows the arcanist to wander around in an ethereal form as if under the effects of monster ignore. Effect ends after the duration expires or when the caster performs a hostile action (whichever comes first). The arcanist is still visible to other player characters and may be attacked by other player characters as normal. Cannot be used during the heat of battle.


Gift of Life - Illorae
Mana Cost
: 70
Minimum Skill Needed: 80.1
Casting Delay: 4.0
Duration: 1-5 minutes (Skill Level Real / 240, minimum 1)
Area of Effect: Caster or 1 tamed (must be bonded) creature under the control of the arcanist
Arcane Circle Bonus: +1 minute duration per additional arcanist.

Death during this spell effect can possibly be reversed for the arcanist or a bonded pet under her control. If the caster or a bonded pet dies while under the effects of this spell, then she/it is instantly resurrected, restored to 50% health, cured of all poisons, and the spell ends. Only the arcanist and her bonded pets may be resurrected in this manner.


Arcane Empowerment - Aslavdra
Mana Cost
: 30
Minimum Skill Needed: 24.1
Casting Delay: 4.0
Duration: 16-20 seconds (15 + (Skill Level Real / 240, minimum 1))
Area of Effect: Caster only
Arcane Circle Bonus: +10% (+1% vs. player characters) damage modifier per additional arcanist. +5% healing modifier per additional arcanist. +2 seconds duration per additional arcanist.

For the duration of this spell, the caster’s damaging spells and healing spells are increased in effectiveness. Summoned creatures and animated undead are also increased in effectiveness.
 

Ravenal

Knight
I wanted to noted that your code will work yes but it will have problems you need to fix this

Code:
new SkillInfo( 53, "Spellweaving",				0.0,	0.0,	0.0,	"Arcanist",		null,	0.0,	0.0,	0.0,	1.0 ),

to maybe something like this, they'll never gain anything if ya set it to 0.0 0.0 0.0 on all of them o0, I am sure it uses an Int gain

Code:
new SkillInfo( 54, "Spellweaving",				0.0,	0.0,	5.0,	"Arcanist",		null,	0.0,	0.0,	1.5,	1.0 ),

the 53 you have 2 of them and that could result a problem in the future, for example having both 53 gaining at the same time that would and could be a problem?
 
Top