diff --git a/Scripts/Commands/GenTeleporter.cs b/Scripts/Commands/GenTeleporter.cs index ef7a47a32..7600c607c 100644 --- a/Scripts/Commands/GenTeleporter.cs +++ b/Scripts/Commands/GenTeleporter.cs @@ -197,9 +197,9 @@ namespace Server.Commands CreateTeleporter( 5594, 1841, -9, 5467, 1805, 7, map, false ); // Wrong - CreateTeleporter( 5824, 631, 0, 2041, 215, 14, map, true ); - CreateTeleporter( 5825, 631, 0, 2042, 215, 14, map, true ); - CreateTeleporter( 5826, 631, 0, 2043, 215, 14, map, true ); + CreateTeleporter( 5824, 631, 5, 2041, 215, 14, map, true ); + CreateTeleporter( 5825, 631, 5, 2042, 215, 14, map, true ); + CreateTeleporter( 5825, 631, 5, 2043, 215, 14, map, true ); CreateTeleporter( 5698, 662, 0, 5793, 527, 10, map, false ); DestroyTeleporter( 5863, 525, 15, map ); diff --git a/Scripts/Engines/Doom/LeverPuzzle/LeverPuzzleController.cs b/Scripts/Engines/Doom/LeverPuzzle/LeverPuzzleController.cs index c9a4ffa41..d2cbf1aa9 100644 --- a/Scripts/Engines/Doom/LeverPuzzle/LeverPuzzleController.cs +++ b/Scripts/Engines/Doom/LeverPuzzle/LeverPuzzleController.cs @@ -5,7 +5,6 @@ using Server.Network; using Server.Mobiles; using Server.Commands; using System.Collections.Generic; -using System.Collections; /* this is From me to you, Under no terms, Conditions... K? to apply you @@ -22,10 +21,10 @@ namespace Server.Engines.Doom private UInt16 m_MyKey; private UInt16 m_TheirKey; - private ArrayList m_Levers; - private ArrayList m_Teles; - private ArrayList m_Statues; - private ArrayList m_Tiles; + private List m_Levers; + private List m_Teles; + private List m_Statues; + private List m_Tiles; private Mobile m_Successful; private LampRoomBox m_Box; private Region m_LampRoom; @@ -92,19 +91,19 @@ namespace Server.Engines.Doom installed=true; int i=0; - m_Levers = new ArrayList(); /* codes are 0x1 shifted left x # of bits, easily handled here */ + m_Levers = new List(); /* codes are 0x1 shifted left x # of bits, easily handled here */ for (; i<4; i++) m_Levers.Add( AddLeverPuzzlePart( TA[i], new LeverPuzzleLever( (ushort)(1<(); for (; i<9; i++) m_Tiles.Add( new LeverPuzzleRegion( this, TA[i] )); - m_Teles = new ArrayList(); + m_Teles = new List(); for (; i<15; i++) m_Teles.Add( AddLeverPuzzlePart( TA[i], new LampRoomTelePorter( TA[++i] ))); - m_Statues = new ArrayList(); + m_Statues = new List(); for (; i<19; i++) m_Statues.Add( AddLeverPuzzlePart( TA[i], new LeverPuzzleStatue( TA[++i], this ))); @@ -159,7 +158,7 @@ namespace Server.Engines.Doom } } - public static void NukeItemList( ArrayList list ) + public static void NukeItemList( List list ) { if ( list != null && list.Count != 0 ) { @@ -395,16 +394,21 @@ namespace Server.Engines.Doom { IEntity m_IEntity = new Entity( Serial.Zero, RandomPointIn( m_Player.Location, 10 ), m_Player.Map ); - foreach( Mobile m in m_IEntity.Map.GetMobilesInRange( m_IEntity.Location, 2 ) ) + List mobiles = new List(); + foreach( Mobile m in m_IEntity.Map.GetMobilesInRange( m_IEntity.Location, 2 )) { - if( IsValidDamagable( m ) && m != m_Player ) + mobiles.Add( m ); + } + for( int k=0; k(); for (int i = 4; i<9; i++) m_Tiles.Add( new LeverPuzzleRegion( this, TA[i] )); diff --git a/Scripts/Engines/Virtues/Sacrifice.cs b/Scripts/Engines/Virtues/Sacrifice.cs index 5ecc3cce9..621f1344d 100644 --- a/Scripts/Engines/Virtues/Sacrifice.cs +++ b/Scripts/Engines/Virtues/Sacrifice.cs @@ -20,10 +20,15 @@ namespace Server public static void OnVirtueUsed( Mobile from ) { - if ( from.Alive ) - from.Target = new InternalTarget(); - else - Resurrect( from ); + if ( !from.Hidden ) + { + if ( from.Alive ) + from.Target = new InternalTarget(); + else + Resurrect( from ); + } + else + from.SendLocalizedMessage( 1052015 ); // You cannot do that while hidden. } public static void CheckAtrophy( Mobile from ) diff --git a/Scripts/Gumps/RunebookGump.cs b/Scripts/Gumps/RunebookGump.cs index d29f8ec3e..bfcf70530 100644 --- a/Scripts/Gumps/RunebookGump.cs +++ b/Scripts/Gumps/RunebookGump.cs @@ -266,14 +266,14 @@ namespace Server.Gumps if ( buttonID == 1 ) // Rename book { - if ( m_Book.CheckAccess( from ) ) + if ( !m_Book.IsLockedDown || from.AccessLevel >= AccessLevel.GameMaster ) { from.SendLocalizedMessage( 502414 ); // Please enter a title for the runebook: from.Prompt = new InternalPrompt( m_Book ); } else { - from.SendLocalizedMessage( 502413 ); // That cannot be done while the book is locked down. + from.SendLocalizedMessage( 502413, null, 0x35 ); // That cannot be done while the book is locked down. } } else @@ -319,7 +319,7 @@ namespace Server.Gumps } case 1: // Drop rune { - if ( m_Book.CheckAccess( from ) ) + if ( !m_Book.IsLockedDown || from.AccessLevel >= AccessLevel.GameMaster ) { m_Book.DropRune( from, e, index ); @@ -328,7 +328,7 @@ namespace Server.Gumps } else { - from.SendLocalizedMessage( 502413 ); // That cannot be done while the book is locked down. + from.SendLocalizedMessage( 502413, null, 0x35 ); // That cannot be done while the book is locked down. } break; @@ -344,10 +344,6 @@ namespace Server.Gumps from.SendLocalizedMessage( 502417 ); // New default location set. } - else - { - from.SendLocalizedMessage( 502413 ); // That cannot be done while the book is locked down. - } break; } diff --git a/Scripts/Items/Containers/Container.cs b/Scripts/Items/Containers/Container.cs index c31e4a456..1786824fb 100644 --- a/Scripts/Items/Containers/Container.cs +++ b/Scripts/Items/Containers/Container.cs @@ -859,6 +859,7 @@ namespace Server.Items [Constructable] public WoodenFootLocker() : base( 0x2811 ) { + GumpID = 0x10B; } public WoodenFootLocker( Serial serial ) : base( serial ) @@ -869,7 +870,7 @@ namespace Server.Items { base.Serialize( writer ); - writer.Write( (int) 1 ); // version + writer.Write( (int) 2 ); // version } public override void Deserialize( GenericReader reader ) @@ -880,6 +881,9 @@ namespace Server.Items if ( version == 0 && Weight == 15 ) Weight = -1; + + if ( version < 2 ) + GumpID = 0x10B; } } diff --git a/Scripts/Items/Deeds/CommodityDeed.cs b/Scripts/Items/Deeds/CommodityDeed.cs index de8d2c91b..d0580512a 100644 --- a/Scripts/Items/Deeds/CommodityDeed.cs +++ b/Scripts/Items/Deeds/CommodityDeed.cs @@ -107,6 +107,8 @@ namespace Server.Items if ( m_Commodity != null && m_Commodity is ICommodity ) list.Add( 1060658, "#{0}\t{1}", ((ICommodity)m_Commodity).DescriptionNumber, m_Commodity.Amount ); // ~1_val~: ~2_val~ + else + list.Add( 1060748 ); // unfilled } public override void OnSingleClick( Mobile from ) diff --git a/Scripts/Items/Misc/DeceitBrazier.cs b/Scripts/Items/Misc/DeceitBrazier.cs new file mode 100644 index 000000000..20c0b6270 --- /dev/null +++ b/Scripts/Items/Misc/DeceitBrazier.cs @@ -0,0 +1,299 @@ +/*************************************************************************** +* DeceitBrazier.cs +* Author : phoenix_smasher7 (ps7) +* Version : 3.0 +* +****************************************************************************/ + +/*************************************************************************** +* Description: +* +* Just a little spawning system OSI made and which RunUO lacked. +* DClicking brazier will spawn a random creature listed in m_Creatures. +* +****************************************************************************/ + +/*************************************************************************** + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + ***************************************************************************/ + + /*************************************************************************** + * Clilocs used: + * + * 500760 - The brazier fizzes and pops, but nothing seems to happen. + * 500761 - Heed this warning well, and use this brazier at your own peril. + * + ***************************************************************************/ + + /*************************************************************************** + * Changelog: + * + * v1.5 + * Label was incorrect.Corrected. + * Brazier will now only warn you if brazier can spawn another creature. + * Added many other creatures to spawn list. + * v1.6 + * Added missing elementals. + * Removed nonagressive critters. + * v2.0 + * Added some other missing creatures. + * Added spawn range so that it will not always spawn on top of the brazier. + * Added the flamestrike effect when creature spawned. + * v2.1 + * Removed Jukas from the list since they no longer spawn in Britannia. + * v2.2 + * Code cleanup + * v2.3 + * Changed cooldown message to display as overhead message. + * v2.4 + * Added ability to control usage of the brazier.By returning the value to true + * in game you will be able to use the brazier again without having to wait for 15 minutes. + * v3.0 + * Medium code change. + * Made the spawner more customizable so it can fit others needs too. + * Just set the CanTalk true and Delay to anything you want ingame and use it and you are ready to go. + * Also fixed the serialization error. + * It is highly recommended that you remove any trace left by older scripts. + * v3.1 + * Removed the delay between warnings. + * + ***************************************************************************/ + + /*************************************************************************** +* Notes: +* +* No Matter what I've tried I have failed to create a timer that will queue the effects.In OSI it's like +* FireColumn01 Spawns +* 1 Second passes +* FireColumn02 Spawns along with our creature. // At least this is the Information I got from Erica. +* If someone else could confirm it would remove further doubts. +* Where I couldn't succeed was the coordinates where our second effect and creature spawn. +* Creatures kept spawning at internal with coordinates of x0y0z0. +* If anyone is willing to help out with that one it's more than appreciated. +* +****************************************************************************/ + +using System; +using Server; +using Server.Misc; +using Server.Network; +using System.Collections; +using Server.Mobiles; + +namespace Server.Items +{ + public class DeceitBrazier : Item + { + private Timer m_Timer; + private bool m_CanTalk; + private int m_SpawnRange; + private DateTime m_LastUse = DateTime.MinValue; + private TimeSpan m_Delay; + private DateTime m_NextUse; + + [CommandProperty( AccessLevel.Counselor, AccessLevel.GameMaster )] + public DateTime LastUse + { + get{ return m_LastUse; } + set{ m_LastUse = value; } + } + + [CommandProperty(AccessLevel.GameMaster)] + public DateTime NextUse + { + get { return m_NextUse; } + } + + [CommandProperty(AccessLevel.GameMaster)] + public TimeSpan Delay + { + get { return m_Delay; } + set + { + m_NextUse = m_NextUse - m_Delay; + m_Delay = value; + m_NextUse = m_NextUse + m_Delay; + } + } + + [CommandProperty(AccessLevel.GameMaster)] + public bool CanTalk + { + get{ return m_CanTalk; } + set + { + m_CanTalk = value; + } + } + + private static Type[] m_Creatures = new Type[] + { + #region Animals + typeof( FireSteed ), //Set the tents up people! + #endregion + + #region Undead + typeof( Skeleton ), typeof( SkeletalKnight ), typeof( SkeletalMage ), typeof( Mummy ), + typeof( BoneKnight ), typeof( Lich ), typeof( LichLord ), typeof( BoneMagi ), + typeof( Wraith ), typeof( Shade ), typeof( Spectre ), typeof( Zombie ), + typeof( RottingCorpse ), typeof( Ghoul ), + #endregion + + #region Demons + typeof( Balron ), typeof( Daemon ), typeof( Imp ), typeof( GreaterMongbat ), + typeof( Mongbat ), typeof( IceFiend ), typeof( Gargoyle ), typeof( StoneGargoyle ), + typeof( FireGargoyle ), typeof( HordeMinion ), + #endregion + + #region Gazers + typeof( Gazer ), typeof( ElderGazer ), typeof( GazerLarva ), + #endregion + + #region Uncategorized + typeof( Harpy ), typeof( StoneHarpy ), typeof( HeadlessOne ), typeof( HellHound ), + typeof( HellCat ), typeof( Phoenix ), typeof( LavaLizard ), typeof( SandVortex ), + typeof( ShadowWisp ), typeof( SwampTentacle ), typeof( PredatorHellCat ), typeof( Wisp ), + #endregion + + #region Arachnid + typeof( GiantSpider ), typeof( DreadSpider ), typeof( FrostSpider ), typeof( Scorpion ), + #endregion + + #region Repond + typeof( ArcticOgreLord ), typeof( Cyclops ), typeof( Ettin ), typeof( EvilMage ), + typeof( FrostTroll ), typeof( Ogre ), typeof( OgreLord ), typeof( Orc ), + typeof( OrcishLord ), typeof( OrcishMage ), typeof( OrcBrute ), typeof( Ratman ), + typeof( RatmanMage ), typeof( OrcCaptain ), typeof( Troll ), typeof( Titan ), + typeof( EvilMageLord ), typeof( OrcBomber ), typeof( RatmanArcher ), + #endregion + + #region Reptilian + typeof( Dragon ), typeof( Drake ), typeof( Snake ), typeof( GreaterDragon ), + typeof( IceSerpent ), typeof( GiantSerpent ), typeof( IceSnake ), typeof( LavaSerpent ), + typeof( Lizardman ), typeof( Wyvern ), typeof( WhiteWyrm ), + typeof( ShadowWyrm ), typeof( SilverSerpent ), typeof( LavaSnake ), + #endregion + + #region Elementals + typeof( EarthElemental ), typeof( PoisonElemental ), typeof( FireElemental ), typeof( SnowElemental ), + typeof( IceElemental ), typeof( ToxicElemental ), typeof( WaterElemental ), typeof( Efreet ), + typeof( AirElemental ), typeof( Golem ), + #endregion + + #region Random Critters + typeof( Sewerrat ), typeof( GiantRat ), typeof( DireWolf ), typeof( TimberWolf ), + typeof( Cougar ), typeof( Alligator ) + #endregion + }; + + public static Type[] Creatures { get { return m_Creatures; } } + + public override int LabelNumber{ get{ return 1023633; } } // Brazier + + [Constructable] + public DeceitBrazier() : base( 0xE31 ) + { + Movable = false; + Light = LightType.Circle225; + } + + public DeceitBrazier( Serial serial ) : base( serial ) + { + } + + public override void OnDoubleClick( Mobile from ) + { + if ( from.InRange( GetWorldLocation(), 2 ) ) + { + Mobile m = null; + try + { + if(m_NextUse <= DateTime.Now) + { + Map map = Map; + m = Activator.CreateInstance( m_Creatures[Utility.Random( m_Creatures.Length )] ) as Mobile; + + Point3D loc = ( GetSpawnPosition() ); + + m.MoveToWorld( loc, map ); + Effects.SendLocationParticles( EffectItem.Create( m.Location, m.Map, EffectItem.DefaultDuration ), 0x3709, 10, 30, 5052 ); + + m_LastUse = DateTime.Now; + m_NextUse = DateTime.Now + m_Delay; + } + else if ( m_NextUse > DateTime.Now ) + { + PublicOverheadMessage( MessageType.Regular, 0x3B2, 500760 ); // The brazier fizzes and pops, but nothing seems to happen. + } + } + catch + { } + } + else + { + from.SendLocalizedMessage( 500446 ); // That is too far away. + } + } + + private void TalkAgain() + { + if( m_NextUse <= DateTime.Now ) + m_CanTalk = true; + } + + public Point3D GetSpawnPosition() + { + m_SpawnRange = 6; + Map map = Map; + + int x = Location.X + (Utility.Random( (m_SpawnRange * 2) + 1 ) - m_SpawnRange); + int y = Location.Y + (Utility.Random( (m_SpawnRange * 2) + 1 ) - m_SpawnRange); + + return new Point3D( x, y, this.Z ); + } + + public override bool HandlesOnMovement{ get{ return true; } } + + public override void OnMovement(Mobile m, Point3D oldLocation) + { + if ( m.InRange( this, 1 ) && m.Player && m_NextUse <= DateTime.Now && !( m.AccessLevel > AccessLevel.Player && m.Hidden ) && m_CanTalk ) + { + PublicOverheadMessage( MessageType.Regular, 0x3B2, 500761 ); // Heed this warning well, and use this brazier at your own peril. + base.OnMovement( m, oldLocation ); + + m_Timer = Timer.DelayCall( TimeSpan.FromMinutes( 15 ), new TimerCallback( TalkAgain ) ); + } + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 0 ); // version + + writer.Write( (bool) m_CanTalk ); + + writer.Write( (DateTime)m_LastUse ); + writer.Write( (DateTime)m_NextUse ); + writer.Write( (int)m_SpawnRange ); + writer.Write( (TimeSpan)m_Delay ); + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadInt(); + m_CanTalk = reader.ReadBool(); + m_LastUse = reader.ReadDateTime(); + m_NextUse = reader.ReadDateTime(); + m_SpawnRange = reader.ReadInt(); + m_Delay = reader.ReadTimeSpan(); + } + } +} diff --git a/Scripts/Items/Misc/InteriorDecorator.cs b/Scripts/Items/Misc/InteriorDecorator.cs index 1295b6d76..46ca7676b 100644 --- a/Scripts/Items/Misc/InteriorDecorator.cs +++ b/Scripts/Items/Misc/InteriorDecorator.cs @@ -62,10 +62,11 @@ namespace Server.Items { if ( !CheckUse( this, from ) ) return; - - if ( m_Command == DecorateCommand.None ) + + if ( from.FindGump( typeof( InteriorDecorator.InternalGump ) ) == null ) from.SendGump( new InternalGump( this ) ); - else + + if ( m_Command != DecorateCommand.None ) from.Target = new InternalTarget( this ); } @@ -99,13 +100,13 @@ namespace Server.Items AddBackground( 0, 0, 200, 200, 2600 ); - AddButton( 50, 45, 2152, 2154, 1, GumpButtonType.Reply, 0 ); + AddButton( 50, 45, ( decorator.Command == DecorateCommand.Turn ? 2154 : 2152 ), 2154, 1, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 90, 50, 70, 40, 1018323, false, false ); // Turn - AddButton( 50, 95, 2152, 2154, 2, GumpButtonType.Reply, 0 ); + AddButton( 50, 95, ( decorator.Command == DecorateCommand.Up ? 2154 : 2152 ), 2154, 2, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 90, 100, 70, 40, 1018324, false, false ); // Up - AddButton( 50, 145, 2152, 2154, 3, GumpButtonType.Reply, 0 ); + AddButton( 50, 145, ( decorator.Command == DecorateCommand.Down ? 2154 : 2152 ), 2154, 3, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 90, 150, 70, 40, 1018325, false, false ); // Down } @@ -123,8 +124,11 @@ namespace Server.Items if ( command != DecorateCommand.None ) { m_Decorator.Command = command; + sender.Mobile.SendGump( new InternalGump( m_Decorator ) ); sender.Mobile.Target = new InternalTarget( m_Decorator ); } + else + Target.Cancel( sender.Mobile ); } } @@ -146,15 +150,16 @@ namespace Server.Items protected override void OnTarget( Mobile from, object targeted ) { - if ( targeted == m_Decorator ) - { - m_Decorator.Command = DecorateCommand.None; - from.SendGump( new InternalGump( m_Decorator ) ); - } - else if ( targeted is Item && InteriorDecorator.CheckUse( m_Decorator, from ) ) + if ( targeted is Item && InteriorDecorator.CheckUse( m_Decorator, from ) ) { BaseHouse house = BaseHouse.FindHouseAt( from ); Item item = (Item)targeted; + + bool isDecorableComponent = false; + + if ( item is AddonComponent ) + if ( ((AddonComponent)item).Addon.Components.Count == 1 && Core.SE ) + isDecorableComponent = true; if ( house == null || !house.IsCoOwner( from ) ) { @@ -164,9 +169,14 @@ namespace Server.Items { from.SendLocalizedMessage( 1042270 ); // That is not in your house. } - else if ( !house.IsLockedDown( item ) && !house.IsSecure( item ) ) + else if ( !house.IsLockedDown( item ) && !house.IsSecure( item ) && !isDecorableComponent ) { - from.SendLocalizedMessage( 1042271 ); // That is not locked down. + if ( item is AddonComponent && m_Decorator.Command == DecorateCommand.Up ) + from.SendLocalizedMessage( 1042274 ); // You cannot raise it up any higher. + else if ( item is AddonComponent && m_Decorator.Command == DecorateCommand.Down ) + from.SendLocalizedMessage( 1042275 ); // You cannot lower it down any further. + else + from.SendLocalizedMessage( 1042271 ); // That is not locked down. } else if ( item is VendorRentalContract ) { @@ -186,6 +196,14 @@ namespace Server.Items } } } + + from.Target = new InternalTarget( m_Decorator ); + } + + protected override void OnTargetCancel( Mobile from, TargetCancelType cancelType ) + { + if ( cancelType == TargetCancelType.Canceled ) + from.CloseGump( typeof( InteriorDecorator.InternalGump ) ); } private static void Turn( Item item, Mobile from ) diff --git a/Scripts/Items/Skill Items/Magical/Misc/BlankScroll.cs b/Scripts/Items/Skill Items/Magical/Misc/BlankScroll.cs index e3f9bffca..0c63b8250 100644 --- a/Scripts/Items/Skill Items/Magical/Misc/BlankScroll.cs +++ b/Scripts/Items/Skill Items/Magical/Misc/BlankScroll.cs @@ -2,7 +2,7 @@ using System; namespace Server.Items { - public class BlankScroll : Item + public class BlankScroll : Item, ICommodity { [Constructable] public BlankScroll() : this( 1 ) @@ -17,6 +17,16 @@ namespace Server.Items Amount = amount; } + string ICommodity.Description + { + get + { + return String.Format( "blank scroll: {0}", Amount ); + } + } + + int ICommodity.DescriptionNumber { get { return LabelNumber; } } + public BlankScroll( Serial serial ) : base( serial ) { } diff --git a/Scripts/Items/Skill Items/Magical/Runebook.cs b/Scripts/Items/Skill Items/Magical/Runebook.cs index 7f24c98fb..53310592c 100644 --- a/Scripts/Items/Skill Items/Magical/Runebook.cs +++ b/Scripts/Items/Skill Items/Magical/Runebook.cs @@ -215,7 +215,9 @@ namespace Server.Items public void DropRune( Mobile from, RunebookEntry e, int index ) { - if ( m_DefaultIndex == index ) + if ( m_DefaultIndex > index ) + m_DefaultIndex -= 1; + else if ( m_DefaultIndex == index ) m_DefaultIndex = -1; m_Entries.RemoveAt( index ); @@ -276,7 +278,7 @@ namespace Server.Items public override void OnDoubleClick( Mobile from ) { - if ( from.InRange( GetWorldLocation(), (Core.ML ? 3 : 1) ) ) + if ( from.InRange( GetWorldLocation(), (Core.ML ? 3 : 1) ) && CheckAccess( from ) ) { if ( DateTime.Now < NextUse ) { @@ -328,9 +330,9 @@ namespace Server.Items { if ( dropped is RecallRune ) { - if ( !CheckAccess( from ) ) + if ( IsLockedDown && from.AccessLevel < AccessLevel.GameMaster ) { - from.SendLocalizedMessage( 502413 ); // That cannot be done while the book is locked down. + from.SendLocalizedMessage( 502413, null, 0x35 ); // That cannot be done while the book is locked down. } else if ( IsOpen( from ) ) { diff --git a/Scripts/Items/Skill Items/Tailor Items/Dyetubs/DyeTub.cs b/Scripts/Items/Skill Items/Tailor Items/Dyetubs/DyeTub.cs index 90180be9b..07c2b3c4a 100644 --- a/Scripts/Items/Skill Items/Tailor Items/Dyetubs/DyeTub.cs +++ b/Scripts/Items/Skill Items/Tailor Items/Dyetubs/DyeTub.cs @@ -1,7 +1,10 @@ using System; +using System.Collections.Generic; using Server; using Server.Multis; using Server.Targeting; +using Server.ContextMenus; +using Server.Gumps; namespace Server.Items { @@ -10,10 +13,11 @@ namespace Server.Items bool Dye( Mobile from, DyeTub sender ); } - public class DyeTub : Item + public class DyeTub : Item, ISecurable { private bool m_Redyable; private int m_DyedHue; + private SecureLevel m_SecureLevel; public virtual CustomHuePicker CustomHuePicker{ get{ return null; } } @@ -46,8 +50,9 @@ namespace Server.Items { base.Serialize( writer ); - writer.Write( (int) 0 ); // version - + writer.Write( (int) 1 ); // version + + writer.Write( (int)m_SecureLevel ); writer.Write( (bool) m_Redyable ); writer.Write( (int) m_DyedHue ); } @@ -60,6 +65,11 @@ namespace Server.Items switch ( version ) { + case 1: + { + m_SecureLevel = (SecureLevel)reader.ReadInt(); + goto case 0; + } case 0: { m_Redyable = reader.ReadBool(); @@ -99,6 +109,19 @@ namespace Server.Items } } } + + [CommandProperty( AccessLevel.GameMaster )] + public SecureLevel Level + { + get + { + return m_SecureLevel; + } + set + { + m_SecureLevel = value; + } + } [Constructable] public DyeTub() : base( 0xFAB ) @@ -106,6 +129,12 @@ namespace Server.Items Weight = 10.0; m_Redyable = true; } + + public override void GetContextMenuEntries( Mobile from, List list ) + { + base.GetContextMenuEntries( from, list ); + SetSecureLevelEntry.AddTo( from, this, list ); + } public DyeTub( Serial serial ) : base( serial ) { diff --git a/Scripts/Misc/AOS.cs b/Scripts/Misc/AOS.cs index e312c0f69..ec82e1732 100644 --- a/Scripts/Misc/AOS.cs +++ b/Scripts/Misc/AOS.cs @@ -3,8 +3,13 @@ using System.Collections; using System.Collections.Generic; using Server; using Server.Items; +using Server.Misc; using Server.Mobiles; using Server.Network; +using Server.Spells; +using Server.Spells.Fifth; +using Server.Spells.Seventh; +using Server.Spells.Ninjitsu; namespace Server { @@ -644,9 +649,14 @@ namespace Server if( m_Mods == null ) return; - for( int i = 0; i < m_Mods.Count; ++i ) + for( int i = 0; i < m_Mods.Count; ++i ) { + + Mobile m = m_Mods[i].Owner; m_Mods[i].Remove(); + if ( Core.ML ) + CheckCancelMorph ( m ); + } m_Mods = null; } @@ -728,6 +738,53 @@ namespace Server return "..."; } + public void CheckCancelMorph ( Mobile m ) + { + if ( m == null ) + return; + + double minSkill, maxSkill; + + AnimalFormContext acontext = AnimalForm.GetContext( m ); + TransformContext context = TransformationSpellHelper.GetContext( m ); + + if ( context != null ) { + Spell spell = context.Spell as Spell; + spell.GetCastSkills ( out minSkill, out maxSkill ); + if ( m.Skills[spell.CastSkill].Value < minSkill ) + TransformationSpellHelper.RemoveContext( m, context, true ); + } + if ( acontext != null ) { + int i; + for ( i = 0; i < AnimalForm.Entries.Length; ++i ) + if ( AnimalForm.Entries[i].Type == acontext.Type ) + break; + if ( m.Skills[SkillName.Ninjitsu].Value < AnimalForm.Entries[i].ReqSkill ) + AnimalForm.RemoveContext( m, true ); + } + if ( !m.CanBeginAction ( typeof ( PolymorphSpell ) ) && m.Skills[SkillName.Magery].Value < 66.1 ) { + m.BodyMod = 0; + m.HueMod = -1; + m.NameMod = null; + m.EndAction( typeof( PolymorphSpell ) ); + BaseArmor.ValidateMobile( m ); + BaseClothing.ValidateMobile( m ); + } + if ( !m.CanBeginAction ( typeof ( IncognitoSpell ) ) && m.Skills[SkillName.Magery].Value < 38.1 ) { + if ( m is PlayerMobile ) + ((PlayerMobile)m).SetHairMods( -1, -1 ); + m.BodyMod = 0; + m.HueMod = -1; + m.NameMod = null; + m.EndAction( typeof( IncognitoSpell ) ); + BaseArmor.ValidateMobile( m ); + BaseClothing.ValidateMobile( m ); + BuffInfo.RemoveBuff( m, BuffIcon.Incognito ); + } + return; + } + + [CommandProperty( AccessLevel.GameMaster )] public double Skill_1_Value { get { return GetBonus( 0 ); } set { SetBonus( 0, value ); } } diff --git a/Scripts/Misc/Loot.cs b/Scripts/Misc/Loot.cs index 034ca979b..f58ab356f 100644 --- a/Scripts/Misc/Loot.cs +++ b/Scripts/Misc/Loot.cs @@ -187,8 +187,8 @@ namespace Server private static Type[] m_RegularScrollTypes = new Type[] { - typeof( ClumsyScroll ), typeof( CreateFoodScroll ), typeof( FeeblemindScroll ), typeof( HealScroll ), - typeof( MagicArrowScroll ), typeof( NightSightScroll ), typeof( ReactiveArmorScroll ), typeof( WeakenScroll ), + typeof( ReactiveArmorScroll ), typeof( ClumsyScroll ), typeof( CreateFoodScroll ), typeof( FeeblemindScroll ), + typeof( HealScroll ), typeof( MagicArrowScroll ), typeof( NightSightScroll ), typeof( WeakenScroll ), typeof( AgilityScroll ), typeof( CunningScroll ), typeof( CureScroll ), typeof( HarmScroll ), typeof( MagicTrapScroll ), typeof( MagicUnTrapScroll ), typeof( ProtectionScroll ), typeof( StrengthScroll ), typeof( BlessScroll ), typeof( FireballScroll ), typeof( MagicLockScroll ), typeof( PoisonScroll ), diff --git a/Scripts/Mobiles/Monsters/Misc/Melee/EnergyVortex.cs b/Scripts/Mobiles/Monsters/Misc/Melee/EnergyVortex.cs index df49c0525..feaa0ebcd 100644 --- a/Scripts/Mobiles/Monsters/Misc/Melee/EnergyVortex.cs +++ b/Scripts/Mobiles/Monsters/Misc/Melee/EnergyVortex.cs @@ -56,8 +56,8 @@ namespace Server.Mobiles SetResistance( ResistanceType.Energy, 90, 100 ); SetSkill( SkillName.MagicResist, 99.9 ); - SetSkill( SkillName.Tactics, 90.0 ); - SetSkill( SkillName.Wrestling, 100.0 ); + SetSkill( SkillName.Tactics, 100.0 ); + SetSkill( SkillName.Wrestling, 120.0 ); Fame = 0; Karma = 0; diff --git a/Scripts/Mobiles/Vendors/BaseVendor.cs b/Scripts/Mobiles/Vendors/BaseVendor.cs index 7882f0288..83bfed8be 100644 --- a/Scripts/Mobiles/Vendors/BaseVendor.cs +++ b/Scripts/Mobiles/Vendors/BaseVendor.cs @@ -34,6 +34,8 @@ namespace Server.Mobiles public override bool CanTeach { get { return true; } } + public override bool BardImmune { get { return true; } } + public override bool PlayerRangeSensitive { get { return true; } } public virtual bool IsActiveVendor { get { return true; } } diff --git a/Scripts/Mobiles/Vendors/SBInfo/SBMage.cs b/Scripts/Mobiles/Vendors/SBInfo/SBMage.cs index 51bb72d0c..89b7b4790 100644 --- a/Scripts/Mobiles/Vendors/SBInfo/SBMage.cs +++ b/Scripts/Mobiles/Vendors/SBInfo/SBMage.cs @@ -97,8 +97,31 @@ namespace Server.Mobiles Type[] types = Loot.RegularScrollTypes; for ( int i = 0; i < types.Length; ++i ) - Add( types[i], ((i / 8) + 2) * 5 ); + Add(types[i], i + 3 + (i / 4)); // This is NOT 100% OSI accurate. Two spells per circle will be off by 1gp, as OSI's math is slightly different. + + + if ( Core.SE ) + { + Add( typeof( ExorcismScroll ), 1 ); + Add( typeof( AnimateDeadScroll ), 26 ); + Add( typeof( BloodOathScroll ), 26 ); + Add( typeof( CorpseSkinScroll ), 26 ); + Add( typeof( CurseWeaponScroll ), 26 ); + Add( typeof( EvilOmenScroll ), 26 ); + Add( typeof( PainSpikeScroll ), 26 ); + Add( typeof( SummonFamiliarScroll ), 26 ); + Add( typeof( HorrificBeastScroll ), 27 ); + Add( typeof( MindRotScroll ), 39 ); + Add( typeof( PoisonStrikeScroll ), 39 ); + Add( typeof( WraithFormScroll ), 51 ); + Add( typeof( LichFormScroll ), 64 ); + Add( typeof( StrangleScroll ), 64 ); + Add( typeof( WitherScroll ), 64 ); + Add( typeof( VampiricEmbraceScroll ), 101 ); + Add( typeof( VengefulSpiritScroll ), 114 ); } + } } + } } \ No newline at end of file diff --git a/Scripts/Multis/HousePlacement.cs b/Scripts/Multis/HousePlacement.cs index fda59f3a4..db4c408ce 100644 --- a/Scripts/Multis/HousePlacement.cs +++ b/Scripts/Multis/HousePlacement.cs @@ -19,7 +19,8 @@ namespace Server.Multis BadItem, NoSurface, BadRegionHidden, - BadRegionTemp + BadRegionTemp, + InvalidCastleKeep, } public class HousePlacement @@ -63,6 +64,9 @@ namespace Server.Multis if ( map == Map.Ilshenar || SpellHelper.IsFeluccaT2A( map, center ) ) return HousePlacementResult.BadRegion; // No houses in Ilshenar/T2A + if ( map == Map.Malas && ( multiID == 0x007C || multiID == 0x007E ) ) + return HousePlacementResult.InvalidCastleKeep; + NoHousingRegion noHousingRegion = (NoHousingRegion) Region.Find( center, map ).GetRegion( typeof( NoHousingRegion ) ); if ( noHousingRegion != null ) diff --git a/Scripts/Multis/HousePlacementTool.cs b/Scripts/Multis/HousePlacementTool.cs index fa502a209..cb0e7a001 100644 --- a/Scripts/Multis/HousePlacementTool.cs +++ b/Scripts/Multis/HousePlacementTool.cs @@ -367,45 +367,45 @@ namespace Server.Items from.SendLocalizedMessage( 501271 ); // You already own a house, you may not place another! } else - { - BaseHouse house = ConstructHouse( from ); + { + BaseHouse house = ConstructHouse( from ); - if ( house == null ) - return; + if ( house == null ) + return; - house.Price = m_Cost; + house.Price = m_Cost; - if ( from.AccessLevel >= AccessLevel.GameMaster ) - { - from.SendMessage( "{0} gold would have been withdrawn from your bank if you were not a GM.", m_Cost.ToString() ); - } - else - { - if ( Banker.Withdraw( from, m_Cost ) ) - { - from.SendLocalizedMessage( 1060398, m_Cost.ToString() ); // ~1_AMOUNT~ gold has been withdrawn from your bank box. - } - else - { - house.RemoveKeys( from ); - house.Delete(); - from.SendLocalizedMessage( 1060646 ); // You do not have the funds available in your bank box to purchase this house. Try placing a smaller house, or adding gold or checks to your bank box. - return; - } - } + if ( from.AccessLevel >= AccessLevel.GameMaster ) + { + from.SendMessage( "{0} gold would have been withdrawn from your bank if you were not a GM.", m_Cost.ToString() ); + } + else + { + if ( Banker.Withdraw( from, m_Cost ) ) + { + from.SendLocalizedMessage( 1060398, m_Cost.ToString() ); // ~1_AMOUNT~ gold has been withdrawn from your bank box. + } + else + { + house.RemoveKeys( from ); + house.Delete(); + from.SendLocalizedMessage( 1060646 ); // You do not have the funds available in your bank box to purchase this house. Try placing a smaller house, or adding gold or checks to your bank box. + return; + } + } - house.MoveToWorld( center, from.Map ); + house.MoveToWorld( center, from.Map ); - for ( int i = 0; i < toMove.Count; ++i ) - { - object o = toMove[i]; + for ( int i = 0; i < toMove.Count; ++i ) + { + object o = toMove[ i ]; - if ( o is Mobile ) - ( (Mobile)o ).Location = house.BanLocation; - else if ( o is Item ) - ( (Item)o ).Location = house.BanLocation; - } - } + if ( o is Mobile ) + ( (Mobile) o ).Location = house.BanLocation; + else if ( o is Item ) + ( (Item) o ).Location = house.BanLocation; + } + } break; } @@ -425,7 +425,12 @@ namespace Server.Items } case HousePlacementResult.BadRegionTemp: { - from.SendLocalizedMessage( 501270 ); //Lord British has decreed a 'no build' period, thus you cannot build this house at this time. + from.SendLocalizedMessage( 501270 ); // Lord British has decreed a 'no build' period, thus you cannot build this house at this time. + break; + } + case HousePlacementResult.InvalidCastleKeep: + { + from.SendLocalizedMessage( 1061122 ); // Castles and keeps cannot be created here. break; } } @@ -521,6 +526,11 @@ namespace Server.Items from.SendLocalizedMessage( 501270 ); //Lord British has decreed a 'no build' period, thus you cannot build this house at this time. break; } + case HousePlacementResult.InvalidCastleKeep: + { + from.SendLocalizedMessage( 1061122 ); // Castles and keeps cannot be created here. + break; + } } return false; diff --git a/Scripts/Spells/Base/Spell.cs b/Scripts/Spells/Base/Spell.cs index 55dc39dd2..ad4f6e298 100644 --- a/Scripts/Spells/Base/Spell.cs +++ b/Scripts/Spells/Base/Spell.cs @@ -260,14 +260,14 @@ namespace Server.Spells public virtual int GetDamageFixed( Mobile m ) { - m.CheckSkill( DamageSkill, 0.0, m.Skills[DamageSkill].Cap ); + //m.CheckSkill( DamageSkill, 0.0, m.Skills[DamageSkill].Cap ); return m.Skills[DamageSkill].Fixed; } public virtual double GetDamageSkill( Mobile m ) { - m.CheckSkill( DamageSkill, 0.0, m.Skills[DamageSkill].Cap ); + //m.CheckSkill( DamageSkill, 0.0, m.Skills[DamageSkill].Cap ); return m.Skills[DamageSkill].Value; } @@ -291,7 +291,7 @@ namespace Server.Spells targetRS = 0; */ - m_Caster.CheckSkill( DamageSkill, 0.0, 120.0 ); + //m_Caster.CheckSkill( DamageSkill, 0.0, 120.0 ); if( casterEI > targetRS ) scalar = (1.0 + ((casterEI - targetRS) / 500.0)); @@ -575,6 +575,9 @@ namespace Server.Spells GetCastSkills( out minSkill, out maxSkill ); + if ( DamageSkill != CastSkill ) + Caster.CheckSkill( DamageSkill, 0.0, Caster.Skills[ DamageSkill ].Cap ); + return Caster.CheckSkill( CastSkill, minSkill, maxSkill ); } diff --git a/Scripts/Spells/Bushido/SamuraiSpell.cs b/Scripts/Spells/Bushido/SamuraiSpell.cs index e0d6ff1ec..35caf7779 100644 --- a/Scripts/Spells/Bushido/SamuraiSpell.cs +++ b/Scripts/Spells/Bushido/SamuraiSpell.cs @@ -13,6 +13,7 @@ namespace Server.Spells.Bushido public abstract int RequiredMana{ get; } public override SkillName CastSkill{ get{ return SkillName.Bushido; } } + public override SkillName DamageSkill{ get{ return SkillName.Bushido; } } public override bool ClearHandsOnCast{ get{ return false; } } public override bool BlocksMovement{ get{ return false; } } diff --git a/Scripts/Spells/Chivalry/PaladinSpell.cs b/Scripts/Spells/Chivalry/PaladinSpell.cs index 14cd70357..bd54e641d 100644 --- a/Scripts/Spells/Chivalry/PaladinSpell.cs +++ b/Scripts/Spells/Chivalry/PaladinSpell.cs @@ -13,6 +13,7 @@ namespace Server.Spells.Chivalry public abstract int MantraNumber{ get; } public override SkillName CastSkill{ get{ return SkillName.Chivalry; } } + public override SkillName DamageSkill{ get{ return SkillName.Chivalry; } } public override bool ClearHandsOnCast{ get{ return false; } } diff --git a/Scripts/Spells/Ninjitsu/NinjaSpell.cs b/Scripts/Spells/Ninjitsu/NinjaSpell.cs index 63eec5d46..d5de7f748 100644 --- a/Scripts/Spells/Ninjitsu/NinjaSpell.cs +++ b/Scripts/Spells/Ninjitsu/NinjaSpell.cs @@ -13,6 +13,7 @@ namespace Server.Spells.Ninjitsu public abstract int RequiredMana{ get; } public override SkillName CastSkill{ get{ return SkillName.Ninjitsu; } } + public override SkillName DamageSkill{ get{ return SkillName.Ninjitsu; } } public override bool RevealOnCast{ get{ return false; } } public override bool ClearHandsOnCast{ get{ return false; } } diff --git a/Scripts/Spells/Spellweaving/WordOfDeath.cs b/Scripts/Spells/Spellweaving/WordOfDeath.cs index 0c4725b9f..85f63bdf6 100644 --- a/Scripts/Spells/Spellweaving/WordOfDeath.cs +++ b/Scripts/Spells/Spellweaving/WordOfDeath.cs @@ -41,17 +41,24 @@ namespace Server.Spells.Spellweaving Effects.SendMovingParticles( new Entity( Serial.Zero, loc, m.Map ), new Entity( Serial.Zero, m.Location, m.Map ), 0xF5F, 1, 0, true, false, 0x21, 0x3F, 0x251D, 0, 0, EffectLayer.Head, 0 ); - int percentage = 5 + (5 * FocusLevel); + double percentage = 0.05 * FocusLevel; int damage; - if( !m.Player && ((m.Hits / m.HitsMax)*100) < percentage ) + if( !m.Player && (((double)m.Hits / (double)m.HitsMax) < percentage )) { damage = 300; } else { - damage = GetNewAosDamage( (int)Math.Max( Caster.Skills.Spellweaving.Value/24, 1 ) + 4, 1, 4, m ); + int minDamage = (int)Caster.Skills.Spellweaving.Value / 5; + int maxDamage = (int)Caster.Skills.Spellweaving.Value / 3; + damage = Utility.RandomMinMax(minDamage, maxDamage); + int damageBonus = AosAttributes.GetValue( Caster, AosAttribute.SpellDamage ); + if (m.Player && damageBonus > 15) + damageBonus = 15; + damage *= damageBonus + 100; + damage /= 100; } int[] types = new int[4];