From 2931df9644f5ec3556ef70821cca5f21cf77cbcb Mon Sep 17 00:00:00 2001 From: Xeroxxx Date: Mon, 16 Jan 2017 11:16:51 +0100 Subject: [PATCH 01/12] E-Mail Authentication --- Scripts/Misc/Email.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Scripts/Misc/Email.cs b/Scripts/Misc/Email.cs index f7d428d7a..5fbaf46dd 100644 --- a/Scripts/Misc/Email.cs +++ b/Scripts/Misc/Email.cs @@ -24,7 +24,11 @@ namespace Server.Misc public static readonly string EmailServer = null; public static readonly int EmailPort = 25; + public static readonly string FromAddress = null; + public static readonly string EmailUsername = null; + public static readonly string EmailPassword = null; + public static readonly string CrashAddresses = null; public static readonly string SpeechLogPageAddresses = null; @@ -44,7 +48,13 @@ namespace Server.Misc public static void Configure() { if ( EmailServer != null ) + { _Client = new SmtpClient( EmailServer, EmailPort ); + if ( EmailUsername != null ) + { + _Client.Credentials = new System.Net.NetworkCredential( EmailUsername, EmailPassword ); + } + } } public static bool Send( MailMessage message ) @@ -86,4 +96,4 @@ namespace Server.Misc Console.WriteLine( "Failure sending e-mail '{0}' to '{1}'.", message.Subject, message.To ); } } -} \ No newline at end of file +} From 53d6d8f882573d68647995b355810244e8fc40ec Mon Sep 17 00:00:00 2001 From: Xeroxxx Date: Mon, 16 Jan 2017 11:32:38 +0100 Subject: [PATCH 02/12] Added initial database schema creation --- Scripts/Engines/MyRunUO/MyRunUO.cs | 43 +++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/Scripts/Engines/MyRunUO/MyRunUO.cs b/Scripts/Engines/MyRunUO/MyRunUO.cs index 396287b11..5949ba254 100644 --- a/Scripts/Engines/MyRunUO/MyRunUO.cs +++ b/Scripts/Engines/MyRunUO/MyRunUO.cs @@ -24,6 +24,7 @@ namespace Server.Engines.MyRunUO { Timer.DelayCall( TimeSpan.FromSeconds( 10.0 ), Config.CharacterUpdateInterval, new TimerCallback( Begin ) ); + CommandSystem.Register( "InitMyRunUO", AccessLevel.Administrator, new CommandEventHandler( InitMyRunUO_OnCommand ) ); CommandSystem.Register( "UpdateMyRunUO", AccessLevel.Administrator, new CommandEventHandler( UpdateMyRunUO_OnCommand ) ); CommandSystem.Register( "PublicChar", AccessLevel.Player, new CommandEventHandler( PublicChar_OnCommand ) ); @@ -71,6 +72,46 @@ namespace Server.Engines.MyRunUO } } + [Usage( "InitMyRunUO" )] + [Description( "Initally creates the database tables." )] + public static void InitMyRunUO_OnCommand( CommandEventArgs e ) + { + if ( m_Command != null && m_Command.HasCompleted ) + { + TableCreation(); + e.Mobile.SendMessage( "MyRunUO table creation process has been started." ); + } + else + { + e.Mobile.SendMessage( "MyRunUO table creation is already running." ); + } + } + + public static void TableCreation() + { + if ( m_Command != null && !m_Command.HasCompleted ) + return; + DateTime start = DateTime.Now; + Console.WriteLine( "MyRunUO: Creating tables" ); + try + { + m_Command = new DatabaseCommandQueue( "MyRunUO: Tables created in {0:F1} seconds", "MyRunUO Status Database Thread" ); + m_Command.Enqueue( "CREATE TABLE IF NOT EXISTS `myrunuo_characters` ( `char_id` int(10) unsigned NOT NULL, `char_name` varchar(255) NOT NULL, `char_str` smallint(3) unsigned NOT NULL, `char_dex` smallint(3) unsigned NOT NULL, `char_int` smallint(3) unsigned NOT NULL, `char_female` tinyint(1) NOT NULL, `char_counts` smallint(6) NOT NULL, `char_guild` varchar(255) DEFAULT NULL, `char_guildtitle` varchar(255) DEFAULT NULL, `char_nototitle` varchar(255) DEFAULT NULL, `char_bodyhue` smallint(5) unsigned DEFAULT NULL, `char_public` tinyint(1) NOT NULL, PRIMARY KEY (`char_id`)) ENGINE=InnoDB" ); + m_Command.Enqueue( "CREATE TABLE IF NOT EXISTS `myrunuo_characters_layers` ( `char_id` int(10) unsigned NOT NULL, `layer_id` tinyint(3) unsigned NOT NULL, `item_id` smallint(5) unsigned NOT NULL, `item_hue` smallint(5) unsigned NOT NULL, PRIMARY KEY (`char_id`,`layer_id`)) ENGINE=InnoDB" ); + m_Command.Enqueue( "CREATE TABLE IF NOT EXISTS `myrunuo_characters_skills` ( `char_id` int(10) unsigned NOT NULL, `skill_id` tinyint(3) NOT NULL, `skill_value` smallint(5) unsigned NOT NULL, PRIMARY KEY (`char_id`,`skill_id`), KEY `skill_id` (`skill_id`)) ENGINE=InnoDB" ); + m_Command.Enqueue( "CREATE TABLE IF NOT EXISTS `myrunuo_guilds` ( `guild_id` smallint(5) unsigned NOT NULL, `guild_name` varchar(255) NOT NULL, `guild_abbreviation` varchar(8) DEFAULT NULL, `guild_website` varchar(255) DEFAULT NULL, `guild_charter` varchar(255) DEFAULT NULL, `guild_type` varchar(8) NOT NULL, `guild_wars` smallint(5) unsigned NOT NULL, `guild_members` smallint(5) unsigned NOT NULL, `guild_master` int(10) unsigned NOT NULL, PRIMARY KEY (`guild_id`)) ENGINE=InnoDB " ); + m_Command.Enqueue( "CREATE TABLE IF NOT EXISTS `myrunuo_guilds_wars` ( `guild_1` smallint(5) unsigned NOT NULL DEFAULT '0', `guild_2` smallint(5) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`guild_1`,`guild_2`), KEY `guild1` (`guild_1`), KEY `guild2` (`guild_2`)) ENGINE=InnoDB" ); + m_Command.Enqueue( "CREATE TABLE IF NOT EXISTS `myrunuo_status` ( `char_id` int(10) NOT NULL, PRIMARY KEY (`char_id`)) ENGINE=InnoDB DEFAULT CHARSET=latin1" ); + } + catch ( Exception e ) + { + Console.WriteLine( "MyRunUO: Error creating tables" ); + Console.WriteLine( e ); + } + if ( m_Command != null ) + m_Command.Enqueue( null ); + } + [Usage( "UpdateMyRunUO" )] [Description( "Starts the process of updating the MyRunUO character and guild database." )] public static void UpdateMyRunUO_OnCommand( CommandEventArgs e ) @@ -637,4 +678,4 @@ namespace Server.Engines.MyRunUO } } } -} \ No newline at end of file +} From 8f3813b11f48c88983c836fe90324a4fdc52db41 Mon Sep 17 00:00:00 2001 From: Xeroxxx Date: Tue, 17 Jan 2017 15:52:16 +0100 Subject: [PATCH 03/12] Typo & removed Engine=InnoDB --- Scripts/Engines/MyRunUO/MyRunUO.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Scripts/Engines/MyRunUO/MyRunUO.cs b/Scripts/Engines/MyRunUO/MyRunUO.cs index 5949ba254..96cc10d80 100644 --- a/Scripts/Engines/MyRunUO/MyRunUO.cs +++ b/Scripts/Engines/MyRunUO/MyRunUO.cs @@ -73,7 +73,7 @@ namespace Server.Engines.MyRunUO } [Usage( "InitMyRunUO" )] - [Description( "Initally creates the database tables." )] + [Description( "Initially creates the database schema." )] public static void InitMyRunUO_OnCommand( CommandEventArgs e ) { if ( m_Command != null && m_Command.HasCompleted ) @@ -96,16 +96,16 @@ namespace Server.Engines.MyRunUO try { m_Command = new DatabaseCommandQueue( "MyRunUO: Tables created in {0:F1} seconds", "MyRunUO Status Database Thread" ); - m_Command.Enqueue( "CREATE TABLE IF NOT EXISTS `myrunuo_characters` ( `char_id` int(10) unsigned NOT NULL, `char_name` varchar(255) NOT NULL, `char_str` smallint(3) unsigned NOT NULL, `char_dex` smallint(3) unsigned NOT NULL, `char_int` smallint(3) unsigned NOT NULL, `char_female` tinyint(1) NOT NULL, `char_counts` smallint(6) NOT NULL, `char_guild` varchar(255) DEFAULT NULL, `char_guildtitle` varchar(255) DEFAULT NULL, `char_nototitle` varchar(255) DEFAULT NULL, `char_bodyhue` smallint(5) unsigned DEFAULT NULL, `char_public` tinyint(1) NOT NULL, PRIMARY KEY (`char_id`)) ENGINE=InnoDB" ); - m_Command.Enqueue( "CREATE TABLE IF NOT EXISTS `myrunuo_characters_layers` ( `char_id` int(10) unsigned NOT NULL, `layer_id` tinyint(3) unsigned NOT NULL, `item_id` smallint(5) unsigned NOT NULL, `item_hue` smallint(5) unsigned NOT NULL, PRIMARY KEY (`char_id`,`layer_id`)) ENGINE=InnoDB" ); - m_Command.Enqueue( "CREATE TABLE IF NOT EXISTS `myrunuo_characters_skills` ( `char_id` int(10) unsigned NOT NULL, `skill_id` tinyint(3) NOT NULL, `skill_value` smallint(5) unsigned NOT NULL, PRIMARY KEY (`char_id`,`skill_id`), KEY `skill_id` (`skill_id`)) ENGINE=InnoDB" ); - m_Command.Enqueue( "CREATE TABLE IF NOT EXISTS `myrunuo_guilds` ( `guild_id` smallint(5) unsigned NOT NULL, `guild_name` varchar(255) NOT NULL, `guild_abbreviation` varchar(8) DEFAULT NULL, `guild_website` varchar(255) DEFAULT NULL, `guild_charter` varchar(255) DEFAULT NULL, `guild_type` varchar(8) NOT NULL, `guild_wars` smallint(5) unsigned NOT NULL, `guild_members` smallint(5) unsigned NOT NULL, `guild_master` int(10) unsigned NOT NULL, PRIMARY KEY (`guild_id`)) ENGINE=InnoDB " ); - m_Command.Enqueue( "CREATE TABLE IF NOT EXISTS `myrunuo_guilds_wars` ( `guild_1` smallint(5) unsigned NOT NULL DEFAULT '0', `guild_2` smallint(5) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`guild_1`,`guild_2`), KEY `guild1` (`guild_1`), KEY `guild2` (`guild_2`)) ENGINE=InnoDB" ); - m_Command.Enqueue( "CREATE TABLE IF NOT EXISTS `myrunuo_status` ( `char_id` int(10) NOT NULL, PRIMARY KEY (`char_id`)) ENGINE=InnoDB DEFAULT CHARSET=latin1" ); + m_Command.Enqueue( "CREATE TABLE IF NOT EXISTS `myrunuo_characters` ( `char_id` int(10) unsigned NOT NULL, `char_name` varchar(255) NOT NULL, `char_str` smallint(3) unsigned NOT NULL, `char_dex` smallint(3) unsigned NOT NULL, `char_int` smallint(3) unsigned NOT NULL, `char_female` tinyint(1) NOT NULL, `char_counts` smallint(6) NOT NULL, `char_guild` varchar(255) DEFAULT NULL, `char_guildtitle` varchar(255) DEFAULT NULL, `char_nototitle` varchar(255) DEFAULT NULL, `char_bodyhue` smallint(5) unsigned DEFAULT NULL, `char_public` tinyint(1) NOT NULL, PRIMARY KEY (`char_id`))" ); + m_Command.Enqueue( "CREATE TABLE IF NOT EXISTS `myrunuo_characters_layers` ( `char_id` int(10) unsigned NOT NULL, `layer_id` tinyint(3) unsigned NOT NULL, `item_id` smallint(5) unsigned NOT NULL, `item_hue` smallint(5) unsigned NOT NULL, PRIMARY KEY (`char_id`,`layer_id`))" ); + m_Command.Enqueue( "CREATE TABLE IF NOT EXISTS `myrunuo_characters_skills` ( `char_id` int(10) unsigned NOT NULL, `skill_id` tinyint(3) NOT NULL, `skill_value` smallint(5) unsigned NOT NULL, PRIMARY KEY (`char_id`,`skill_id`), KEY `skill_id` (`skill_id`))" ); + m_Command.Enqueue( "CREATE TABLE IF NOT EXISTS `myrunuo_guilds` ( `guild_id` smallint(5) unsigned NOT NULL, `guild_name` varchar(255) NOT NULL, `guild_abbreviation` varchar(8) DEFAULT NULL, `guild_website` varchar(255) DEFAULT NULL, `guild_charter` varchar(255) DEFAULT NULL, `guild_type` varchar(8) NOT NULL, `guild_wars` smallint(5) unsigned NOT NULL, `guild_members` smallint(5) unsigned NOT NULL, `guild_master` int(10) unsigned NOT NULL, PRIMARY KEY (`guild_id`))" ); + m_Command.Enqueue( "CREATE TABLE IF NOT EXISTS `myrunuo_guilds_wars` ( `guild_1` smallint(5) unsigned NOT NULL DEFAULT '0', `guild_2` smallint(5) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`guild_1`,`guild_2`), KEY `guild1` (`guild_1`), KEY `guild2` (`guild_2`))" ); + m_Command.Enqueue( "CREATE TABLE IF NOT EXISTS `myrunuo_status` ( `char_id` int(10) NOT NULL, PRIMARY KEY (`char_id`))" ); } catch ( Exception e ) { - Console.WriteLine( "MyRunUO: Error creating tables" ); + Console.WriteLine( "MyRunUO: Error creating tables." ); Console.WriteLine( e ); } if ( m_Command != null ) From 7df658cd000af3d8d63fda68b8f614ad63d6b6ed Mon Sep 17 00:00:00 2001 From: Pedro Pardal Date: Tue, 21 Mar 2017 17:31:08 +0100 Subject: [PATCH 04/12] Basic support for mysticism spells, scrolls, inscription craftables, mystic reagents, 6 new spells --- Scripts/Engines/Craft/Core/CraftItem.cs | 11 + Scripts/Engines/Craft/DefInscription.cs | 363 ++++++++++-------- Scripts/Items/Resources/Reagents/DeadWood.cs | 2 - .../Items/Resources/Reagents/DragonsBlood.cs | 42 ++ .../Skill Items/Magical/MysticSpellbook.cs | 45 +++ .../Scrolls/Mysticism/AnimatedWeaponScroll.cs | 40 ++ .../Scrolls/Mysticism/BombardScroll.cs | 40 ++ .../Scrolls/Mysticism/CleansingWindsScroll.cs | 40 ++ .../Scrolls/Mysticism/EagleStrikeScroll.cs | 40 ++ .../Scrolls/Mysticism/EnchantScroll.cs | 40 ++ .../Scrolls/Mysticism/HailStormScroll.cs | 40 ++ .../Scrolls/Mysticism/HealingStoneScroll.cs | 40 ++ .../Scrolls/Mysticism/MassSleepScroll.cs | 40 ++ .../Scrolls/Mysticism/NetherBoltScroll.cs | 40 ++ .../Scrolls/Mysticism/NetherCycloneScroll.cs | 40 ++ .../Scrolls/Mysticism/PurgeMagicScroll.cs | 40 ++ .../Scrolls/Mysticism/RisingColossusScroll.cs | 40 ++ .../Magical/Scrolls/Mysticism/SleepScroll.cs | 40 ++ .../Scrolls/Mysticism/SpellPlagueScroll.cs | 40 ++ .../Scrolls/Mysticism/SpellTriggerScroll.cs | 40 ++ .../Scrolls/Mysticism/StoneFormScroll.cs | 40 ++ .../Items/Skill Items/Magical/Spellbook.cs | 11 +- .../Monsters/Misc/Melee/AnimatedWeapon.cs | 110 ++++++ Scripts/Scripts.csproj | 26 ++ Scripts/Spells/Initializer.cs | 29 +- .../Spells/Mysticism/AnimatedWeaponSpell.cs | 89 +++++ Scripts/Spells/Mysticism/EagleStrikeSpell.cs | 88 +++++ Scripts/Spells/Mysticism/HailStormSpell.cs | 144 +++++++ Scripts/Spells/Mysticism/MysticSpell.cs | 92 +++++ .../Spells/Mysticism/NetherCycloneSpell.cs | 157 ++++++++ Scripts/Spells/Mysticism/SpellPlagueSpell.cs | 235 ++++++++++++ Scripts/Spells/Mysticism/StoneFormSpell.cs | 161 ++++++++ Scripts/Spells/Reagent.cs | 35 +- 33 files changed, 2118 insertions(+), 162 deletions(-) create mode 100644 Scripts/Items/Resources/Reagents/DragonsBlood.cs create mode 100644 Scripts/Items/Skill Items/Magical/MysticSpellbook.cs create mode 100644 Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/AnimatedWeaponScroll.cs create mode 100644 Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/BombardScroll.cs create mode 100644 Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/CleansingWindsScroll.cs create mode 100644 Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/EagleStrikeScroll.cs create mode 100644 Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/EnchantScroll.cs create mode 100644 Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/HailStormScroll.cs create mode 100644 Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/HealingStoneScroll.cs create mode 100644 Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/MassSleepScroll.cs create mode 100644 Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/NetherBoltScroll.cs create mode 100644 Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/NetherCycloneScroll.cs create mode 100644 Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/PurgeMagicScroll.cs create mode 100644 Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/RisingColossusScroll.cs create mode 100644 Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/SleepScroll.cs create mode 100644 Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/SpellPlagueScroll.cs create mode 100644 Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/SpellTriggerScroll.cs create mode 100644 Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/StoneFormScroll.cs create mode 100644 Scripts/Mobiles/Monsters/Misc/Melee/AnimatedWeapon.cs create mode 100644 Scripts/Spells/Mysticism/AnimatedWeaponSpell.cs create mode 100644 Scripts/Spells/Mysticism/EagleStrikeSpell.cs create mode 100644 Scripts/Spells/Mysticism/HailStormSpell.cs create mode 100644 Scripts/Spells/Mysticism/MysticSpell.cs create mode 100644 Scripts/Spells/Mysticism/NetherCycloneSpell.cs create mode 100644 Scripts/Spells/Mysticism/SpellPlagueSpell.cs create mode 100644 Scripts/Spells/Mysticism/StoneFormSpell.cs diff --git a/Scripts/Engines/Craft/Core/CraftItem.cs b/Scripts/Engines/Craft/Core/CraftItem.cs index ea91ad182..bbd878587 100644 --- a/Scripts/Engines/Craft/Core/CraftItem.cs +++ b/Scripts/Engines/Craft/Core/CraftItem.cs @@ -81,6 +81,17 @@ namespace Server.Engines.Craft m_Recipe = new Recipe( id, system, this ); } + public static int LabelNumber( Type type ) { + int number = ItemIDOf( type ); + + if ( number >= 0x4000 ) + number += 1078872; + else + number += 1020000; + + return number; + } + private static Dictionary _itemIds = new Dictionary(); public static int ItemIDOf( Type type ) { diff --git a/Scripts/Engines/Craft/DefInscription.cs b/Scripts/Engines/Craft/DefInscription.cs index 9fba6060d..f8770473d 100644 --- a/Scripts/Engines/Craft/DefInscription.cs +++ b/Scripts/Engines/Craft/DefInscription.cs @@ -22,82 +22,82 @@ namespace Server.Engines.Craft { get { - if (m_CraftSystem == null) + if ( m_CraftSystem == null ) m_CraftSystem = new DefInscription(); return m_CraftSystem; } } - public override double GetChanceAtMin(CraftItem item) + public override double GetChanceAtMin( CraftItem item ) { return 0.0; // 0% } private DefInscription() - : base(1, 1, 1.25)// base( 1, 1, 3.0 ) + : base( 1, 1, 1.25 ) // base( 1, 1, 3.0 ) { } - public override int CanCraft(Mobile from, BaseTool tool, Type typeItem) + public override int CanCraft( Mobile from, BaseTool tool, Type typeItem ) { - if (tool == null || tool.Deleted || tool.UsesRemaining < 0) + if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 ) return 1044038; // You have worn out your tool! - else if (!BaseTool.CheckAccessible(tool, from)) + if ( !BaseTool.CheckAccessible( tool, @from ) ) return 1044263; // The tool must be on your person to use. - if (typeItem != null) + if ( typeItem != null ) { - object o = Activator.CreateInstance(typeItem); + var o = Activator.CreateInstance( typeItem ); - if (o is SpellScroll) + if ( o is SpellScroll ) { - SpellScroll scroll = (SpellScroll)o; - Spellbook book = Spellbook.Find(from, scroll.SpellID); + var scroll = (SpellScroll) o; + var book = Spellbook.Find( from, scroll.SpellID ); - bool hasSpell = (book != null && book.HasSpell(scroll.SpellID)); + var hasSpell = ( book != null && book.HasSpell( scroll.SpellID ) ); scroll.Delete(); - return (hasSpell ? 0 : 1042404); // null : You don't have that spell! + return ( hasSpell ? 0 : 1042404 ); // null : You don't have that spell! } - else if (o is Item) + else if ( o is Item ) { - ((Item)o).Delete(); + ( (Item) o ).Delete(); } } return 0; } - public override void PlayCraftEffect(Mobile from) + public override void PlayCraftEffect( Mobile from ) { - from.PlaySound(0x249); + from.PlaySound( 0x249 ); } - private static Type typeofSpellScroll = typeof(SpellScroll); + private static Type typeofSpellScroll = typeof( SpellScroll ); - public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item) + public override int PlayEndingEffect( Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item ) { - if (toolBroken) - from.SendLocalizedMessage(1044038); // You have worn out your tool + if ( toolBroken ) + from.SendLocalizedMessage( 1044038 ); // You have worn out your tool - if (!typeofSpellScroll.IsAssignableFrom(item.ItemType)) // not a scroll + if ( !typeofSpellScroll.IsAssignableFrom( item.ItemType ) ) // not a scroll { - if (failed) + if ( failed ) { - if (lostMaterial) + if ( lostMaterial ) return 1044043; // You failed to create the item, and some of your materials are lost. else return 1044157; // You failed to create the item, but no materials were lost. } else { - if (quality == 0) + if ( quality == 0 ) return 502785; // You were barely able to make this item. It's quality is below average. - else if (makersMark && quality == 2) + else if ( makersMark && quality == 2 ) return 1044156; // You create an exceptional quality item and affix your maker's mark. - else if (quality == 2) + else if ( quality == 2 ) return 1044155; // You create an exceptional quality item. else return 1044154; // You create the item. @@ -105,7 +105,7 @@ namespace Server.Engines.Craft } else { - if (failed) + if ( failed ) return 501630; // You fail to inscribe the scroll, and the scroll is ruined. else return 501629; // You inscribe the spell and put the scroll in your backpack. @@ -114,64 +114,103 @@ namespace Server.Engines.Craft private int m_Circle, m_Mana; - private enum Reg { BlackPearl, Bloodmoss, Garlic, Ginseng, MandrakeRoot, Nightshade, SulfurousAsh, SpidersSilk } + private enum Reg + { + BlackPearl, + Bloodmoss, + Garlic, + Ginseng, + MandrakeRoot, + Nightshade, + SulfurousAsh, + SpidersSilk + } private Type[] m_RegTypes = new Type[] - { - typeof( BlackPearl ), - typeof( Bloodmoss ), - typeof( Garlic ), - typeof( Ginseng ), - typeof( MandrakeRoot ), - typeof( Nightshade ), - typeof( SulfurousAsh ), - typeof( SpidersSilk ) - }; + { + typeof( BlackPearl ), + typeof( Bloodmoss ), + typeof( Garlic ), + typeof( Ginseng ), + typeof( MandrakeRoot ), + typeof( Nightshade ), + typeof( SulfurousAsh ), + typeof( SpidersSilk ) + }; private int m_Index; - private void AddSpell(Type type, params Reg[] regs) + private void AddSpell( Type type, params Reg[] regs ) { double minSkill, maxSkill; - switch (m_Circle) + switch ( m_Circle ) { default: - case 0: minSkill = -25.0; maxSkill = 25.0; break; - case 1: minSkill = -10.8; maxSkill = 39.2; break; - case 2: minSkill = 03.5; maxSkill = 53.5; break; - case 3: minSkill = 17.8; maxSkill = 67.8; break; - case 4: minSkill = 32.1; maxSkill = 82.1; break; - case 5: minSkill = 46.4; maxSkill = 96.4; break; - case 6: minSkill = 60.7; maxSkill = 110.7; break; - case 7: minSkill = 75.0; maxSkill = 125.0; break; + case 0: + minSkill = -25.0; + maxSkill = 25.0; + break; + case 1: + minSkill = -10.8; + maxSkill = 39.2; + break; + case 2: + minSkill = 03.5; + maxSkill = 53.5; + break; + case 3: + minSkill = 17.8; + maxSkill = 67.8; + break; + case 4: + minSkill = 32.1; + maxSkill = 82.1; + break; + case 5: + minSkill = 46.4; + maxSkill = 96.4; + break; + case 6: + minSkill = 60.7; + maxSkill = 110.7; + break; + case 7: + minSkill = 75.0; + maxSkill = 125.0; + break; } - int index = AddCraft(type, 1044369 + m_Circle, 1044381 + m_Index++, minSkill, maxSkill, m_RegTypes[(int)regs[0]], 1044353 + (int)regs[0], 1, 1044361 + (int)regs[0]); + int index = AddCraft( type, 1044369 + m_Circle, 1044381 + m_Index++, minSkill, maxSkill, m_RegTypes[(int) regs[0]], 1044353 + (int) regs[0], 1, 1044361 + (int) regs[0] ); - for (int i = 1; i < regs.Length; ++i) - AddRes(index, m_RegTypes[(int)regs[i]], 1044353 + (int)regs[i], 1, 1044361 + (int)regs[i]); + for ( int i = 1; i < regs.Length; ++i ) + AddRes( index, m_RegTypes[(int) regs[i]], 1044353 + (int) regs[i], 1, 1044361 + (int) regs[i] ); - AddRes(index, typeof(BlankScroll), 1044377, 1, 1044378); + AddRes( index, typeof( BlankScroll ), 1044377, 1, 1044378 ); - SetManaReq(index, m_Mana); + SetManaReq( index, m_Mana ); } - private void AddNecroSpell(int spell, int mana, double minSkill, Type type, params Type[] regs) + private void AddNecroSpell( int spell, int mana, double minSkill, Type type, params Type[] regs ) { - int id = CraftItem.ItemIDOf(regs[0]); + int index = AddCraft( type, 1061677, 1060509 + spell, minSkill, minSkill + 1.0, regs[0], CraftItem.LabelNumber( regs[0] ), 1, 501627 ); //Yes, on OSI it's only 1.0 skill diff'. Don't blame me, blame OSI. - int index = AddCraft(type, 1061677, 1060509 + spell, minSkill, minSkill + 1.0, regs[0], id < 0x4000 ? 1020000 + id : 1078872 + id, 1, 501627); //Yes, on OSI it's only 1.0 skill diff'. Don't blame me, blame OSI. + for ( int i = 1; i < regs.Length; ++i ) + AddRes( index, regs[i], CraftItem.LabelNumber( regs[0] ), 1, 501627 ); - for (int i = 1; i < regs.Length; ++i) - { - id = CraftItem.ItemIDOf(regs[i]); - AddRes(index, regs[i], id < 0x4000 ? 1020000 + id : 1078872 + id, 1, 501627); - } + AddRes( index, typeof( BlankScroll ), 1044377, 1, 1044378 ); + SetManaReq( index, mana ); + } - AddRes(index, typeof(BlankScroll), 1044377, 1, 1044378); + private void AddMysticismSpell( int spell, int mana, double minSkill, double maxSkill, Type type, params Type[] regs ) + { + int index = AddCraft( type, 1111671, 1031678 + spell, minSkill, maxSkill, regs[0], CraftItem.LabelNumber( regs[0] ), 1, 501627 ); - SetManaReq(index, mana); + for ( int i = 1; i < regs.Length; ++i ) + AddRes( index, regs[i], CraftItem.LabelNumber( regs[i] ), 1, 501627 ); + + AddRes( index, typeof( BlankScroll ), 1044377, 1, 1044378 ); + SetManaReq( index, mana) ; } public override void InitCraftList() @@ -179,118 +218,118 @@ namespace Server.Engines.Craft m_Circle = 0; m_Mana = 4; - AddSpell(typeof(ReactiveArmorScroll), Reg.Garlic, Reg.SpidersSilk, Reg.SulfurousAsh); - AddSpell(typeof(ClumsyScroll), Reg.Bloodmoss, Reg.Nightshade); - AddSpell(typeof(CreateFoodScroll), Reg.Garlic, Reg.Ginseng, Reg.MandrakeRoot); - AddSpell(typeof(FeeblemindScroll), Reg.Nightshade, Reg.Ginseng); - AddSpell(typeof(HealScroll), Reg.Garlic, Reg.Ginseng, Reg.SpidersSilk); - AddSpell(typeof(MagicArrowScroll), Reg.SulfurousAsh); - AddSpell(typeof(NightSightScroll), Reg.SpidersSilk, Reg.SulfurousAsh); - AddSpell(typeof(WeakenScroll), Reg.Garlic, Reg.Nightshade); + AddSpell( typeof( ReactiveArmorScroll ), Reg.Garlic, Reg.SpidersSilk, Reg.SulfurousAsh ); + AddSpell( typeof( ClumsyScroll ), Reg.Bloodmoss, Reg.Nightshade ); + AddSpell( typeof( CreateFoodScroll ), Reg.Garlic, Reg.Ginseng, Reg.MandrakeRoot ); + AddSpell( typeof( FeeblemindScroll ), Reg.Nightshade, Reg.Ginseng ); + AddSpell( typeof( HealScroll ), Reg.Garlic, Reg.Ginseng, Reg.SpidersSilk ); + AddSpell( typeof( MagicArrowScroll ), Reg.SulfurousAsh ); + AddSpell( typeof( NightSightScroll ), Reg.SpidersSilk, Reg.SulfurousAsh ); + AddSpell( typeof( WeakenScroll ), Reg.Garlic, Reg.Nightshade ); m_Circle = 1; m_Mana = 6; - AddSpell(typeof(AgilityScroll), Reg.Bloodmoss, Reg.MandrakeRoot); - AddSpell(typeof(CunningScroll), Reg.Nightshade, Reg.MandrakeRoot); - AddSpell(typeof(CureScroll), Reg.Garlic, Reg.Ginseng); - AddSpell(typeof(HarmScroll), Reg.Nightshade, Reg.SpidersSilk); - AddSpell(typeof(MagicTrapScroll), Reg.Garlic, Reg.SpidersSilk, Reg.SulfurousAsh); - AddSpell(typeof(MagicUnTrapScroll), Reg.Bloodmoss, Reg.SulfurousAsh); - AddSpell(typeof(ProtectionScroll), Reg.Garlic, Reg.Ginseng, Reg.SulfurousAsh); - AddSpell(typeof(StrengthScroll), Reg.Nightshade, Reg.MandrakeRoot); + AddSpell( typeof( AgilityScroll ), Reg.Bloodmoss, Reg.MandrakeRoot ); + AddSpell( typeof( CunningScroll ), Reg.Nightshade, Reg.MandrakeRoot ); + AddSpell( typeof( CureScroll ), Reg.Garlic, Reg.Ginseng ); + AddSpell( typeof( HarmScroll ), Reg.Nightshade, Reg.SpidersSilk ); + AddSpell( typeof( MagicTrapScroll ), Reg.Garlic, Reg.SpidersSilk, Reg.SulfurousAsh ); + AddSpell( typeof( MagicUnTrapScroll ), Reg.Bloodmoss, Reg.SulfurousAsh ); + AddSpell( typeof( ProtectionScroll ), Reg.Garlic, Reg.Ginseng, Reg.SulfurousAsh ); + AddSpell( typeof( StrengthScroll ), Reg.Nightshade, Reg.MandrakeRoot ); m_Circle = 2; m_Mana = 9; - AddSpell(typeof(BlessScroll), Reg.Garlic, Reg.MandrakeRoot); - AddSpell(typeof(FireballScroll), Reg.BlackPearl); - AddSpell(typeof(MagicLockScroll), Reg.Bloodmoss, Reg.Garlic, Reg.SulfurousAsh); - AddSpell(typeof(PoisonScroll), Reg.Nightshade); - AddSpell(typeof(TelekinisisScroll), Reg.Bloodmoss, Reg.MandrakeRoot); - AddSpell(typeof(TeleportScroll), Reg.Bloodmoss, Reg.MandrakeRoot); - AddSpell(typeof(UnlockScroll), Reg.Bloodmoss, Reg.SulfurousAsh); - AddSpell(typeof(WallOfStoneScroll), Reg.Bloodmoss, Reg.Garlic); + AddSpell( typeof( BlessScroll ), Reg.Garlic, Reg.MandrakeRoot ); + AddSpell( typeof( FireballScroll ), Reg.BlackPearl ); + AddSpell( typeof( MagicLockScroll ), Reg.Bloodmoss, Reg.Garlic, Reg.SulfurousAsh ); + AddSpell( typeof( PoisonScroll ), Reg.Nightshade ); + AddSpell( typeof( TelekinisisScroll ), Reg.Bloodmoss, Reg.MandrakeRoot ); + AddSpell( typeof( TeleportScroll ), Reg.Bloodmoss, Reg.MandrakeRoot ); + AddSpell( typeof( UnlockScroll ), Reg.Bloodmoss, Reg.SulfurousAsh ); + AddSpell( typeof( WallOfStoneScroll ), Reg.Bloodmoss, Reg.Garlic ); m_Circle = 3; m_Mana = 11; - AddSpell(typeof(ArchCureScroll), Reg.Garlic, Reg.Ginseng, Reg.MandrakeRoot); - AddSpell(typeof(ArchProtectionScroll), Reg.Garlic, Reg.Ginseng, Reg.MandrakeRoot, Reg.SulfurousAsh); - AddSpell(typeof(CurseScroll), Reg.Garlic, Reg.Nightshade, Reg.SulfurousAsh); - AddSpell(typeof(FireFieldScroll), Reg.BlackPearl, Reg.SpidersSilk, Reg.SulfurousAsh); - AddSpell(typeof(GreaterHealScroll), Reg.Garlic, Reg.SpidersSilk, Reg.MandrakeRoot, Reg.Ginseng); - AddSpell(typeof(LightningScroll), Reg.MandrakeRoot, Reg.SulfurousAsh); - AddSpell(typeof(ManaDrainScroll), Reg.BlackPearl, Reg.SpidersSilk, Reg.MandrakeRoot); - AddSpell(typeof(RecallScroll), Reg.BlackPearl, Reg.Bloodmoss, Reg.MandrakeRoot); + AddSpell( typeof( ArchCureScroll ), Reg.Garlic, Reg.Ginseng, Reg.MandrakeRoot ); + AddSpell( typeof( ArchProtectionScroll ), Reg.Garlic, Reg.Ginseng, Reg.MandrakeRoot, Reg.SulfurousAsh ); + AddSpell( typeof( CurseScroll ), Reg.Garlic, Reg.Nightshade, Reg.SulfurousAsh ); + AddSpell( typeof( FireFieldScroll ), Reg.BlackPearl, Reg.SpidersSilk, Reg.SulfurousAsh ); + AddSpell( typeof( GreaterHealScroll ), Reg.Garlic, Reg.SpidersSilk, Reg.MandrakeRoot, Reg.Ginseng ); + AddSpell( typeof( LightningScroll ), Reg.MandrakeRoot, Reg.SulfurousAsh ); + AddSpell( typeof( ManaDrainScroll ), Reg.BlackPearl, Reg.SpidersSilk, Reg.MandrakeRoot ); + AddSpell( typeof( RecallScroll ), Reg.BlackPearl, Reg.Bloodmoss, Reg.MandrakeRoot ); m_Circle = 4; m_Mana = 14; - AddSpell(typeof(BladeSpiritsScroll), Reg.BlackPearl, Reg.Nightshade, Reg.MandrakeRoot); - AddSpell(typeof(DispelFieldScroll), Reg.BlackPearl, Reg.Garlic, Reg.SpidersSilk, Reg.SulfurousAsh); - AddSpell(typeof(IncognitoScroll), Reg.Bloodmoss, Reg.Garlic, Reg.Nightshade); - AddSpell(typeof(MagicReflectScroll), Reg.Garlic, Reg.MandrakeRoot, Reg.SpidersSilk); - AddSpell(typeof(MindBlastScroll), Reg.BlackPearl, Reg.MandrakeRoot, Reg.Nightshade, Reg.SulfurousAsh); - AddSpell(typeof(ParalyzeScroll), Reg.Garlic, Reg.MandrakeRoot, Reg.SpidersSilk); - AddSpell(typeof(PoisonFieldScroll), Reg.BlackPearl, Reg.Nightshade, Reg.SpidersSilk); - AddSpell(typeof(SummonCreatureScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk); + AddSpell( typeof( BladeSpiritsScroll ), Reg.BlackPearl, Reg.Nightshade, Reg.MandrakeRoot ); + AddSpell( typeof( DispelFieldScroll ), Reg.BlackPearl, Reg.Garlic, Reg.SpidersSilk, Reg.SulfurousAsh ); + AddSpell( typeof( IncognitoScroll ), Reg.Bloodmoss, Reg.Garlic, Reg.Nightshade ); + AddSpell( typeof( MagicReflectScroll ), Reg.Garlic, Reg.MandrakeRoot, Reg.SpidersSilk ); + AddSpell( typeof( MindBlastScroll ), Reg.BlackPearl, Reg.MandrakeRoot, Reg.Nightshade, Reg.SulfurousAsh ); + AddSpell( typeof( ParalyzeScroll ), Reg.Garlic, Reg.MandrakeRoot, Reg.SpidersSilk ); + AddSpell( typeof( PoisonFieldScroll ), Reg.BlackPearl, Reg.Nightshade, Reg.SpidersSilk ); + AddSpell( typeof( SummonCreatureScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk ); m_Circle = 5; m_Mana = 20; - AddSpell(typeof(DispelScroll), Reg.Garlic, Reg.MandrakeRoot, Reg.SulfurousAsh); - AddSpell(typeof(EnergyBoltScroll), Reg.BlackPearl, Reg.Nightshade); - AddSpell(typeof(ExplosionScroll), Reg.Bloodmoss, Reg.MandrakeRoot); - AddSpell(typeof(InvisibilityScroll), Reg.Bloodmoss, Reg.Nightshade); - AddSpell(typeof(MarkScroll), Reg.Bloodmoss, Reg.BlackPearl, Reg.MandrakeRoot); - AddSpell(typeof(MassCurseScroll), Reg.Garlic, Reg.MandrakeRoot, Reg.Nightshade, Reg.SulfurousAsh); - AddSpell(typeof(ParalyzeFieldScroll), Reg.BlackPearl, Reg.Ginseng, Reg.SpidersSilk); - AddSpell(typeof(RevealScroll), Reg.Bloodmoss, Reg.SulfurousAsh); + AddSpell( typeof( DispelScroll ), Reg.Garlic, Reg.MandrakeRoot, Reg.SulfurousAsh ); + AddSpell( typeof( EnergyBoltScroll ), Reg.BlackPearl, Reg.Nightshade ); + AddSpell( typeof( ExplosionScroll ), Reg.Bloodmoss, Reg.MandrakeRoot ); + AddSpell( typeof( InvisibilityScroll ), Reg.Bloodmoss, Reg.Nightshade ); + AddSpell( typeof( MarkScroll ), Reg.Bloodmoss, Reg.BlackPearl, Reg.MandrakeRoot ); + AddSpell( typeof( MassCurseScroll ), Reg.Garlic, Reg.MandrakeRoot, Reg.Nightshade, Reg.SulfurousAsh ); + AddSpell( typeof( ParalyzeFieldScroll ), Reg.BlackPearl, Reg.Ginseng, Reg.SpidersSilk ); + AddSpell( typeof( RevealScroll ), Reg.Bloodmoss, Reg.SulfurousAsh ); m_Circle = 6; m_Mana = 40; - AddSpell(typeof(ChainLightningScroll), Reg.BlackPearl, Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SulfurousAsh); - AddSpell(typeof(EnergyFieldScroll), Reg.BlackPearl, Reg.MandrakeRoot, Reg.SpidersSilk, Reg.SulfurousAsh); - AddSpell(typeof(FlamestrikeScroll), Reg.SpidersSilk, Reg.SulfurousAsh); - AddSpell(typeof(GateTravelScroll), Reg.BlackPearl, Reg.MandrakeRoot, Reg.SulfurousAsh); - AddSpell(typeof(ManaVampireScroll), Reg.BlackPearl, Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk); - AddSpell(typeof(MassDispelScroll), Reg.BlackPearl, Reg.Garlic, Reg.MandrakeRoot, Reg.SulfurousAsh); - AddSpell(typeof(MeteorSwarmScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SulfurousAsh, Reg.SpidersSilk); - AddSpell(typeof(PolymorphScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk); + AddSpell( typeof( ChainLightningScroll ), Reg.BlackPearl, Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SulfurousAsh ); + AddSpell( typeof( EnergyFieldScroll ), Reg.BlackPearl, Reg.MandrakeRoot, Reg.SpidersSilk, Reg.SulfurousAsh ); + AddSpell( typeof( FlamestrikeScroll ), Reg.SpidersSilk, Reg.SulfurousAsh ); + AddSpell( typeof( GateTravelScroll ), Reg.BlackPearl, Reg.MandrakeRoot, Reg.SulfurousAsh ); + AddSpell( typeof( ManaVampireScroll ), Reg.BlackPearl, Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk ); + AddSpell( typeof( MassDispelScroll ), Reg.BlackPearl, Reg.Garlic, Reg.MandrakeRoot, Reg.SulfurousAsh ); + AddSpell( typeof( MeteorSwarmScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SulfurousAsh, Reg.SpidersSilk ); + AddSpell( typeof( PolymorphScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk ); m_Circle = 7; m_Mana = 50; - AddSpell(typeof(EarthquakeScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.Ginseng, Reg.SulfurousAsh); - AddSpell(typeof(EnergyVortexScroll), Reg.BlackPearl, Reg.Bloodmoss, Reg.MandrakeRoot, Reg.Nightshade); - AddSpell(typeof(ResurrectionScroll), Reg.Bloodmoss, Reg.Garlic, Reg.Ginseng); - AddSpell(typeof(SummonAirElementalScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk); - AddSpell(typeof(SummonDaemonScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk, Reg.SulfurousAsh); - AddSpell(typeof(SummonEarthElementalScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk); - AddSpell(typeof(SummonFireElementalScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk, Reg.SulfurousAsh); - AddSpell(typeof(SummonWaterElementalScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk); + AddSpell( typeof( EarthquakeScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.Ginseng, Reg.SulfurousAsh ); + AddSpell( typeof( EnergyVortexScroll ), Reg.BlackPearl, Reg.Bloodmoss, Reg.MandrakeRoot, Reg.Nightshade ); + AddSpell( typeof( ResurrectionScroll ), Reg.Bloodmoss, Reg.Garlic, Reg.Ginseng ); + AddSpell( typeof( SummonAirElementalScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk ); + AddSpell( typeof( SummonDaemonScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk, Reg.SulfurousAsh ); + AddSpell( typeof( SummonEarthElementalScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk ); + AddSpell( typeof( SummonFireElementalScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk, Reg.SulfurousAsh ); + AddSpell( typeof( SummonWaterElementalScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk ); - if (Core.SE) + if ( Core.SE ) { - AddNecroSpell(0, 23, 39.6, typeof(AnimateDeadScroll), Reagent.GraveDust, Reagent.DaemonBlood); - AddNecroSpell(1, 13, 19.6, typeof(BloodOathScroll), Reagent.DaemonBlood); - AddNecroSpell(2, 11, 19.6, typeof(CorpseSkinScroll), Reagent.BatWing, Reagent.GraveDust); - AddNecroSpell(3, 7, 19.6, typeof(CurseWeaponScroll), Reagent.PigIron); - AddNecroSpell(4, 11, 19.6, typeof(EvilOmenScroll), Reagent.BatWing, Reagent.NoxCrystal); - AddNecroSpell(5, 11, 39.6, typeof(HorrificBeastScroll), Reagent.BatWing, Reagent.DaemonBlood); - AddNecroSpell(6, 23, 69.6, typeof(LichFormScroll), Reagent.GraveDust, Reagent.DaemonBlood, Reagent.NoxCrystal); - AddNecroSpell(7, 17, 29.6, typeof(MindRotScroll), Reagent.BatWing, Reagent.DaemonBlood, Reagent.PigIron); - AddNecroSpell(8, 5, 19.6, typeof(PainSpikeScroll), Reagent.GraveDust, Reagent.PigIron); - AddNecroSpell(9, 17, 49.6, typeof(PoisonStrikeScroll), Reagent.NoxCrystal); - AddNecroSpell(10, 29, 64.6, typeof(StrangleScroll), Reagent.DaemonBlood, Reagent.NoxCrystal); - AddNecroSpell(11, 17, 29.6, typeof(SummonFamiliarScroll), Reagent.BatWing, Reagent.GraveDust, Reagent.DaemonBlood); - AddNecroSpell(12, 23, 98.6, typeof(VampiricEmbraceScroll), Reagent.BatWing, Reagent.NoxCrystal, Reagent.PigIron); - AddNecroSpell(13, 41, 79.6, typeof(VengefulSpiritScroll), Reagent.BatWing, Reagent.GraveDust, Reagent.PigIron); - AddNecroSpell(14, 23, 59.6, typeof(WitherScroll), Reagent.GraveDust, Reagent.NoxCrystal, Reagent.PigIron); - AddNecroSpell(15, 17, 79.6, typeof(WraithFormScroll), Reagent.NoxCrystal, Reagent.PigIron); - AddNecroSpell(16, 40, 79.6, typeof(ExorcismScroll), Reagent.NoxCrystal, Reagent.GraveDust); + AddNecroSpell( 0, 23, 39.6, typeof( AnimateDeadScroll ), Reagent.GraveDust, Reagent.DaemonBlood ); + AddNecroSpell( 1, 13, 19.6, typeof( BloodOathScroll ), Reagent.DaemonBlood ); + AddNecroSpell( 2, 11, 19.6, typeof( CorpseSkinScroll ), Reagent.BatWing, Reagent.GraveDust ); + AddNecroSpell( 3, 7, 19.6, typeof( CurseWeaponScroll ), Reagent.PigIron ); + AddNecroSpell( 4, 11, 19.6, typeof( EvilOmenScroll ), Reagent.BatWing, Reagent.NoxCrystal ); + AddNecroSpell( 5, 11, 39.6, typeof( HorrificBeastScroll ), Reagent.BatWing, Reagent.DaemonBlood ); + AddNecroSpell( 6, 23, 69.6, typeof( LichFormScroll ), Reagent.GraveDust, Reagent.DaemonBlood, Reagent.NoxCrystal ); + AddNecroSpell( 7, 17, 29.6, typeof( MindRotScroll ), Reagent.BatWing, Reagent.DaemonBlood, Reagent.PigIron ); + AddNecroSpell( 8, 5, 19.6, typeof( PainSpikeScroll ), Reagent.GraveDust, Reagent.PigIron ); + AddNecroSpell( 9, 17, 49.6, typeof( PoisonStrikeScroll ), Reagent.NoxCrystal ); + AddNecroSpell( 10, 29, 64.6, typeof( StrangleScroll ), Reagent.DaemonBlood, Reagent.NoxCrystal ); + AddNecroSpell( 11, 17, 29.6, typeof( SummonFamiliarScroll ), Reagent.BatWing, Reagent.GraveDust, Reagent.DaemonBlood ); + AddNecroSpell( 12, 23, 98.6, typeof( VampiricEmbraceScroll ), Reagent.BatWing, Reagent.NoxCrystal, Reagent.PigIron ); + AddNecroSpell( 13, 41, 79.6, typeof( VengefulSpiritScroll ), Reagent.BatWing, Reagent.GraveDust, Reagent.PigIron ); + AddNecroSpell( 14, 23, 59.6, typeof( WitherScroll ), Reagent.GraveDust, Reagent.NoxCrystal, Reagent.PigIron ); + AddNecroSpell( 15, 17, 79.6, typeof( WraithFormScroll ), Reagent.NoxCrystal, Reagent.PigIron ); + AddNecroSpell( 16, 40, 79.6, typeof( ExorcismScroll ), Reagent.NoxCrystal, Reagent.GraveDust ); } int index; @@ -303,7 +342,7 @@ namespace Server.Engines.Craft AddRes( index, typeof( SwitchItem ), 1073464, 1, 1044253 ); ForceNonExceptional( index ); SetNeededExpansion( index, Expansion.ML ); - + index = AddCraft( typeof( RunedPrism ), 1044294, 1073465, 45.0, 95.0, typeof( BlankScroll ), 1044377, 1, 1044378 ); AddRes( index, typeof( SpidersSilk ), 1044360, 1, 1044253 ); AddRes( index, typeof( BlackPearl ), 1044353, 1, 1044253 ); @@ -317,14 +356,14 @@ namespace Server.Engines.Craft AddRes( index, typeof( RecallScroll ), 1044445, 1, 1044253 ); AddRes( index, typeof( GateTravelScroll ), 1044446, 1, 1044253 ); - if (Core.AOS) + if ( Core.AOS ) { - AddCraft(typeof(Engines.BulkOrders.BulkOrderBook), 1044294, 1028793, 65.0, 115.0, typeof(BlankScroll), 1044377, 10, 1044378); + AddCraft( typeof( BulkOrders.BulkOrderBook ), 1044294, 1028793, 65.0, 115.0, typeof( BlankScroll ), 1044377, 10, 1044378 ); } - if (Core.SE) + if ( Core.SE ) { - AddCraft(typeof(Spellbook), 1044294, 1023834, 50.0, 126, typeof(BlankScroll), 1044377, 10, 1044378); + AddCraft( typeof( Spellbook ), 1044294, 1023834, 50.0, 126, typeof( BlankScroll ), 1044377, 10, 1044378 ); } /* TODO @@ -340,6 +379,28 @@ namespace Server.Engines.Craft } */ + if ( Core.SA ) + { + AddCraft( typeof( MysticSpellbook ), 1044294, 1031677, 50.0, 150.0, typeof( BlankScroll ), 1044377, 10, 1044378 ); + + AddMysticismSpell( 0, 4, -25.0, 25.0, typeof( NetherBoltScroll ), Reagent.BlackPearl, Reagent.SulfurousAsh ); + AddMysticismSpell( 1, 4, -25.0, 25.0, typeof( HealingStoneScroll ), Reagent.Bone, Reagent.Garlic, Reagent.Ginseng, Reagent.SpidersSilk ); + AddMysticismSpell( 2, 6, -10.8, 39.2, typeof( PurgeMagicScroll ), Reagent.FertileDirt, Reagent.Garlic, Reagent.MandrakeRoot, Reagent.SulfurousAsh ); + AddMysticismSpell( 3, 6, -10.8, 39.2, typeof( EnchantScroll ), Reagent.SpidersSilk, Reagent.MandrakeRoot, Reagent.SulfurousAsh ); + AddMysticismSpell( 4, 9, 3.5, 53.5, typeof( SleepScroll ), Reagent.Nightshade, Reagent.SpidersSilk, Reagent.BlackPearl ); + AddMysticismSpell( 5, 9, 3.5, 53.5, typeof( EagleStrikeScroll ), Reagent.Bloodmoss, Reagent.Bone, Reagent.SpidersSilk, Reagent.MandrakeRoot ); + AddMysticismSpell( 6, 11, 17.8, 67.8, typeof( AnimatedWeaponScroll ), Reagent.Bone, Reagent.BlackPearl, Reagent.MandrakeRoot, Reagent.Nightshade ); + AddMysticismSpell( 7, 11, 17.8, 67.8, typeof( StoneFormScroll ), Reagent.Bloodmoss, Reagent.FertileDirt, Reagent.Garlic ); + AddMysticismSpell( 8, 14, 32.1, 82.1, typeof( SpellTriggerScroll ), Reagent.DragonsBlood, Reagent.Garlic, Reagent.MandrakeRoot, Reagent.SpidersSilk ); + AddMysticismSpell( 9, 14, 32.1, 82.1, typeof( MassSleepScroll ), Reagent.Ginseng, Reagent.Nightshade, Reagent.SpidersSilk ); + AddMysticismSpell( 10, 20, 46.4, 96.4, typeof( CleansingWindsScroll ), Reagent.DragonsBlood, Reagent.Garlic, Reagent.Ginseng, Reagent.MandrakeRoot ); + AddMysticismSpell( 11, 20, 46.4, 96.4, typeof( BombardScroll ), Reagent.Bloodmoss, Reagent.DragonsBlood, Reagent.Garlic, Reagent.SulfurousAsh ); + AddMysticismSpell( 12, 40, 60.7, 110.7, typeof( SpellPlagueScroll ), Reagent.DaemonBone, Reagent.DragonsBlood, Reagent.Nightshade, Reagent.SulfurousAsh ); + AddMysticismSpell( 13, 40, 60.7, 110.7, typeof( HailStormScroll ), Reagent.DragonsBlood, Reagent.Bloodmoss, Reagent.BlackPearl, Reagent.MandrakeRoot ); + AddMysticismSpell( 14, 50, 75.0, 125.0, typeof( NetherCycloneScroll ), Reagent.MandrakeRoot, Reagent.Nightshade, Reagent.SulfurousAsh, Reagent.Bloodmoss ); + AddMysticismSpell( 15, 50, 75.0, 125.0, typeof( RisingColossusScroll ), Reagent.DaemonBone, Reagent.DragonsBlood, Reagent.FertileDirt, Reagent.Nightshade ); + } + MarkOption = true; } } diff --git a/Scripts/Items/Resources/Reagents/DeadWood.cs b/Scripts/Items/Resources/Reagents/DeadWood.cs index cdadcb499..40a1af589 100644 --- a/Scripts/Items/Resources/Reagents/DeadWood.cs +++ b/Scripts/Items/Resources/Reagents/DeadWood.cs @@ -23,8 +23,6 @@ namespace Server.Items { } - - public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); diff --git a/Scripts/Items/Resources/Reagents/DragonsBlood.cs b/Scripts/Items/Resources/Reagents/DragonsBlood.cs new file mode 100644 index 000000000..c9d4c98b6 --- /dev/null +++ b/Scripts/Items/Resources/Reagents/DragonsBlood.cs @@ -0,0 +1,42 @@ +using System; +using Server; + +namespace Server.Items +{ + public class DragonsBlood : BaseReagent, ICommodity + { + int ICommodity.DescriptionNumber { get { return LabelNumber; } } + bool ICommodity.IsDeedable { get { return Core.ML; } } + + [Constructable] + public DragonsBlood() + : this( 1 ) + { + } + + [Constructable] + public DragonsBlood( int amount ) + : base( 0x4077, amount ) + { + } + + public DragonsBlood( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadInt(); + } + } +} diff --git a/Scripts/Items/Skill Items/Magical/MysticSpellbook.cs b/Scripts/Items/Skill Items/Magical/MysticSpellbook.cs new file mode 100644 index 000000000..5462a0706 --- /dev/null +++ b/Scripts/Items/Skill Items/Magical/MysticSpellbook.cs @@ -0,0 +1,45 @@ +using System; + +namespace Server.Items +{ + public class MysticSpellbook : Spellbook + { + public override SpellbookType SpellbookType { get { return SpellbookType.Mystic; } } + + public override int BookOffset { get { return 677; } } + public override int BookCount { get { return 16; } } + + [Constructable] + public MysticSpellbook() + : this( (ulong) 0 ) + { + } + + [Constructable] + public MysticSpellbook( ulong content ) + : base( content, 0x2D9D ) + { + Layer = Layer.OneHanded; + } + + public MysticSpellbook( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + /*int version = */ + reader.ReadInt(); + } + } +} diff --git a/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/AnimatedWeaponScroll.cs b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/AnimatedWeaponScroll.cs new file mode 100644 index 000000000..bb9db65e3 --- /dev/null +++ b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/AnimatedWeaponScroll.cs @@ -0,0 +1,40 @@ +using System; +using Server; + +namespace Server.Items +{ + public class AnimatedWeaponScroll : SpellScroll + { + [Constructable] + public AnimatedWeaponScroll() + : this( 1 ) + { + } + + [Constructable] + public AnimatedWeaponScroll( int amount ) + : base( 683, 0x2DA4, amount ) + { + } + + public AnimatedWeaponScroll( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + /*int version = */ + reader.ReadInt(); + } + } +} diff --git a/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/BombardScroll.cs b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/BombardScroll.cs new file mode 100644 index 000000000..41131f1ce --- /dev/null +++ b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/BombardScroll.cs @@ -0,0 +1,40 @@ +using System; +using Server; + +namespace Server.Items +{ + public class BombardScroll : SpellScroll + { + [Constructable] + public BombardScroll() + : this( 1 ) + { + } + + [Constructable] + public BombardScroll( int amount ) + : base( 688, 0x2DA9, amount ) + { + } + + public BombardScroll( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + /*int version = */ + reader.ReadInt(); + } + } +} diff --git a/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/CleansingWindsScroll.cs b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/CleansingWindsScroll.cs new file mode 100644 index 000000000..976a51293 --- /dev/null +++ b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/CleansingWindsScroll.cs @@ -0,0 +1,40 @@ +using System; +using Server; + +namespace Server.Items +{ + public class CleansingWindsScroll : SpellScroll + { + [Constructable] + public CleansingWindsScroll() + : this( 1 ) + { + } + + [Constructable] + public CleansingWindsScroll( int amount ) + : base( 687, 0x2DA8, amount ) + { + } + + public CleansingWindsScroll( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + /*int version = */ + reader.ReadInt(); + } + } +} diff --git a/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/EagleStrikeScroll.cs b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/EagleStrikeScroll.cs new file mode 100644 index 000000000..6da8aafef --- /dev/null +++ b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/EagleStrikeScroll.cs @@ -0,0 +1,40 @@ +using System; +using Server; + +namespace Server.Items +{ + public class EagleStrikeScroll : SpellScroll + { + [Constructable] + public EagleStrikeScroll() + : this( 1 ) + { + } + + [Constructable] + public EagleStrikeScroll( int amount ) + : base( 682, 0x2DA3, amount ) + { + } + + public EagleStrikeScroll( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + /*int version = */ + reader.ReadInt(); + } + } +} diff --git a/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/EnchantScroll.cs b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/EnchantScroll.cs new file mode 100644 index 000000000..b32593a79 --- /dev/null +++ b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/EnchantScroll.cs @@ -0,0 +1,40 @@ +using System; +using Server; + +namespace Server.Items +{ + public class EnchantScroll : SpellScroll + { + [Constructable] + public EnchantScroll() + : this( 1 ) + { + } + + [Constructable] + public EnchantScroll( int amount ) + : base( 680, 0x2DA1, amount ) + { + } + + public EnchantScroll( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + /*int version = */ + reader.ReadInt(); + } + } +} diff --git a/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/HailStormScroll.cs b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/HailStormScroll.cs new file mode 100644 index 000000000..1c1b9a596 --- /dev/null +++ b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/HailStormScroll.cs @@ -0,0 +1,40 @@ +using System; +using Server; + +namespace Server.Items +{ + public class HailStormScroll : SpellScroll + { + [Constructable] + public HailStormScroll() + : this( 1 ) + { + } + + [Constructable] + public HailStormScroll( int amount ) + : base( 690, 0x2DAB, amount ) + { + } + + public HailStormScroll( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + /*int version = */ + reader.ReadInt(); + } + } +} diff --git a/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/HealingStoneScroll.cs b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/HealingStoneScroll.cs new file mode 100644 index 000000000..d69781c74 --- /dev/null +++ b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/HealingStoneScroll.cs @@ -0,0 +1,40 @@ +using System; +using Server; + +namespace Server.Items +{ + public class HealingStoneScroll : SpellScroll + { + [Constructable] + public HealingStoneScroll() + : this( 1 ) + { + } + + [Constructable] + public HealingStoneScroll( int amount ) + : base( 678, 0x2D9F, amount ) + { + } + + public HealingStoneScroll( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + /*int version = */ + reader.ReadInt(); + } + } +} diff --git a/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/MassSleepScroll.cs b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/MassSleepScroll.cs new file mode 100644 index 000000000..48fffdbee --- /dev/null +++ b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/MassSleepScroll.cs @@ -0,0 +1,40 @@ +using System; +using Server; + +namespace Server.Items +{ + public class MassSleepScroll : SpellScroll + { + [Constructable] + public MassSleepScroll() + : this( 1 ) + { + } + + [Constructable] + public MassSleepScroll( int amount ) + : base( 686, 0x2DA7, amount ) + { + } + + public MassSleepScroll( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + /*int version = */ + reader.ReadInt(); + } + } +} diff --git a/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/NetherBoltScroll.cs b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/NetherBoltScroll.cs new file mode 100644 index 000000000..90112b8cc --- /dev/null +++ b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/NetherBoltScroll.cs @@ -0,0 +1,40 @@ +using System; +using Server; + +namespace Server.Items +{ + public class NetherBoltScroll : SpellScroll + { + [Constructable] + public NetherBoltScroll() + : this( 1 ) + { + } + + [Constructable] + public NetherBoltScroll( int amount ) + : base( 677, 0x2D9E, amount ) + { + } + + public NetherBoltScroll( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + /*int version = */ + reader.ReadInt(); + } + } +} diff --git a/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/NetherCycloneScroll.cs b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/NetherCycloneScroll.cs new file mode 100644 index 000000000..fc3aac234 --- /dev/null +++ b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/NetherCycloneScroll.cs @@ -0,0 +1,40 @@ +using System; +using Server; + +namespace Server.Items +{ + public class NetherCycloneScroll : SpellScroll + { + [Constructable] + public NetherCycloneScroll() + : this( 1 ) + { + } + + [Constructable] + public NetherCycloneScroll( int amount ) + : base( 691, 0x2DAC, amount ) + { + } + + public NetherCycloneScroll( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + /*int version = */ + reader.ReadInt(); + } + } +} diff --git a/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/PurgeMagicScroll.cs b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/PurgeMagicScroll.cs new file mode 100644 index 000000000..95298109f --- /dev/null +++ b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/PurgeMagicScroll.cs @@ -0,0 +1,40 @@ +using System; +using Server; + +namespace Server.Items +{ + public class PurgeMagicScroll : SpellScroll + { + [Constructable] + public PurgeMagicScroll() + : this( 1 ) + { + } + + [Constructable] + public PurgeMagicScroll( int amount ) + : base( 679, 0x2DA0, amount ) + { + } + + public PurgeMagicScroll( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + /*int version = */ + reader.ReadInt(); + } + } +} diff --git a/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/RisingColossusScroll.cs b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/RisingColossusScroll.cs new file mode 100644 index 000000000..df93ee1dd --- /dev/null +++ b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/RisingColossusScroll.cs @@ -0,0 +1,40 @@ +using System; +using Server; + +namespace Server.Items +{ + public class RisingColossusScroll : SpellScroll + { + [Constructable] + public RisingColossusScroll() + : this( 1 ) + { + } + + [Constructable] + public RisingColossusScroll( int amount ) + : base( 692, 0x2DAD, amount ) + { + } + + public RisingColossusScroll( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + /*int version = */ + reader.ReadInt(); + } + } +} diff --git a/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/SleepScroll.cs b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/SleepScroll.cs new file mode 100644 index 000000000..e221b7d34 --- /dev/null +++ b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/SleepScroll.cs @@ -0,0 +1,40 @@ +using System; +using Server; + +namespace Server.Items +{ + public class SleepScroll : SpellScroll + { + [Constructable] + public SleepScroll() + : this( 1 ) + { + } + + [Constructable] + public SleepScroll( int amount ) + : base( 681, 0x2DA2, amount ) + { + } + + public SleepScroll( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + /*int version = */ + reader.ReadInt(); + } + } +} diff --git a/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/SpellPlagueScroll.cs b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/SpellPlagueScroll.cs new file mode 100644 index 000000000..d25553993 --- /dev/null +++ b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/SpellPlagueScroll.cs @@ -0,0 +1,40 @@ +using System; +using Server; + +namespace Server.Items +{ + public class SpellPlagueScroll : SpellScroll + { + [Constructable] + public SpellPlagueScroll() + : this( 1 ) + { + } + + [Constructable] + public SpellPlagueScroll( int amount ) + : base( 689, 0x2DAA, amount ) + { + } + + public SpellPlagueScroll( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + /*int version = */ + reader.ReadInt(); + } + } +} diff --git a/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/SpellTriggerScroll.cs b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/SpellTriggerScroll.cs new file mode 100644 index 000000000..ee8aaa04a --- /dev/null +++ b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/SpellTriggerScroll.cs @@ -0,0 +1,40 @@ +using System; +using Server; + +namespace Server.Items +{ + public class SpellTriggerScroll : SpellScroll + { + [Constructable] + public SpellTriggerScroll() + : this( 1 ) + { + } + + [Constructable] + public SpellTriggerScroll( int amount ) + : base( 685, 0x2DA6, amount ) + { + } + + public SpellTriggerScroll( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + /*int version = */ + reader.ReadInt(); + } + } +} diff --git a/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/StoneFormScroll.cs b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/StoneFormScroll.cs new file mode 100644 index 000000000..00f56a1fc --- /dev/null +++ b/Scripts/Items/Skill Items/Magical/Scrolls/Mysticism/StoneFormScroll.cs @@ -0,0 +1,40 @@ +using System; +using Server; + +namespace Server.Items +{ + public class StoneFormScroll : SpellScroll + { + [Constructable] + public StoneFormScroll() + : this( 1 ) + { + } + + [Constructable] + public StoneFormScroll( int amount ) + : base( 684, 0x2DA5, amount ) + { + } + + public StoneFormScroll( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + /*int version = */ + reader.ReadInt(); + } + } +} diff --git a/Scripts/Items/Skill Items/Magical/Spellbook.cs b/Scripts/Items/Skill Items/Magical/Spellbook.cs index a4b44c252..8fdedf2db 100644 --- a/Scripts/Items/Skill Items/Magical/Spellbook.cs +++ b/Scripts/Items/Skill Items/Magical/Spellbook.cs @@ -17,7 +17,8 @@ namespace Server.Items Paladin, Ninja, Samurai, - Arcanist + Arcanist, + Mystic } public enum BookQuality @@ -101,6 +102,7 @@ namespace Server.Items case 4: type = SpellbookType.Ninja; break; case 5: type = SpellbookType.Samurai; break; case 6: type = SpellbookType.Arcanist; break; + case 7: type = SpellbookType.Mystic; break; } Spellbook book = Spellbook.Find( from, -1, type ); @@ -162,6 +164,8 @@ namespace Server.Items return SpellbookType.Ninja; else if ( spellID >= 600 && spellID < 617 ) return SpellbookType.Arcanist; + else if ( spellID >= 677 && spellID < 693 ) + return SpellbookType.Mystic; return SpellbookType.Invalid; } @@ -196,6 +200,11 @@ namespace Server.Items return Find( from, -1, SpellbookType.Arcanist ); } + public static Spellbook FindMystic( Mobile from ) + { + return Find( from, -1, SpellbookType.Mystic ); + } + public static Spellbook Find( Mobile from, int spellID ) { return Find( from, spellID, GetTypeForSpell( spellID ) ); diff --git a/Scripts/Mobiles/Monsters/Misc/Melee/AnimatedWeapon.cs b/Scripts/Mobiles/Monsters/Misc/Melee/AnimatedWeapon.cs new file mode 100644 index 000000000..6ce2238af --- /dev/null +++ b/Scripts/Mobiles/Monsters/Misc/Melee/AnimatedWeapon.cs @@ -0,0 +1,110 @@ +using System; + +namespace Server.Mobiles +{ + [CorpseName( "an animated weapon corpse" )] + public class AnimatedWeapon : BaseCreature + { + public override bool DeleteCorpseOnDeath { get { return true; } } + public override bool IsHouseSummonable { get { return true; } } + + public override double DispelDifficulty { get { return 0.0; } } + public override double DispelFocus { get { return 20.0; } } + + public override double GetFightModeRanking( Mobile m, FightMode acqType, bool bPlayerOnly ) + { + return m.Str / Math.Max( this.GetDistanceToSqrt( m ), 1.0 ); + } + + [Constructable] + public AnimatedWeapon( Mobile caster, int level ) + : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.3, 0.6 ) + { + Name = "an animated weapon"; + Body = 692; + + SetStr( 10 + level ); + SetDex( 10 + level ); + SetInt( 10 ); + + SetHits( 20 + ( level * 3 / 2 ) ); + SetStam( 10 + level ); + SetMana( 0 ); + + if ( level >= 120 ) + SetDamage( 14, 18 ); + else if ( level >= 105 ) + SetDamage( 13, 17 ); + else if ( level >= 90 ) + SetDamage( 12, 15 ); + else if ( level >= 75 ) + SetDamage( 11, 14 ); + else if ( level >= 60 ) + SetDamage( 10, 12 ); + else if ( level >= 45 ) + SetDamage( 9, 11 ); + else if ( level >= 30 ) + SetDamage( 8, 9 ); + else + SetDamage( 7, 8 ); + + SetDamageType( ResistanceType.Physical, 60 ); + SetDamageType( ResistanceType.Poison, 20 ); + SetDamageType( ResistanceType.Energy, 20 ); + + SetResistance( ResistanceType.Physical, 40, 50 ); + SetResistance( ResistanceType.Fire, 30, 40 ); + SetResistance( ResistanceType.Cold, 30, 40 ); + SetResistance( ResistanceType.Poison, 100 ); + SetResistance( ResistanceType.Energy, 20, 30 ); + + SetSkill( SkillName.MagicResist, level ); + SetSkill( SkillName.Wrestling, level ); + SetSkill( SkillName.Anatomy, caster.Skills[SkillName.Anatomy].Value / 2 ); + SetSkill( SkillName.Tactics, caster.Skills[SkillName.Tactics].Value / 2 ); + + Fame = 0; + Karma = 0; + + ControlSlots = 4; + } + + public override bool BleedImmune { get { return true; } } + public override Poison PoisonImmune { get { return Poison.Lethal; } } + + public override int GetAngerSound() + { + return 0x23A; + } + + public override int GetAttackSound() + { + return 0x3B8; + } + + public override int GetHurtSound() + { + return 0x23A; + } + + public AnimatedWeapon( Serial serial ) + : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + /*int version = */ + reader.ReadInt(); + } + } +} diff --git a/Scripts/Scripts.csproj b/Scripts/Scripts.csproj index a13e646dd..ad43b231e 100644 --- a/Scripts/Scripts.csproj +++ b/Scripts/Scripts.csproj @@ -1597,6 +1597,7 @@ + @@ -1657,6 +1658,7 @@ + @@ -1728,6 +1730,22 @@ + + + + + + + + + + + + + + + + @@ -2693,6 +2711,7 @@ + @@ -3177,6 +3196,13 @@ + + + + + + + diff --git a/Scripts/Spells/Initializer.cs b/Scripts/Spells/Initializer.cs index a9adcc039..e6ceda004 100644 --- a/Scripts/Spells/Initializer.cs +++ b/Scripts/Spells/Initializer.cs @@ -143,7 +143,7 @@ namespace Server.Spells Register( 507, typeof( Ninjitsu.MirrorImage ) ); } - if( Core.ML ) + if ( Core.ML ) { Register( 600, typeof( Spellweaving.ArcaneCircleSpell ) ); Register( 601, typeof( Spellweaving.GiftOfRenewalSpell ) ); @@ -162,12 +162,33 @@ namespace Server.Spells Register( 614, typeof( Spellweaving.GiftOfLifeSpell ) ); //Register( 615, typeof( Spellweaving.ArcaneEmpowermentSpell ) ); } + + if ( Core.SA ) + { + // Mysticism spells + //Register( 677, typeof( Mysticism.NetherBoltSpell ) ); + //Register( 678, typeof( Mysticism.HealingStoneSpell ) ); + //Register( 679, typeof( Mysticism.PurgeMagicSpell ) ); + //Register( 680, typeof( Mysticism.EnchantSpell ) ); + //Register( 681, typeof( Mysticism.SleepSpell ) ); + Register( 682, typeof( Mysticism.EagleStrikeSpell ) ); + Register( 683, typeof( Mysticism.AnimatedWeaponSpell ) ); + Register( 684, typeof( Mysticism.StoneFormSpell ) ); + //Register( 685, typeof( Mysticism.SpellTriggerSpell ) ); + //Register( 686, typeof( Mysticism.MassSleepSpell ) ); + //Register( 687, typeof( Mysticism.CleansingWindsSpell ) ); + //Register( 688, typeof( Mysticism.BombardSpell ) ); + Register( 689, typeof( Mysticism.SpellPlagueSpell ) ); + Register( 690, typeof( Mysticism.HailStormSpell ) ); + Register( 691, typeof( Mysticism.NetherCycloneSpell ) ); + //Register( 692, typeof( Mysticism.RisingColossusSpell ) ); + } } } - public static void Register( int spellID, Type type ) + public static void Register( int spellId, Type type ) { - SpellRegistry.Register( spellID, type ); + SpellRegistry.Register( spellId, type ); } } -} \ No newline at end of file +} diff --git a/Scripts/Spells/Mysticism/AnimatedWeaponSpell.cs b/Scripts/Spells/Mysticism/AnimatedWeaponSpell.cs new file mode 100644 index 000000000..97397f5b8 --- /dev/null +++ b/Scripts/Spells/Mysticism/AnimatedWeaponSpell.cs @@ -0,0 +1,89 @@ +using System; +using Server.Targeting; +using Server.Mobiles; + +namespace Server.Spells.Mysticism +{ + public class AnimatedWeaponSpell : MysticSpell + { + private static SpellInfo m_Info = new SpellInfo( + "Animated Weapon", "In Jux Por Ylem", + -1, + 9002, + Reagent.Bone, + Reagent.BlackPearl, + Reagent.MandrakeRoot, + Reagent.Nightshade + ); + + public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 1.5 ); } } + + public override double RequiredSkill { get { return 33.0; } } + public override int RequiredMana { get { return 11; } } + + public AnimatedWeaponSpell( Mobile caster, Item scroll ) + : base( caster, scroll, m_Info ) + { + } + + public override void OnCast() + { + Caster.Target = new InternalTarget( this ); + } + + public void Target( IPoint3D p ) + { + if ( ( Caster.Followers + 4 ) > Caster.FollowersMax ) + { + Caster.SendLocalizedMessage( 1049645 ); // You have too many followers to summon that creature. + return; + } + + var map = Caster.Map; + + SpellHelper.GetSurfaceTop( ref p ); + + if ( map == null || ( Caster.Player && !map.CanSpawnMobile( p.X, p.Y, p.Z ) ) ) + { + Caster.SendLocalizedMessage( 501942 ); // That location is blocked. + } + else if ( SpellHelper.CheckTown( p, Caster ) && CheckSequence() ) + { + var level = (int) ( ( GetBaseSkill( Caster ) + GetBoostSkill( Caster ) ) / 2.0 ); + + var duration = TimeSpan.FromSeconds( 10 + level ); + + var summon = new AnimatedWeapon( Caster, level ); + BaseCreature.Summon( summon, false, Caster, new Point3D( p ), 0x212, duration ); + + summon.PlaySound( 0x64A ); + + Effects.SendTargetParticles( summon, 0x3728, 10, 10, 0x13AA, (EffectLayer) 255 ); + } + + FinishSequence(); + } + + public class InternalTarget : Target + { + private AnimatedWeaponSpell m_Owner; + + public InternalTarget( AnimatedWeaponSpell owner ) + : base( 12, true, TargetFlags.None ) + { + m_Owner = owner; + } + + protected override void OnTarget( Mobile from, object o ) + { + if ( o is IPoint3D ) + m_Owner.Target( (IPoint3D) o ); + } + + protected override void OnTargetFinish( Mobile from ) + { + m_Owner.FinishSequence(); + } + } + } +} diff --git a/Scripts/Spells/Mysticism/EagleStrikeSpell.cs b/Scripts/Spells/Mysticism/EagleStrikeSpell.cs new file mode 100644 index 000000000..2a09d0fa1 --- /dev/null +++ b/Scripts/Spells/Mysticism/EagleStrikeSpell.cs @@ -0,0 +1,88 @@ +using System; +using Server.Targeting; + +namespace Server.Spells.Mysticism +{ + public class EagleStrikeSpell : MysticSpell + { + private static SpellInfo m_Info = new SpellInfo( + "Eagle Strike", "Kal Por Xen", + -1, + 9002, + Reagent.Bloodmoss, + Reagent.Bone, + Reagent.SpidersSilk, + Reagent.MandrakeRoot + ); + + public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 1.25 ); } } + + public override double RequiredSkill { get { return 20.0; } } + public override int RequiredMana { get { return 9; } } + + public EagleStrikeSpell( Mobile caster, Item scroll ) + : base( caster, scroll, m_Info ) + { + } + + public override void OnCast() + { + Caster.Target = new InternalTarget( this ); + } + + public void Target( Mobile m ) + { + if ( CheckHSequence( m ) ) + { + /* Conjures a magical eagle that assaults the Target with + * its talons, dealing energy damage. + */ + + SpellHelper.Turn( Caster, m ); + + SpellHelper.CheckReflect( 2, Caster, ref m ); + + Caster.MovingParticles( m, 0x407A, 7, 0, false, true, 0, 0, 0xBBE, 0xFA6, 0xFFFF, 0 ); + Caster.PlaySound( 0x2EE ); + + Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), Damage, m ); + } + + FinishSequence(); + } + + private void Damage( Mobile to ) + { + if ( to == null ) + return; + + double damage = GetNewAosDamage( 19, 1, 5, to ); + + SpellHelper.Damage( this, to, damage, 0, 0, 0, 0, 100 ); + + to.PlaySound( 0x64D ); + } + + private class InternalTarget : Target + { + private EagleStrikeSpell m_Owner; + + public InternalTarget( EagleStrikeSpell owner ) + : base( 12, false, TargetFlags.Harmful ) + { + 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(); + } + } + } +} diff --git a/Scripts/Spells/Mysticism/HailStormSpell.cs b/Scripts/Spells/Mysticism/HailStormSpell.cs new file mode 100644 index 000000000..75206e92e --- /dev/null +++ b/Scripts/Spells/Mysticism/HailStormSpell.cs @@ -0,0 +1,144 @@ +using System; +using System.Collections.Generic; +using Server.Network; +using Server.Targeting; + +namespace Server.Spells.Mysticism +{ + public class HailStormSpell : MysticSpell + { + private static SpellInfo m_Info = new SpellInfo( + "Hail Storm", "Kal Des Ylem", + -1, + 9002, + Reagent.DragonsBlood, + Reagent.Bloodmoss, + Reagent.BlackPearl, + Reagent.MandrakeRoot + ); + + public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 2.25 ); } } + + public override double RequiredSkill { get { return 70.0; } } + public override int RequiredMana { get { return 40; } } + + public HailStormSpell( Mobile caster, Item scroll ) + : base( caster, scroll, m_Info ) + { + } + + public override void OnCast() + { + Caster.Target = new InternalTarget( this ); + } + + public void Target( IPoint3D p ) + { + if ( SpellHelper.CheckTown( p, Caster ) && CheckSequence() ) + { + /* Summons a storm of hailstones that strikes all Targets + * within a radius around the Target's Location, dealing + * cold damage. + */ + + SpellHelper.Turn( Caster, p ); + + if ( p is Item ) + p = ( (Item) p ).GetWorldLocation(); + + var targets = new List(); + + var map = Caster.Map; + + var pvp = false; + + if ( map != null ) + { + PlayEffect( p, Caster.Map ); + + foreach ( var m in map.GetMobilesInRange( new Point3D( p ), 2 ) ) + { + if ( m == Caster ) + continue; + + if ( SpellHelper.ValidIndirectTarget( Caster, m ) && Caster.CanBeHarmful( m, false ) && Caster.CanSee( m ) ) + { + if ( !Caster.InLOS( m ) ) + continue; + + targets.Add( m ); + + if ( m.Player ) + pvp = true; + } + } + } + + double damage = GetNewAosDamage( 51, 1, 5, pvp ); + + foreach ( var m in targets ) + { + Caster.DoHarmful( m ); + SpellHelper.Damage( this, m, damage, 0, 0, 100, 0, 0 ); + } + } + + FinishSequence(); + } + + private static void PlayEffect( IPoint3D p, Map map ) + { + Effects.PlaySound( p, map, 0x64F ); + + PlaySingleEffect( p, map, -1, 1, -1, 1 ); + PlaySingleEffect( p, map, -2, 0, -3, -1 ); + PlaySingleEffect( p, map, -3, -1, -1, 1 ); + PlaySingleEffect( p, map, 1, 3, -1, 1 ); + PlaySingleEffect( p, map, -1, 1, 1, 3 ); + } + + private static void PlaySingleEffect( IPoint3D p, Map map, int a, int b, int c, int d ) + { + int x = p.X, y = p.Y, z = p.Z + 18; + + SendEffectPacket( p, map, new Point3D( x + a, y + c, z ), new Point3D( x + a, y + c, z ) ); + SendEffectPacket( p, map, new Point3D( x + b, y + c, z ), new Point3D( x + b, y + c, z ) ); + SendEffectPacket( p, map, new Point3D( x + b, y + d, z ), new Point3D( x + b, y + d, z ) ); + SendEffectPacket( p, map, new Point3D( x + a, y + d, z ), new Point3D( x + a, y + d, z ) ); + + SendEffectPacket( p, map, new Point3D( x + b, y + c, z ), new Point3D( x + a, y + c, z ) ); + SendEffectPacket( p, map, new Point3D( x + b, y + d, z ), new Point3D( x + b, y + c, z ) ); + SendEffectPacket( p, map, new Point3D( x + a, y + d, z ), new Point3D( x + b, y + d, z ) ); + SendEffectPacket( p, map, new Point3D( x + a, y + c, z ), new Point3D( x + a, y + d, z ) ); + } + + private static void SendEffectPacket( IPoint3D p, Map map, Point3D orig, Point3D dest ) + { + Effects.SendPacket( p, map, new HuedEffect( EffectType.Moving, Serial.Zero, Serial.Zero, 0x36D4, orig, dest, 0, 0, false, false, 0x63, 0x4 ) ); + } + + private class InternalTarget : Target + { + private HailStormSpell m_Owner; + + public InternalTarget( HailStormSpell owner ) + : base( 12, true, TargetFlags.None ) + { + m_Owner = owner; + } + + protected override void OnTarget( Mobile from, object o ) + { + var p = o as IPoint3D; + + if ( p != null ) + m_Owner.Target( p ); + } + + protected override void OnTargetFinish( Mobile from ) + { + m_Owner.FinishSequence(); + } + } + } +} diff --git a/Scripts/Spells/Mysticism/MysticSpell.cs b/Scripts/Spells/Mysticism/MysticSpell.cs new file mode 100644 index 000000000..b45870046 --- /dev/null +++ b/Scripts/Spells/Mysticism/MysticSpell.cs @@ -0,0 +1,92 @@ +using System; +using Server; + +namespace Server.Spells.Mysticism +{ + public abstract class MysticSpell : Spell + { + public abstract double RequiredSkill { get; } + public abstract int RequiredMana { get; } + + public override SkillName CastSkill { get { return SkillName.Mysticism; } } + + /* + * As per OSI Publish 64: + * Imbuing is not the only skill associated with Mysticism now. + * Players can use EITHER their Focus skill or Imbuing skill. + * Evaluate Intelligence no longer has any effect on a Mystic’s spell power. + */ + public override double GetDamageSkill( Mobile m ) + { + return Math.Max( m.Skills[SkillName.Imbuing].Value, m.Skills[SkillName.Focus].Value ); + } + + public override int GetDamageFixed( Mobile m ) + { + return Math.Max( m.Skills[SkillName.Imbuing].Fixed, m.Skills[SkillName.Focus].Fixed ); + } + + public MysticSpell( Mobile caster, Item scroll, SpellInfo info ) + : base( caster, scroll, info ) + { + } + + public override void GetCastSkills( out double min, out double max ) + { + // As per Mysticism page at the UO Herald Playguide + // This means that we have 25% success chance at min Required Skill + + min = RequiredSkill - 12.5; + max = RequiredSkill + 37.5; + } + + public override int GetMana() + { + return RequiredMana; + } + + public override bool CheckCast() + { + if ( !base.CheckCast() ) + return false; + + int mana = ScaleMana( RequiredMana ); + + if ( Caster.Mana < mana ) + { + Caster.SendLocalizedMessage( 1060174, mana.ToString() ); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability. + return false; + } + + if ( Caster.Skills[CastSkill].Value < RequiredSkill ) + { + Caster.SendLocalizedMessage( 1063013, String.Format( "{0}\t{1}\t ", RequiredSkill.ToString( "F1" ), CastSkill.ToString() ) ); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability. + return false; + } + + return true; + } + + public override void OnBeginCast() + { + base.OnBeginCast(); + + SendCastEffect(); + } + + public virtual void SendCastEffect() + { + Caster.FixedEffect( 0x37C4, 10, (int) ( GetCastDelay().TotalSeconds * 28 ), 0x66C, 3 ); + } + + public static double GetBaseSkill( Mobile m ) + { + return m.Skills[SkillName.Mysticism].Value; + } + + public static double GetBoostSkill( Mobile m ) + { + return Math.Max( m.Skills[SkillName.Imbuing].Value, m.Skills[SkillName.Focus].Value ); + } + } +} \ No newline at end of file diff --git a/Scripts/Spells/Mysticism/NetherCycloneSpell.cs b/Scripts/Spells/Mysticism/NetherCycloneSpell.cs new file mode 100644 index 000000000..3985e54f9 --- /dev/null +++ b/Scripts/Spells/Mysticism/NetherCycloneSpell.cs @@ -0,0 +1,157 @@ +using System; +using System.Collections.Generic; +using Server.Network; +using Server.Targeting; + +namespace Server.Spells.Mysticism +{ + public class NetherCycloneSpell : MysticSpell + { + private static SpellInfo m_Info = new SpellInfo( + "Nether Cyclone", "Grav Hur", + -1, + 9002, + Reagent.MandrakeRoot, + Reagent.Nightshade, + Reagent.SulfurousAsh, + Reagent.Bloodmoss + ); + + public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 2.5 ); } } + + public override double RequiredSkill { get { return 83.0; } } + public override int RequiredMana { get { return 50; } } + + public NetherCycloneSpell( Mobile caster, Item scroll ) + : base( caster, scroll, m_Info ) + { + } + + public override void OnCast() + { + Caster.Target = new InternalTarget( this ); + } + + public void Target( IPoint3D p ) + { + if ( SpellHelper.CheckTown( p, Caster ) && CheckSequence() ) + { + /* Summons a gale of lethal winds that strikes all Targets within a radius around + * the Target's Location, dealing chaos damage. In addition to inflicting damage, + * each Target of the Nether Cyclone temporarily loses a percentage of mana and + * stamina. The effectiveness of the Nether Cyclone is determined by a comparison + * between the Caster's Mysticism and either Focus or Imbuing (whichever is greater) + * skills and the Resisting Spells skill of the Target. + */ + + SpellHelper.Turn( Caster, p ); + + if ( p is Item ) + p = ( (Item) p ).GetWorldLocation(); + + var targets = new List(); + + var map = Caster.Map; + + var pvp = false; + + if ( map != null ) + { + PlayEffect( p, Caster.Map ); + + foreach ( var m in map.GetMobilesInRange( new Point3D( p ), 2 ) ) + { + if ( m == Caster ) + continue; + + if ( SpellHelper.ValidIndirectTarget( Caster, m ) && Caster.CanBeHarmful( m, false ) && Caster.CanSee( m ) ) + { + if ( !Caster.InLOS( m ) ) + continue; + + targets.Add( m ); + + if ( m.Player ) + pvp = true; + } + } + } + + var damage = GetNewAosDamage( 51, 1, 5, pvp ); + var reduction = ( GetBaseSkill( Caster ) + GetBoostSkill( Caster ) ) / 1200.0; + + foreach ( var m in targets ) + { + Caster.DoHarmful( m ); + + var types = new int[4]; + types[Utility.Random( types.Length )] = 100; + + SpellHelper.Damage( this, m, damage, 0, types[0], types[1], types[2], types[3] ); + + var resistedReduction = reduction - ( m.Skills[SkillName.MagicResist].Value / 800.0 ); + + m.Stam -= (int) ( m.StamMax * resistedReduction ); + m.Mana -= (int) ( m.ManaMax * resistedReduction ); + } + } + + FinishSequence(); + } + + private static void PlayEffect( IPoint3D p, Map map ) + { + Effects.PlaySound( p, map, 0x64F ); + + PlaySingleEffect( p, map, -1, 1, -1, 1 ); + PlaySingleEffect( p, map, -2, 0, -3, -1 ); + PlaySingleEffect( p, map, -3, -1, -1, 1 ); + PlaySingleEffect( p, map, 1, 3, -1, 1 ); + PlaySingleEffect( p, map, -1, 1, 1, 3 ); + } + + private static void PlaySingleEffect( IPoint3D p, Map map, int a, int b, int c, int d ) + { + int x = p.X, y = p.Y, z = p.Z + 18; + + SendEffectPacket( p, map, new Point3D( x + a, y + c, z ), new Point3D( x + a, y + c, z ) ); + SendEffectPacket( p, map, new Point3D( x + b, y + c, z ), new Point3D( x + b, y + c, z ) ); + SendEffectPacket( p, map, new Point3D( x + b, y + d, z ), new Point3D( x + b, y + d, z ) ); + SendEffectPacket( p, map, new Point3D( x + a, y + d, z ), new Point3D( x + a, y + d, z ) ); + + SendEffectPacket( p, map, new Point3D( x + b, y + c, z ), new Point3D( x + a, y + c, z ) ); + SendEffectPacket( p, map, new Point3D( x + b, y + d, z ), new Point3D( x + b, y + c, z ) ); + SendEffectPacket( p, map, new Point3D( x + a, y + d, z ), new Point3D( x + b, y + d, z ) ); + SendEffectPacket( p, map, new Point3D( x + a, y + c, z ), new Point3D( x + a, y + d, z ) ); + } + + private static void SendEffectPacket( IPoint3D p, Map map, Point3D orig, Point3D dest ) + { + Effects.SendPacket( p, map, new HuedEffect( EffectType.Moving, Serial.Zero, Serial.Zero, 0x375A, orig, dest, 0, 0, false, false, 0x49A, 0x4 ) ); + } + + private class InternalTarget : Target + { + private NetherCycloneSpell m_Owner; + + public InternalTarget( NetherCycloneSpell owner ) + : base( 12, true, TargetFlags.None ) + { + m_Owner = owner; + } + + protected override void OnTarget( Mobile from, object o ) + { + var p = o as IPoint3D; + + if ( p != null ) + m_Owner.Target( p ); + } + + protected override void OnTargetFinish( Mobile from ) + { + m_Owner.FinishSequence(); + } + } + } +} diff --git a/Scripts/Spells/Mysticism/SpellPlagueSpell.cs b/Scripts/Spells/Mysticism/SpellPlagueSpell.cs new file mode 100644 index 000000000..b35c9e5da --- /dev/null +++ b/Scripts/Spells/Mysticism/SpellPlagueSpell.cs @@ -0,0 +1,235 @@ +using System; +using System.Collections.Generic; +using Server.Targeting; + +namespace Server.Spells.Mysticism +{ + public class SpellPlagueSpell : MysticSpell + { + public static void Initialize() + { + EventSink.PlayerDeath += new PlayerDeathEventHandler( OnPlayerDeath ); + } + + private static SpellInfo m_Info = new SpellInfo( + "Spell Plague", "Vas Rel Jux Ort", + -1, + 9002, + Reagent.DaemonBone, + Reagent.DragonsBlood, + Reagent.Nightshade, + Reagent.SulfurousAsh + ); + + public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 2.25 ); } } + + public override double RequiredSkill { get { return 70.0; } } + public override int RequiredMana { get { return 40; } } + + public SpellPlagueSpell( Mobile caster, Item scroll ) + : base( caster, scroll, m_Info ) + { + } + + public override void OnCast() + { + Caster.Target = new InternalTarget( this ); + } + + public void Target( Mobile targeted ) + { + if ( !Caster.CanSee( targeted ) ) + { + Caster.SendLocalizedMessage( 500237 ); // Target can not be seen. + } + else if ( CheckHSequence( targeted ) ) + { + SpellHelper.Turn( Caster, targeted ); + + SpellHelper.CheckReflect( 6, Caster, ref targeted ); + + /* The target is hit with an explosion of chaos damage and then inflicted + * with the spell plague curse. Each time the target is damaged while under + * the effect of the spell plague, they may suffer an explosion of chaos + * damage. The initial chance to trigger the explosion starts at 90% and + * reduces by 30% every time an explosion occurs. Once the target is + * afflicted by 3 explosions or 8 seconds have passed, that spell plague + * is removed from the target. Spell Plague will stack with other spell + * plagues so that they are applied one after the other. + */ + + VisualEffect( targeted ); + + var damage = GetNewAosDamage( 33, 1, 5, targeted ); + + var types = new int[4]; + types[Utility.Random( types.Length )] = 100; + + SpellHelper.Damage( this, targeted, damage, 0, types[0], types[1], types[2], types[3] ); + + var context = new SpellPlagueContext( this, targeted ); + + if ( m_Table.ContainsKey( targeted ) ) + { + var oldContext = m_Table[targeted]; + oldContext.SetNext( context ); + } + else + { + m_Table[targeted] = context; + context.Start(); + } + } + + FinishSequence(); + } + + public static bool UnderEffect( Mobile m ) + { + return m_Table.ContainsKey( m ); + } + + public static void RemoveEffect( Mobile m ) + { + if ( !m_Table.ContainsKey( m ) ) + return; + + var context = m_Table[m]; + + context.EndPlague( false ); + } + + public static void CheckPlague( Mobile m ) + { + if ( !m_Table.ContainsKey( m ) ) + return; + + var context = m_Table[m]; + + context.OnDamage(); + } + + private static void OnPlayerDeath( PlayerDeathEventArgs e ) + { + RemoveEffect( e.Mobile ); + } + + private static Dictionary m_Table = new Dictionary(); + + protected void VisualEffect( Mobile to ) + { + to.PlaySound( 0x658 ); + + to.FixedParticles( 0x3728, 1, 13, 0x26B8, 0x47E, 7, EffectLayer.Head, 0 ); + to.FixedParticles( 0x3779, 1, 15, 0x251E, 0x43, 7, EffectLayer.Head, 0 ); + } + + private class SpellPlagueContext + { + private SpellPlagueSpell m_Owner; + private Mobile m_Target; + private DateTime m_LastExploded; + private int m_Explosions; + private Timer m_Timer; + private SpellPlagueContext m_Next; + + public SpellPlagueContext( SpellPlagueSpell owner, Mobile target ) + { + m_Owner = owner; + m_Target = target; + } + + public void SetNext( SpellPlagueContext context ) + { + if ( m_Next == null ) + m_Next = context; + else + m_Next.SetNext( context ); + } + + public void Start() + { + m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 8.0 ), new TimerCallback( EndPlague ) ); + m_Timer.Start(); + + BuffInfo.AddBuff( m_Target, new BuffInfo( BuffIcon.SpellPlague, 1031690, 1080167, TimeSpan.FromSeconds( 8.5 ), m_Target ) ); + } + + public void OnDamage() + { + if ( DateTime.Now > ( m_LastExploded + TimeSpan.FromSeconds( 2.0 ) ) ) + { + var exploChance = 90 - ( m_Explosions * 30 ); + + var resist = m_Target.Skills[SkillName.MagicResist].Value; + + if ( resist >= 70 ) + exploChance -= (int) ( ( resist - 70.0 ) * 3.0 / 10.0 ); + + if ( exploChance > Utility.Random( 100 ) ) + { + m_Owner.VisualEffect( m_Target ); + + var damage = m_Owner.GetNewAosDamage( 15 + ( m_Explosions * 3 ), 1, 5, m_Target ); + + m_Explosions++; + m_LastExploded = DateTime.Now; + + var types = new int[4]; + types[Utility.Random( types.Length )] = 100; + + SpellHelper.Damage( m_Owner, m_Target, damage, 0, types[0], types[1], types[2], types[3] ); + + if ( m_Explosions >= 3 ) + EndPlague(); + } + } + } + + private void EndPlague() + { + EndPlague( true ); + } + + public void EndPlague( bool restart ) + { + if ( m_Timer != null ) + m_Timer.Stop(); + + if ( restart && m_Next != null ) + { + m_Table[m_Target] = m_Next; + m_Next.Start(); + } + else + { + m_Table.Remove( m_Target ); + + BuffInfo.RemoveBuff( m_Target, BuffIcon.SpellPlague ); + } + } + } + + private class InternalTarget : Target + { + private SpellPlagueSpell m_Owner; + + public InternalTarget( SpellPlagueSpell owner ) + : base( 12, false, TargetFlags.Harmful ) + { + 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(); + } + } + } +} diff --git a/Scripts/Spells/Mysticism/StoneFormSpell.cs b/Scripts/Spells/Mysticism/StoneFormSpell.cs new file mode 100644 index 000000000..300cb68ec --- /dev/null +++ b/Scripts/Spells/Mysticism/StoneFormSpell.cs @@ -0,0 +1,161 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using Server.Spells.Fifth; +using Server.Spells.Seventh; + +namespace Server.Spells.Mysticism +{ + public class StoneFormSpell : MysticSpell + { + public static void Initialize() + { + EventSink.PlayerDeath += OnPlayerDeath; + } + + private static SpellInfo m_Info = new SpellInfo( + "Stone Form", "In Rel Ylem", + -1, + 9002, + Reagent.Bloodmoss, + Reagent.FertileDirt, + Reagent.Garlic + ); + + public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 1.5 ); } } + + public override double RequiredSkill { get { return 33.0; } } + public override int RequiredMana { get { return 11; } } + + private static Hashtable m_Table = new Hashtable(); + + public static bool UnderEffect( Mobile m ) + { + return m_Table.Contains( m ); + } + + public StoneFormSpell( Mobile caster, Item scroll ) + : base( caster, scroll, m_Info ) + { + } + + public override bool CheckCast() + { + if ( Factions.Sigil.ExistsOn( Caster ) ) + { + Caster.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil. + return false; + } + else if ( !Caster.CanBeginAction( typeof( PolymorphSpell ) ) ) + { + Caster.SendLocalizedMessage( 1061628 ); // You can't do that while polymorphed. + return false; + } + else if ( Ninjitsu.AnimalForm.UnderTransformation( Caster ) ) + { + Caster.SendLocalizedMessage( 1063218 ); // You cannot use that ability in this form. + return false; + } + else if ( Caster.Flying ) + { + Caster.SendLocalizedMessage( 1113415 ); // You cannot use this ability while flying. + return false; + } + + return base.CheckCast(); + } + + public override void OnCast() + { + if ( Factions.Sigil.ExistsOn( Caster ) ) + { + Caster.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil. + } + else if ( !Caster.CanBeginAction( typeof( PolymorphSpell ) ) ) + { + Caster.SendLocalizedMessage( 1061628 ); // You can't do that while polymorphed. + } + else if ( !Caster.CanBeginAction( typeof( IncognitoSpell ) ) || ( Caster.IsBodyMod && !UnderEffect( Caster ) ) ) + { + Caster.SendLocalizedMessage( 1063218 ); // You cannot use that ability in this form. + } + else if ( CheckSequence() ) + { + if ( UnderEffect( Caster ) ) + { + RemoveEffects( Caster ); + + Caster.PlaySound( 0xFA ); + Caster.Delta( MobileDelta.Resistances ); + } + else + { + var mount = Caster.Mount; + + if ( mount != null ) + mount.Rider = null; + + Caster.BodyMod = 0x2C1; + Caster.HueMod = 0; + + var offset = (int) ( ( GetBaseSkill( Caster ) + GetBoostSkill( Caster ) ) / 24.0 ); + + var mods = new List + { + new ResistanceMod( ResistanceType.Physical, offset ), + new ResistanceMod( ResistanceType.Fire, offset ), + new ResistanceMod( ResistanceType.Cold, offset ), + new ResistanceMod( ResistanceType.Poison, offset ), + new ResistanceMod( ResistanceType.Energy, offset ) + }; + + foreach ( var mod in mods ) + Caster.AddResistanceMod( mod ); + + m_Table[Caster] = mods; + + Caster.PlaySound( 0x65A ); + Caster.Delta( MobileDelta.Resistances ); + + BuffInfo.AddBuff( Caster, new BuffInfo( BuffIcon.StoneForm, 1080145, 1080146, + string.Format( "-10\t-2\t{0}\t{1}\t{2}", offset, GetResistCapBonus( Caster ), GetDIBonus( Caster ) ), false ) ); + } + } + + FinishSequence(); + } + + public static int GetDIBonus( Mobile m ) + { + return (int) ( ( GetBaseSkill( m ) + GetBoostSkill( m ) ) / 12.0 ); + } + + public static int GetResistCapBonus( Mobile m ) + { + return (int) ( ( GetBaseSkill( m ) + GetBoostSkill( m ) ) / 48.0 ); + } + + public static void RemoveEffects( Mobile m ) + { + var mods = (List) m_Table[m]; + + foreach ( var mod in mods ) + m.RemoveResistanceMod( mod ); + + m.BodyMod = 0; + m.HueMod = -1; + + m_Table.Remove( m ); + + BuffInfo.RemoveBuff( m, BuffIcon.StoneForm ); + } + + private static void OnPlayerDeath( PlayerDeathEventArgs e ) + { + var m = e.Mobile; + + if ( UnderEffect( m ) ) + RemoveEffects( m ); + } + } +} diff --git a/Scripts/Spells/Reagent.cs b/Scripts/Spells/Reagent.cs index 360d92e83..d9b111940 100644 --- a/Scripts/Spells/Reagent.cs +++ b/Scripts/Spells/Reagent.cs @@ -5,8 +5,7 @@ namespace Server.Spells { public class Reagent { - private static Type[] m_Types = new Type[13] - { + private static Type[] m_Types = { typeof( BlackPearl ), typeof( Bloodmoss ), typeof( Garlic ), @@ -19,7 +18,11 @@ namespace Server.Spells typeof( GraveDust ), typeof( DaemonBlood ), typeof( NoxCrystal ), - typeof( PigIron ) + typeof( PigIron ), + typeof( Bone ), + typeof( FertileDirt ), + typeof( DragonsBlood ), + typeof( DaemonBone ) }; public Type[] Types @@ -104,5 +107,29 @@ namespace Server.Spells get{ return m_Types[12]; } set{ m_Types[12] = value; } } + + public static Type Bone + { + get{ return m_Types[13]; } + set{ m_Types[13] = value; } + } + + public static Type FertileDirt + { + get{ return m_Types[14]; } + set{ m_Types[14] = value; } + } + + public static Type DragonsBlood + { + get{ return m_Types[15]; } + set{ m_Types[15] = value; } + } + + public static Type DaemonBone + { + get{ return m_Types[16]; } + set{ m_Types[16] = value; } + } } -} \ No newline at end of file +} From 2d0c0166e151d7df91369fa2b52562bbaa4c90fc Mon Sep 17 00:00:00 2001 From: Pedro Pardal Date: Wed, 22 Mar 2017 11:00:00 +0100 Subject: [PATCH 05/12] Add .editorconfig file, add .idea/ folder to .gitignore (JetBrains Rider user config dir) --- .editorconfig | 10 ++++++++++ .gitignore | 1 + 2 files changed, 11 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..e7866c0e4 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,10 @@ +# http://editorconfig.org +root=true + +[*] +indent_style = tab +tab_width = 4 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + diff --git a/.gitignore b/.gitignore index f8ac32465..22dead5b3 100644 --- a/.gitignore +++ b/.gitignore @@ -10,5 +10,6 @@ *.user *.suo +/.idea /Backups /Saves From e62fc4964afe66b9595e42ca1fa711d2dc0cb2de Mon Sep 17 00:00:00 2001 From: LG Archer Date: Thu, 30 Mar 2017 21:04:23 +0100 Subject: [PATCH 06/12] + Fix issues with status bars not updating. The health bar status updates do not require prerequisite checks as they use flags within the packet to determine the proper state of being yellow or green or both. --- Server/Mobile.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Server/Mobile.cs b/Server/Mobile.cs index 70e5b0e3a..7d754d28f 100644 --- a/Server/Mobile.cs +++ b/Server/Mobile.cs @@ -9183,10 +9183,10 @@ namespace Server m.m_NetState.Send(MobileIncoming.Create(m.m_NetState, m, this)); if ( m.m_NetState.StygianAbyss ) { - if ( m_Poison != null ) + //if ( m_Poison != null ) m.m_NetState.Send( new HealthbarPoison( this ) ); - if ( m_Blessed || m_YellowHealthbar ) + //if ( m_Blessed || m_YellowHealthbar ) m.m_NetState.Send( new HealthbarYellow( this ) ); } @@ -9207,10 +9207,10 @@ namespace Server ourState.Send(MobileIncoming.Create(ourState, this, m)); if ( ourState.StygianAbyss ) { - if ( m.Poisoned ) + //if ( m.Poisoned ) ourState.Send( new HealthbarPoison( m ) ); - if ( m.Blessed || m.YellowHealthbar ) + //if ( m.Blessed || m.YellowHealthbar ) ourState.Send( new HealthbarYellow( m ) ); } @@ -9241,10 +9241,10 @@ namespace Server ns.Send(MobileIncoming.Create(ns, ns.Mobile, this)); if ( ns.StygianAbyss ) { - if ( m_Poison != null ) + //if ( m_Poison != null ) ns.Send( new HealthbarPoison( this ) ); - if ( m_Blessed || m_YellowHealthbar ) + //if ( m_Blessed || m_YellowHealthbar ) ns.Send( new HealthbarYellow( this ) ); } @@ -11347,4 +11347,4 @@ namespace Server { } } -} \ No newline at end of file +} From da3a1eebe34377576862fb53f417edfcda230a76 Mon Sep 17 00:00:00 2001 From: Ugdhar Date: Mon, 5 Jun 2017 16:19:39 -0400 Subject: [PATCH 07/12] Update README.md remove /reference:System.Drawing from windows build, it does not work with it, removing it makes it compile. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4c108e146..82031a24a 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ RunUO Git Repository Typical Windows Build -PS C:\runuo> C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc /optimize /unsafe /t:exe /out:RunUO.exe /win32icon:Server\runuo.ico /d:NEWTIMERS /d:NEWPARENT /reference:System.Drawing /recurse:Server\\*.cs +PS C:\runuo> C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc /optimize /unsafe /t:exe /out:RunUO.exe /win32icon:Server\runuo.ico /d:NEWTIMERS /d:NEWPARENT /recurse:Server\\*.cs Typical Linux Build (MONO) From 6dff3478c82752ddd50bde347c29968274e3e927 Mon Sep 17 00:00:00 2001 From: Ravenwolfe Date: Thu, 31 Aug 2017 14:31:37 -0500 Subject: [PATCH 08/12] Add persistence mechanism for serialization to files. *Requires Core Recompile* --- Server/Persistence/Persistence.cs | 117 ++++++++++++++++++++++++++++++ Server/Server.csproj | 1 + 2 files changed, 118 insertions(+) create mode 100644 Server/Persistence/Persistence.cs diff --git a/Server/Persistence/Persistence.cs b/Server/Persistence/Persistence.cs new file mode 100644 index 000000000..fb7ca2cc4 --- /dev/null +++ b/Server/Persistence/Persistence.cs @@ -0,0 +1,117 @@ +#region References +using System; +using System.IO; +#endregion + +namespace Server +{ + public static class Persistence + { + public static void Serialize(string path, Action serializer) + { + Serialize(new FileInfo(path), serializer); + } + + public static void Serialize(FileInfo file, Action serializer) + { + file.Refresh(); + + if (file.Directory != null && !file.Directory.Exists) + { + file.Directory.Create(); + } + + if (!file.Exists) + { + file.Create().Close(); + } + + file.Refresh(); + + using (var fs = file.OpenWrite()) + { + var writer = new BinaryFileWriter(fs, true); + + try + { + serializer(writer); + } + finally + { + writer.Flush(); + writer.Close(); + } + } + } + + public static void Deserialize(string path, Action deserializer) + { + Deserialize(path, deserializer, true); + } + + public static void Deserialize(FileInfo file, Action deserializer) + { + Deserialize(file, deserializer, true); + } + + public static void Deserialize(string path, Action deserializer, bool ensure) + { + Deserialize(new FileInfo(path), deserializer, ensure); + } + + public static void Deserialize(FileInfo file, Action deserializer, bool ensure) + { + file.Refresh(); + + if (file.Directory != null && !file.Directory.Exists) + { + if (!ensure) + { + throw new DirectoryNotFoundException(); + } + + file.Directory.Create(); + } + + if (!file.Exists) + { + if (!ensure) + { + throw new FileNotFoundException + { + Source = file.FullName + }; + } + + file.Create().Close(); + } + + file.Refresh(); + + using (var fs = file.OpenRead()) + { + var reader = new BinaryFileReader(new BinaryReader(fs)); + + try + { + deserializer(reader); + } + catch (EndOfStreamException eos) + { + if (file.Length > 0) + { + Console.WriteLine("[Persistence]: {0}", eos); + } + } + catch (Exception e) + { + Console.WriteLine("[Persistence]: {0}", e); + } + finally + { + reader.Close(); + } + } + } + } +} \ No newline at end of file diff --git a/Server/Server.csproj b/Server/Server.csproj index 371065101..eb0b69d49 100644 --- a/Server/Server.csproj +++ b/Server/Server.csproj @@ -182,6 +182,7 @@ + From d715573172fc432a673825b0136444bdab7863b5 Mon Sep 17 00:00:00 2001 From: LG Archer Date: Wed, 28 Feb 2018 20:20:56 +0000 Subject: [PATCH 09/12] Update README.md --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 82031a24a..918d7c0c3 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,12 @@ runuo RunUO Git Repository +*** +RunUO is no longer officially supported by a core team. + +If you wish to find support in a wider UO development commuity, visit [ServUO - Ultima Online Emulation](http://www.servuo.com) +*** + Typical Windows Build PS C:\runuo> C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc /optimize /unsafe /t:exe /out:RunUO.exe /win32icon:Server\runuo.ico /d:NEWTIMERS /d:NEWPARENT /recurse:Server\\*.cs @@ -25,4 +31,3 @@ Latest Razor builds can be found at https://github.com/msturgill/razor/releases/ Latest UOSteam builds (previously AssistUO) can be found at http://uosteam.com -IRC: chat.freenode.net #runuo From 559f13e61ecc18e21ba791b1ee95071525ffb277 Mon Sep 17 00:00:00 2001 From: LG Archer Date: Sat, 7 Jul 2018 15:53:57 +0100 Subject: [PATCH 10/12] + Unsafe Compile Context Support + Allow unsafe context for ScriptCompiler process. --- Server/ScriptCompiler.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Server/ScriptCompiler.cs b/Server/ScriptCompiler.cs index 8ae4042d7..e72111f28 100644 --- a/Server/ScriptCompiler.cs +++ b/Server/ScriptCompiler.cs @@ -80,7 +80,9 @@ namespace Server public static string GetCompilerOptions( bool debug ) { - StringBuilder sb = null; + StringBuilder sb = null; + + AppendCompilerOption( ref sb, "/unsafe" ); if( !debug ) AppendCompilerOption( ref sb, "/optimize" ); From c4dc219fd60dd1eb8636a33da2fb6cae00e5f0d8 Mon Sep 17 00:00:00 2001 From: LG Archer Date: Wed, 1 Aug 2018 21:04:09 +0100 Subject: [PATCH 11/12] Update Server.csproj --- Server/Server.csproj | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Server/Server.csproj b/Server/Server.csproj index eb0b69d49..ef9295db6 100644 --- a/Server/Server.csproj +++ b/Server/Server.csproj @@ -39,7 +39,7 @@ true ..\ - TRACE;DEBUG;NEWTIMERS, NEWPARENT + TRACE;DEBUG;NEWTIMERS;NEWPARENT true full AnyCPU @@ -49,7 +49,7 @@ ..\ - TRACE;NEWTIMERS, NEWPARENT + TRACE;NEWTIMERS;NEWPARENT true true pdbonly @@ -61,7 +61,7 @@ true ..\ - TRACE;DEBUG;NEWTIMERS, NEWPARENT + TRACE;DEBUG;NEWTIMERS;NEWPARENT true full x64 @@ -71,7 +71,7 @@ ..\ - TRACE;NEWTIMERS, NEWPARENT + TRACE;NEWTIMERS;NEWPARENT true true pdbonly @@ -81,7 +81,6 @@ false - @@ -241,8 +240,7 @@ true - - \ No newline at end of file + From 0a897d77271a18f284bca210d181b6d2a86ef8ae Mon Sep 17 00:00:00 2001 From: LG Archer Date: Wed, 1 Aug 2018 21:05:11 +0100 Subject: [PATCH 12/12] Update Scripts.csproj --- Scripts/Scripts.csproj | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Scripts/Scripts.csproj b/Scripts/Scripts.csproj index ad43b231e..c63992526 100644 --- a/Scripts/Scripts.csproj +++ b/Scripts/Scripts.csproj @@ -17,7 +17,7 @@ full false Output\ - TRACE;DEBUG;NEWTIMERS, NEWPARENT + TRACE;DEBUG;NEWTIMERS;NEWPARENT prompt 4 false @@ -26,7 +26,7 @@ pdbonly true Output\ - TRACE;NEWTIMERS, NEWPARENT + TRACE;NEWTIMERS;NEWPARENT prompt 4 false @@ -37,7 +37,7 @@ true Output\ - TRACE;DEBUG;NEWTIMERS, NEWPARENT + TRACE;DEBUG;NEWTIMERS;NEWPARENT full x64 prompt @@ -46,7 +46,7 @@ Output\ - TRACE;NEWTIMERS, NEWPARENT + TRACE;NEWTIMERS;NEWPARENT true pdbonly x64 @@ -55,7 +55,6 @@ false - @@ -3300,8 +3299,7 @@ Server - - \ No newline at end of file +