diff --git a/Scripts/Items/Containers/Container.cs b/Scripts/Items/Containers/Container.cs index 95dec3642..8453f12ae 100644 --- a/Scripts/Items/Containers/Container.cs +++ b/Scripts/Items/Containers/Container.cs @@ -152,6 +152,74 @@ namespace Server.Items } } + public class CreatureBackpack : Backpack //Used on BaseCreature + { + [Constructable] + public CreatureBackpack( string name ) + { + Name = name; + Layer = Layer.Backpack; + Hue = 5; + Weight = 3.0; + } + + public override void AddNameProperty( ObjectPropertyList list ) + { + if ( Name != null ) + list.Add( 1075257, Name ); // Contents of ~1_PETNAME~'s pack. + else + base.AddNameProperty( list ); + } + + public override void OnItemRemoved( Item item ) + { + if ( Items.Count == 0 ) + this.Delete(); + + base.OnItemRemoved( item ); + } + + public override bool OnDragLift( Mobile from ) + { + if ( from.AccessLevel > AccessLevel.Player ) + return true; + + from.SendLocalizedMessage( 500169 ); // You cannot pick that up. + return false; + } + + public override bool OnDragDropInto( Mobile from, Item item, Point3D p ) + { + return false; + } + + public override bool TryDropItem( Mobile from, Item dropped, bool sendFullMessage ) + { + return false; + } + + public CreatureBackpack( Serial serial ) : base( serial ) + { + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + + writer.Write( (int) 1 ); // version + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + + int version = reader.ReadInt(); + + if ( version == 0 ) + Weight = 13.0; + } + } + public class StrongBackpack : Backpack //Used on Pack animals { [Constructable] diff --git a/Scripts/Items/Games/Chessboard.cs b/Scripts/Items/Games/Chessboard.cs index 83b2b01dd..58747682a 100644 --- a/Scripts/Items/Games/Chessboard.cs +++ b/Scripts/Items/Games/Chessboard.cs @@ -16,38 +16,38 @@ namespace Server.Items { for ( int i = 0; i < 8; i++ ) { - CreatePiece( new PieceBlackPawn( this ), ( 25 * i ) + 43, 42 ); - CreatePiece( new PieceWhitePawn( this ), ( 25 * i ) + 43, 167 ); + CreatePiece( new PieceBlackPawn( this ), 67, ( 25 * i ) + 17 ); + CreatePiece( new PieceWhitePawn( this ), 192, ( 25 * i ) + 17 ); } // Rook CreatePiece( new PieceBlackRook( this ), 42, 5 ); - CreatePiece( new PieceBlackRook( this ), 216, 5 ); + CreatePiece( new PieceBlackRook( this ), 42, 180 ); - CreatePiece( new PieceWhiteRook( this ), 42, 180 ); + CreatePiece( new PieceWhiteRook( this ), 216, 5 ); CreatePiece( new PieceWhiteRook( this ), 216, 180 ); // Knight - CreatePiece( new PieceBlackKnight( this ), 66, 7 ); - CreatePiece( new PieceBlackKnight( this ), 190, 7 ); + CreatePiece( new PieceBlackKnight( this ), 42, 30 ); + CreatePiece( new PieceBlackKnight( this ), 42, 155 ); - CreatePiece( new PieceWhiteKnight( this ), 66, 182 ); - CreatePiece( new PieceWhiteKnight( this ), 190, 182 ); + CreatePiece( new PieceWhiteKnight( this ), 216, 30 ); + CreatePiece( new PieceWhiteKnight( this ), 216, 155 ); // Bishop - CreatePiece( new PieceBlackBishop( this ), 94, 7 ); - CreatePiece( new PieceBlackBishop( this ), 168, 7 ); + CreatePiece( new PieceBlackBishop( this ), 42, 55 ); + CreatePiece( new PieceBlackBishop( this ), 42, 130 ); - CreatePiece( new PieceWhiteBishop( this ), 94, 182 ); - CreatePiece( new PieceWhiteBishop( this ), 168, 182 ); + CreatePiece( new PieceWhiteBishop( this ), 216, 55 ); + CreatePiece( new PieceWhiteBishop( this ), 216, 130 ); // Queen - CreatePiece( new PieceBlackQueen( this ), 142, 5 ); - CreatePiece( new PieceWhiteQueen( this ), 142, 180 ); + CreatePiece( new PieceBlackQueen( this ), 42, 105 ); + CreatePiece( new PieceWhiteQueen( this ), 216, 105 ); // King - CreatePiece( new PieceBlackKing( this ), 117, 5 ); - CreatePiece( new PieceWhiteKing( this ), 117, 180 ); + CreatePiece( new PieceBlackKing( this ), 42, 80 ); + CreatePiece( new PieceWhiteKing( this ), 216, 80 ); } public Chessboard( Serial serial ) : base( serial ) diff --git a/Scripts/Mobiles/AI/AI/BaseAI.cs b/Scripts/Mobiles/AI/AI/BaseAI.cs index 4a39c5ccf..ba5f2f9ee 100644 --- a/Scripts/Mobiles/AI/AI/BaseAI.cs +++ b/Scripts/Mobiles/AI/AI/BaseAI.cs @@ -1558,6 +1558,7 @@ namespace Server.Mobiles m_Mobile.Delete(); m_Mobile.BeginDeleteTimer(); + m_Mobile.DropBackpack(); return true; } diff --git a/Scripts/Mobiles/AI/Creature/BaseCreature.cs b/Scripts/Mobiles/AI/Creature/BaseCreature.cs index 10d01fc79..83b6d8e4a 100644 --- a/Scripts/Mobiles/AI/Creature/BaseCreature.cs +++ b/Scripts/Mobiles/AI/Creature/BaseCreature.cs @@ -5,6 +5,7 @@ using Server; using Server.Regions; using Server.Targeting; using Server.Network; +using Server.Multis; using Server.Spells; using Server.Misc; using Server.Items; @@ -3675,6 +3676,29 @@ namespace Server.Mobiles PackWeapon( minLevel, maxLevel, weaponChance ); } + public virtual void DropBackpack() + { + if ( Backpack != null ) + { + if( Backpack.Items.Count > 0 ) + { + Backpack b = new CreatureBackpack( Name ); + + List list = new List( Backpack.Items ); + foreach ( Item item in list ) + { + b.DropItem( item ); + } + + BaseHouse house = BaseHouse.FindHouseAt( this ); + if ( house != null ) + b.MoveToWorld( house.BanLocation, house.Map ); + else + b.MoveToWorld( Location, Map ); + } + } + } + protected bool m_Spawning; protected int m_KillersLuck; @@ -5278,6 +5302,7 @@ namespace Server.Mobiles c.ControlTarget = null; //c.ControlOrder = OrderType.Release; c.AIObject.DoOrderRelease(); // this will prevent no release of creatures left alone with AI disabled (and consequent bug of Followers) + c.DropBackpack(); } // added code to handle removing of wild creatures in house regions diff --git a/Scripts/Skills/Discordance.cs b/Scripts/Skills/Discordance.cs index b7bd5490d..dfa3ea175 100644 --- a/Scripts/Skills/Discordance.cs +++ b/Scripts/Skills/Discordance.cs @@ -144,7 +144,7 @@ namespace Server.SkillHandlers { private BaseInstrument m_Instrument; - public DiscordanceTarget( Mobile from, BaseInstrument inst ) : base( BaseInstrument.GetBardRange( from, SkillName.Discordance ), false, TargetFlags.Harmful ) + public DiscordanceTarget( Mobile from, BaseInstrument inst ) : base( BaseInstrument.GetBardRange( from, SkillName.Discordance ), false, TargetFlags.None ) { m_Instrument = inst; } @@ -162,7 +162,7 @@ namespace Server.SkillHandlers { Mobile targ = (Mobile)target; - if ( targ == from || (targ is BaseCreature && ( ((BaseCreature)targ).BardImmune || !from.CanBeHarmful( targ, false ) )) ) + if ( targ == from || (targ is BaseCreature && ( ((BaseCreature)targ).BardImmune || !from.CanBeHarmful( targ, false ) ) && ((BaseCreature)targ).ControlMaster != from) ) { from.SendLocalizedMessage( 1049535 ); // A song of discord would have no effect on that. } diff --git a/Scripts/Skills/Stealth.cs b/Scripts/Skills/Stealth.cs index 8d0c5cb05..bd61a8868 100644 --- a/Scripts/Skills/Stealth.cs +++ b/Scripts/Skills/Stealth.cs @@ -61,7 +61,7 @@ namespace Server.SkillHandlers { m.SendLocalizedMessage( 502725 ); // You must hide first } - else if ( m.Skills[SkillName.Hiding].Base < ((Core.SE) ? 50.0 : 80.0) ) + else if ( m.Skills[SkillName.Hiding].Base < ((Core.ML) ? 30.0 : (Core.SE) ? 50.0 : 80.0) ) { m.SendLocalizedMessage( 502726 ); // You are not hidden well enough. Become better at hiding. m.RevealingAction(); diff --git a/Scripts/Spells/Sixth/Invisibility.cs b/Scripts/Spells/Sixth/Invisibility.cs index af2c48e06..f4c0c08a6 100644 --- a/Scripts/Spells/Sixth/Invisibility.cs +++ b/Scripts/Spells/Sixth/Invisibility.cs @@ -45,6 +45,7 @@ namespace Server.Spells.Sixth m.PlaySound( 0x3C4 ); m.Hidden = true; + m.Combatant = null; m.Warmode = false; RemoveTimer( m ); @@ -94,6 +95,7 @@ namespace Server.Spells.Sixth protected override void OnTick() { + if ( !m_Mobile.Hidden ) m_Mobile.RevealingAction(); RemoveTimer( m_Mobile ); }