diff --git a/Scripts/Commands/Properties.cs b/Scripts/Commands/Properties.cs index fda18cf91..f4107d271 100644 --- a/Scripts/Commands/Properties.cs +++ b/Scripts/Commands/Properties.cs @@ -262,6 +262,10 @@ namespace Server.Commands for ( int i = 0; i < realProps.Length; ++i ) { object obj = realProps[i].GetValue( realObjs[i], null ); + + if( !( obj is IConvertible ) ) + return "Property is not IConvertable."; + long v = (long)Convert.ChangeType( obj, TypeCode.Int64 ); v += realValues[i]; diff --git a/Scripts/Engines/CannedEvil/ChampionSpawn.cs b/Scripts/Engines/CannedEvil/ChampionSpawn.cs index cc3f34772..e51d9575a 100644 --- a/Scripts/Engines/CannedEvil/ChampionSpawn.cs +++ b/Scripts/Engines/CannedEvil/ChampionSpawn.cs @@ -942,7 +942,7 @@ namespace Server.Engines.CannedEvil totalDamage = 0; - foreach (KeyValuePair kvp in m_DamageEntries) + foreach (KeyValuePair kvp in validEntries) { totalDamage += kvp.Value; @@ -969,7 +969,6 @@ namespace Server.Engines.CannedEvil public bool IsEligable( Mobile m, Item Artifact ) { - //return true; return m.Player && m.Alive && m.Region != null && m.Region == m_Region && m.Backpack != null && m.Backpack.CheckHold( m, Artifact, false ); } diff --git a/Scripts/Engines/VeteranRewards/Character Statue Maker/CharacterStatue.cs b/Scripts/Engines/VeteranRewards/Character Statue Maker/CharacterStatue.cs index 0467aa926..55a769119 100644 --- a/Scripts/Engines/VeteranRewards/Character Statue Maker/CharacterStatue.cs +++ b/Scripts/Engines/VeteranRewards/Character Statue Maker/CharacterStatue.cs @@ -13,14 +13,14 @@ using Server.ContextMenus; using Server.Engines.VeteranRewards; namespace Server.Mobiles -{ +{ public enum StatueType { Marble, Jade, Bronze } - + public enum StatuePose { Ready, @@ -30,7 +30,7 @@ namespace Server.Mobiles Fighting, HandsOnHips } - + public enum StatueMaterial { Antique, @@ -38,57 +38,57 @@ namespace Server.Mobiles Medium, Light } - + public class CharacterStatue : Mobile, IRewardItem - { + { private StatueType m_Type; - private StatuePose m_Pose; + private StatuePose m_Pose; private StatueMaterial m_Material; - + [CommandProperty( AccessLevel.GameMaster )] public StatueType StatueType { get { return m_Type; } - set { m_Type = value; InvalidateHues(); InvalidatePose(); } - } - + set { m_Type = value; InvalidateHues(); InvalidatePose(); } + } + [CommandProperty( AccessLevel.GameMaster )] public StatuePose Pose { get { return m_Pose; } - set { m_Pose = value; InvalidatePose(); } + set { m_Pose = value; InvalidatePose(); } } - + [CommandProperty( AccessLevel.GameMaster )] public StatueMaterial Material { get { return m_Material; } - set { m_Material = value; InvalidateHues(); InvalidatePose(); } + set { m_Material = value; InvalidateHues(); InvalidatePose(); } } - + private Mobile m_SculptedBy; private DateTime m_SculptedOn; - + [CommandProperty( AccessLevel.GameMaster )] public Mobile SculptedBy { get{ return m_SculptedBy; } } - + [CommandProperty( AccessLevel.GameMaster )] public DateTime SculptedOn { get{ return m_SculptedOn; } } - + private CharacterStatuePlinth m_Plinth; - + public CharacterStatuePlinth Plinth { get { return m_Plinth; } - set { m_Plinth = value; } + set { m_Plinth = value; } } - + private bool m_IsRewardItem; [CommandProperty( AccessLevel.GameMaster )] @@ -97,22 +97,19 @@ namespace Server.Mobiles get{ return m_IsRewardItem; } set{ m_IsRewardItem = value; } } - + public CharacterStatue( Mobile from, StatueType type ) : base() - { + { m_Type = type; m_Pose = StatuePose.Ready; m_Material = StatueMaterial.Antique; - - m_SculptedBy = from; - m_SculptedOn = DateTime.Now; - + Direction = Direction.South; AccessLevel = AccessLevel.Counselor; Hits = HitsMax; Blessed = true; Frozen = true; - + CloneBody( from ); CloneClothes( from ); InvalidateHues(); @@ -120,17 +117,17 @@ namespace Server.Mobiles public CharacterStatue( Serial serial ) : base( serial ) { - } - + } + public override void OnDoubleClick( Mobile from ) { DisplayPaperdollTo( from ); - } - + } + public override void GetProperties( ObjectPropertyList list ) { base.GetProperties( list ); - + if ( m_SculptedBy != null ) { if ( m_SculptedBy.Title != null ) @@ -138,55 +135,55 @@ namespace Server.Mobiles else list.Add( 1076202, m_SculptedBy.Name ); // Sculpted by ~1_Name~ } - } - + } + public override void GetContextMenuEntries( Mobile from, List list ) { base.GetContextMenuEntries( from, list ); - - if ( from.Alive ) + + if ( from.Alive && m_SculptedBy != null ) { BaseHouse house = BaseHouse.FindHouseAt( this ); - + if ( ( house != null && house.IsCoOwner( from ) ) || (int) from.AccessLevel > (int) AccessLevel.Counselor ) list.Add( new DemolishEntry( this ) ); } } - + public override void OnAfterDelete() { base.OnAfterDelete(); - + if ( m_Plinth != null && !m_Plinth.Deleted ) m_Plinth.Delete(); } - + protected override void OnMapChange( Map oldMap ) - { + { InvalidatePose(); - + if ( m_Plinth != null ) m_Plinth.Map = Map; } - + protected override void OnLocationChange( Point3D oldLocation ) { InvalidatePose(); - + if ( m_Plinth != null ) m_Plinth.Location = new Point3D( X, Y, Z - 5 ); } - + public override bool CanBeRenamedBy( Mobile from ) { return false; } - + public override bool CanBeDamaged() { return false; } - + public void OnRequestedAnimation( Mobile from ) { from.Send( new UpdateStatueAnimation( this, 1, m_Animation, m_Frames ) ); @@ -201,14 +198,14 @@ namespace Server.Mobiles base.Serialize( writer ); writer.WriteEncodedInt( (int) 0 ); // version - + writer.Write( (int) m_Type ); writer.Write( (int) m_Pose ); writer.Write( (int) m_Material ); - + writer.Write( (Mobile) m_SculptedBy ); - writer.Write( (DateTime) m_SculptedOn ); - + writer.Write( (DateTime) m_SculptedOn ); + writer.Write( (Item) m_Plinth ); writer.Write( (bool) m_IsRewardItem ); } @@ -218,43 +215,48 @@ namespace Server.Mobiles base.Deserialize( reader ); int version = reader.ReadEncodedInt(); - + m_Type = (StatueType) reader.ReadInt(); m_Pose = (StatuePose) reader.ReadInt(); m_Material = (StatueMaterial) reader.ReadInt(); - + m_SculptedBy = reader.ReadMobile(); m_SculptedOn = reader.ReadDateTime(); - + m_Plinth = reader.ReadItem() as CharacterStatuePlinth; m_IsRewardItem = reader.ReadBool(); - + InvalidatePose(); - + Frozen = true; + + if( m_SculptedBy == null || Map == Map.Internal ) + { + Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Delete ) ); + } } public void Sculpt( Mobile by ) { m_SculptedBy = by; m_SculptedOn = DateTime.Now; - + InvalidateProperties(); } - + public void Demolish( Mobile by ) { CharacterStatueDeed deed = new CharacterStatueDeed( null ); - + if ( by.PlaceInBackpack( deed ) ) { - Internalize(); - + Delete(); + deed.Statue = this; deed.IsRewardItem = m_IsRewardItem; - + if ( m_Plinth != null ) - m_Plinth.Internalize(); + m_Plinth.Delete(); } else { @@ -262,43 +264,43 @@ namespace Server.Mobiles deed.Delete(); } } - + public void Restore( CharacterStatue from ) - { + { m_Material = from.Material; m_Pose = from.Pose; - + Direction = from.Direction; - + CloneBody( from ); CloneClothes( from ); - + InvalidateHues(); InvalidatePose(); } - + public void CloneBody( Mobile from ) { Name = from.Name; BodyValue = from.BodyValue; HairItemID = from.HairItemID; - FacialHairItemID = from.FacialHairItemID; + FacialHairItemID = from.FacialHairItemID; } - + public void CloneClothes( Mobile from ) { for ( int i = Items.Count - 1; i >= 0; i -- ) Items[ i ].Delete(); - + for ( int i = from.Items.Count - 1; i >= 0; i -- ) { Item item = from.Items[ i ]; - + if ( item.Layer != Layer.Backpack && item.Layer != Layer.Mount && item.Layer != Layer.Bank ) AddItem( CloneItem( item ) ); } } - + public Item CloneItem( Item item ) { Item cloned = new Item( item.ItemID ); @@ -310,28 +312,28 @@ namespace Server.Mobiles return cloned; } - + public void InvalidateHues() { Hue = 0xB8F + (int) m_Type * 4 + (int) m_Material; - + HairHue = Hue; - + if ( FacialHairItemID > 0 ) FacialHairHue = Hue; - + for ( int i = Items.Count - 1; i >= 0; i -- ) Items[ i ].Hue = Hue; - + if ( m_Plinth != null ) m_Plinth.InvalidateHue(); } - + private int m_Animation; private int m_Frames; - + public void InvalidatePose() - { + { switch ( m_Pose ) { case StatuePose.Ready: @@ -383,7 +385,7 @@ namespace Server.Mobiles eable.Free(); } } - + private class DemolishEntry : ContextMenuEntry { private CharacterStatue m_Statue; @@ -392,17 +394,17 @@ namespace Server.Mobiles { m_Statue = statue; } - + public override void OnClick() { if ( m_Statue.Deleted ) return; - + m_Statue.Demolish( Owner.From ); } } } - + public class CharacterStatueDeed : Item, IRewardItem { public override int LabelNumber @@ -418,19 +420,19 @@ namespace Server.Mobiles case StatueType.Bronze: return 1076190; } } - + return 1076173; } } - + private CharacterStatue m_Statue; private bool m_IsRewardItem; - + [CommandProperty( AccessLevel.GameMaster )] public CharacterStatue Statue { - get { return m_Statue; } - set { m_Statue = value; } + get { return m_Statue; } + set { m_Statue = value; } } [CommandProperty( AccessLevel.GameMaster )] @@ -440,7 +442,7 @@ namespace Server.Mobiles { if ( m_Statue != null ) return m_Statue.StatueType; - + return StatueType.Marble; } } @@ -451,7 +453,7 @@ namespace Server.Mobiles get{ return m_IsRewardItem; } set{ m_IsRewardItem = value; InvalidateProperties(); } } - + public CharacterStatueDeed( CharacterStatue statue ) : base( 0x14F0 ) { m_Statue = statue; @@ -462,34 +464,34 @@ namespace Server.Mobiles public CharacterStatueDeed( Serial serial ) : base( serial ) { - } - + } + public override void GetProperties( ObjectPropertyList list ) { base.GetProperties( list ); - + if ( m_IsRewardItem ) list.Add( 1076222 ); // 6th Year Veteran Reward - + if ( m_Statue != null ) list.Add( 1076231, m_Statue.Name ); // Statue of ~1_Name~ - } - + } + public override void OnDoubleClick( Mobile from ) { Account acct = from.Account as Account; - + if ( acct != null && from.AccessLevel == AccessLevel.Player ) - { + { TimeSpan time = TimeSpan.FromDays( RewardSystem.RewardInterval.TotalDays * 6 ) - ( DateTime.Now - acct.Created ); - + if ( time > TimeSpan.Zero ) { from.SendLocalizedMessage( 1008126, true, Math.Ceiling( time.TotalDays / RewardSystem.RewardInterval.TotalDays ).ToString() ); // Your account is not old enough to use this item. Months until you can use this item : return; } } - + if ( IsChildOf( from.Backpack ) ) { if ( !from.IsBodyMod ) @@ -502,12 +504,12 @@ namespace Server.Mobiles } else from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it. - } - + } + public override void OnDelete() { base.OnDelete(); - + if ( m_Statue != null ) m_Statue.Delete(); } @@ -517,7 +519,7 @@ namespace Server.Mobiles base.Serialize( writer ); writer.WriteEncodedInt( (int) 0 ); // version - + writer.Write( (Mobile) m_Statue ); writer.Write( (bool) m_IsRewardItem ); } @@ -527,7 +529,7 @@ namespace Server.Mobiles base.Deserialize( reader ); int version = reader.ReadEncodedInt(); - + m_Statue = reader.ReadMobile() as CharacterStatue; m_IsRewardItem = reader.ReadBool(); } @@ -537,13 +539,13 @@ namespace Server.Mobiles { private Item m_Maker; private StatueType m_Type; - + public CharacterStatueTarget( Item maker, StatueType type ) : base( -1, true, TargetFlags.None ) { m_Maker = maker; m_Type = type; } - + protected override void OnTarget( Mobile from, object targeted ) { IPoint3D p = targeted as IPoint3D; @@ -551,13 +553,13 @@ namespace Server.Mobiles if ( p == null || map == null || m_Maker == null || m_Maker.Deleted ) return; - + if ( m_Maker.IsChildOf( from.Backpack ) ) { SpellHelper.GetSurfaceTop( ref p ); BaseHouse house = null; Point3D loc = new Point3D( p ); - + if ( targeted is Item && !((Item) targeted).IsLockedDown && !((Item) targeted).IsSecure && !(targeted is AddonComponent) ) { from.SendLocalizedMessage( 1076191 ); // Statues can only be placed in houses. @@ -568,19 +570,19 @@ namespace Server.Mobiles from.SendLocalizedMessage( 1073648 ); // You may only proceed while in your original state... return; } - + AddonFitResult result = CouldFit( loc, map, from, ref house ); - + if ( result == AddonFitResult.Valid ) { CharacterStatue statue = new CharacterStatue( from, m_Type ); CharacterStatuePlinth plinth = new CharacterStatuePlinth( statue ); - + house.Addons.Add( plinth ); - + if ( m_Maker is IRewardItem ) statue.IsRewardItem = ( (IRewardItem) m_Maker).IsRewardItem; - + statue.Plinth = plinth; plinth.MoveToWorld( loc, map ); statue.InvalidatePose(); @@ -595,12 +597,12 @@ namespace Server.Mobiles else if ( result == AddonFitResult.DoorsNotClosed ) from.SendMessage( "You must close all house doors before placing this." ); else if ( result == AddonFitResult.DoorTooClose ) - from.SendLocalizedMessage( 500271 ); // You cannot build near the door. + from.SendLocalizedMessage( 500271 ); // You cannot build near the door. } else from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it. } - + public static AddonFitResult CouldFit( Point3D p, Map map, Mobile from, ref BaseHouse house ) { if ( !map.CanFit( p.X, p.Y, p.Z, 20, true, true, true ) ) @@ -610,7 +612,7 @@ namespace Server.Mobiles else return CheckDoors( p, 20, house ); } - + public static AddonFitResult CheckDoors( Point3D p, int height, BaseHouse house ) { ArrayList doors = house.Doors; @@ -624,11 +626,11 @@ namespace Server.Mobiles Point3D doorLoc = door.GetWorldLocation(); int doorHeight = door.ItemData.CalcHeight; - + if ( Utility.InRange( doorLoc, p, 1 ) && (p.Z == doorLoc.Z || ((p.Z + height) > doorLoc.Z && (doorLoc.Z + doorHeight) > p.Z)) ) return AddonFitResult.DoorTooClose; } - + return AddonFitResult.Valid; } } diff --git a/Scripts/Engines/VeteranRewards/Character Statue Maker/CharacterStatuePlinth.cs b/Scripts/Engines/VeteranRewards/Character Statue Maker/CharacterStatuePlinth.cs index 66425e75e..d253cdfa2 100644 --- a/Scripts/Engines/VeteranRewards/Character Statue Maker/CharacterStatuePlinth.cs +++ b/Scripts/Engines/VeteranRewards/Character Statue Maker/CharacterStatuePlinth.cs @@ -7,57 +7,57 @@ using Server.Multis; using Server.Targets; namespace Server.Items -{ +{ public class CharacterStatuePlinth : Static, IAddon - { + { public Item Deed{ get{ return new CharacterStatueDeed( m_Statue ); } } public override int LabelNumber{ get{ return 1076201; } } // Character Statue - + private CharacterStatue m_Statue; public CharacterStatuePlinth( CharacterStatue statue ) : base( 0x32F2 ) { m_Statue = statue; - + InvalidateHue(); } public CharacterStatuePlinth( Serial serial ) : base( serial ) { - } - + } + public override void OnAfterDelete() { base.OnAfterDelete(); - + if ( m_Statue != null && !m_Statue.Deleted ) m_Statue.Delete(); } - + public override void OnMapChange() - { + { if ( m_Statue != null ) m_Statue.Map = Map; } - + public override void OnLocationChange( Point3D oldLocation ) - { + { if ( m_Statue != null ) m_Statue.Location = new Point3D( X, Y, Z + 5 ); } - + public override void OnDoubleClick( Mobile from ) { if ( m_Statue != null ) from.SendGump( new CharacterPlinthGump( m_Statue ) ); - } + } public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); writer.WriteEncodedInt( (int) 0 ); // version - + writer.Write( (Mobile) m_Statue ); } @@ -66,52 +66,57 @@ namespace Server.Items base.Deserialize( reader ); int version = reader.ReadEncodedInt(); - + m_Statue = reader.ReadMobile() as CharacterStatue; + + if( m_Statue == null || m_Statue.SculptedBy == null || Map == Map.Internal ) + { + Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Delete ) ); + } } - + public void InvalidateHue() { if ( m_Statue != null ) Hue = 0xB8F + (int) m_Statue.StatueType * 4 + (int) m_Statue.Material; } - + public virtual bool CouldFit( IPoint3D p, Map map ) { Point3D point = new Point3D( p.X, p.Y, p.Z ); if ( map == null || !map.CanFit( point, 20 ) ) return false; - + BaseHouse house = BaseHouse.FindHouseAt( point, map, 20 ); if ( house == null ) return false; - + AddonFitResult result = CharacterStatueTarget.CheckDoors( point, 20, house ); - + if ( result == AddonFitResult.Valid ) return true; - + return false; } - + private class CharacterPlinthGump : Gump - { + { public CharacterPlinthGump( CharacterStatue statue ) : base( 60, 30 ) - { + { Closable = true; Disposable = true; Dragable = true; Resizable = false; - AddPage( 0 ); + AddPage( 0 ); AddImage( 0, 0, 0x24F4 ); AddHtml( 55, 50, 150, 20, statue.Name, false, false ); AddHtml( 55, 75, 150, 20, statue.SculptedOn.ToString( "G", new CultureInfo("de-DE") ), false, false ); AddHtmlLocalized( 55, 100, 150, 20, GetTypeNumber( statue.StatueType ), 0, false, false ); } - + public int GetTypeNumber( StatueType type ) { switch ( type ) diff --git a/Scripts/Items/Champion Artifacts/Unique/OrcChieftainHelm.cs b/Scripts/Items/Champion Artifacts/Unique/OrcChieftainHelm.cs index bff4aade4..073a12ab5 100644 --- a/Scripts/Items/Champion Artifacts/Unique/OrcChieftainHelm.cs +++ b/Scripts/Items/Champion Artifacts/Unique/OrcChieftainHelm.cs @@ -24,8 +24,12 @@ namespace Server.Items Hue = 0x3F; Attributes.Luck = 100; - Attributes.BonusHits = 30; Attributes.RegenHits = 3; + + if( Utility.RandomBool() ) + Attributes.BonusHits = 30; + else + Attributes.AttackChance = 30; } public OrcChieftainHelm( Serial serial ) : base( serial ) diff --git a/Scripts/Misc/SkillCheck.cs b/Scripts/Misc/SkillCheck.cs index 3b9a89e05..f6df19f6a 100644 --- a/Scripts/Misc/SkillCheck.cs +++ b/Scripts/Misc/SkillCheck.cs @@ -207,7 +207,7 @@ namespace Server.Misc Skills skills = from.Skills; - if ( ( skills.Total / skills.Cap ) >= Utility.RandomDouble() )//( skills.Total >= skills.Cap ) + if ( !from.Player && ( skills.Total / skills.Cap ) >= Utility.RandomDouble() )//( skills.Total >= skills.Cap ) { for ( int i = 0; i < skills.Length; ++i ) { @@ -221,7 +221,7 @@ namespace Server.Misc } } - if ( (skills.Total + toGain) <= skills.Cap ) + if ( !from.Player || (skills.Total + toGain) <= skills.Cap ) { skill.BaseFixedPoint += toGain; } diff --git a/Scripts/Mobiles/Animals/Mounts/FireSteed.cs b/Scripts/Mobiles/Animals/Mounts/FireSteed.cs index 7af136c05..394a62d6c 100644 --- a/Scripts/Mobiles/Animals/Mounts/FireSteed.cs +++ b/Scripts/Mobiles/Animals/Mounts/FireSteed.cs @@ -64,7 +64,7 @@ namespace Server.Mobiles { base.Serialize( writer ); - writer.Write( (int) 0 ); // version + writer.Write( (int) 1 ); // version } public override void Deserialize( GenericReader reader ) @@ -75,6 +75,19 @@ namespace Server.Mobiles if ( BaseSoundID <= 0 ) BaseSoundID = 0xA8; + + if( version < 1 ) + { + for ( int i = 0; i < Skills.Length; ++i ) + { + Skills[i].Cap = Math.Max( 100.0, Skills[i].Cap * 0.9 ); + + if ( Skills[i].Base > Skills[i].Cap ) + { + Skills[i].Base = Skills[i].Cap; + } + } + } } } } \ No newline at end of file diff --git a/Scripts/Mobiles/Animals/Mounts/Hiryu.cs b/Scripts/Mobiles/Animals/Mounts/Hiryu.cs index 6f9af3798..d699dbf86 100644 --- a/Scripts/Mobiles/Animals/Mounts/Hiryu.cs +++ b/Scripts/Mobiles/Animals/Mounts/Hiryu.cs @@ -223,7 +223,7 @@ namespace Server.Mobiles public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); - writer.Write( (int)1 ); + writer.Write( (int)2 ); } public override void Deserialize( GenericReader reader ) @@ -236,6 +236,19 @@ namespace Server.Mobiles if( version <= 1 ) Timer.DelayCall( TimeSpan.Zero, delegate { if( InternalItem != null ) { InternalItem.Hue = this.Hue; } } ); + + if( version < 2 ) + { + for ( int i = 0; i < Skills.Length; ++i ) + { + Skills[i].Cap = Math.Max( 100.0, Skills[i].Cap * 0.9 ); + + if ( Skills[i].Base > Skills[i].Cap ) + { + Skills[i].Base = Skills[i].Cap; + } + } + } } } } diff --git a/Scripts/Mobiles/Animals/Mounts/LesserHiryu.cs b/Scripts/Mobiles/Animals/Mounts/LesserHiryu.cs index 7a521ee31..a2b5e854b 100644 --- a/Scripts/Mobiles/Animals/Mounts/LesserHiryu.cs +++ b/Scripts/Mobiles/Animals/Mounts/LesserHiryu.cs @@ -219,7 +219,7 @@ namespace Server.Mobiles public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); - writer.Write( (int)1 ); + writer.Write( (int)2 ); } public override void Deserialize( GenericReader reader ) @@ -232,6 +232,19 @@ namespace Server.Mobiles if( version <= 1 ) Timer.DelayCall( TimeSpan.Zero, delegate { if( InternalItem != null ) { InternalItem.Hue = this.Hue; } } ); + + if( version < 2 ) + { + for ( int i = 0; i < Skills.Length; ++i ) + { + Skills[i].Cap = Math.Max( 100.0, Skills[i].Cap * 0.9 ); + + if ( Skills[i].Base > Skills[i].Cap ) + { + Skills[i].Base = Skills[i].Cap; + } + } + } } } } diff --git a/Scripts/Mobiles/Monsters/ML/Misc/Magic/GreaterDragon.cs b/Scripts/Mobiles/Monsters/ML/Misc/Magic/GreaterDragon.cs index 3863fdcbc..30da02527 100644 --- a/Scripts/Mobiles/Monsters/ML/Misc/Magic/GreaterDragon.cs +++ b/Scripts/Mobiles/Monsters/ML/Misc/Magic/GreaterDragon.cs @@ -7,6 +7,8 @@ namespace Server.Mobiles [CorpseName( "a dragon corpse" )] public class GreaterDragon : BaseCreature { + public override bool StatLossAfterTame { get { return true; } } + [Constructable] public GreaterDragon () : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.3, 0.5 ) { @@ -21,7 +23,7 @@ namespace Server.Mobiles SetHits( 1000, 2000 ); SetStam( 120, 135 ); - SetDamage( 5, 6 ); + SetDamage( 24, 33 ); SetDamageType( ResistanceType.Physical, 100 ); @@ -68,6 +70,11 @@ namespace Server.Mobiles public override FoodType FavoriteFood{ get{ return FoodType.Meat; } } public override bool CanAngerOnTame { get { return true; } } + public override WeaponAbility GetWeaponAbility() + { + return WeaponAbility.BleedAttack; + } + public GreaterDragon( Serial serial ) : base( serial ) { } @@ -75,13 +82,20 @@ namespace Server.Mobiles public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); - writer.Write( (int) 0 ); + writer.Write( (int) 1 ); } public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); + + if( version == 0 ) + { + Server.SkillHandlers.AnimalTaming.ScaleStats( this, 0.50 ); + Server.SkillHandlers.AnimalTaming.ScaleSkills( this, 0.80, 0.90 ); // 90% * 80% = 72% of original skills trainable to 90% + Skills[25].Base = Skills[25].Cap; // Greater dragons have a 90% cap reduction and 90% skill reduction on magery + } } } } diff --git a/Scripts/Mobiles/Monsters/SE/RuneBeetle.cs b/Scripts/Mobiles/Monsters/SE/RuneBeetle.cs index 68a0819c4..16031f1b9 100644 --- a/Scripts/Mobiles/Monsters/SE/RuneBeetle.cs +++ b/Scripts/Mobiles/Monsters/SE/RuneBeetle.cs @@ -214,13 +214,26 @@ namespace Server.Mobiles public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); - writer.Write( (int) 0 ); + writer.Write( (int) 1 ); } public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); + + if( version < 1 ) + { + for ( int i = 0; i < Skills.Length; ++i ) + { + Skills[i].Cap = Math.Max( 100.0, Skills[i].Cap * 0.9 ); + + if ( Skills[i].Base > Skills[i].Cap ) + { + Skills[i].Base = Skills[i].Cap; + } + } + } } } } \ No newline at end of file diff --git a/Scripts/Skills/AnimalTaming.cs b/Scripts/Skills/AnimalTaming.cs index 5a7b2aa44..3cd25b6eb 100644 --- a/Scripts/Skills/AnimalTaming.cs +++ b/Scripts/Skills/AnimalTaming.cs @@ -82,22 +82,22 @@ namespace Server.SkillHandlers public static void ScaleSkills( BaseCreature bc, double scalar ) { - int totalCapIncrease = Core.SE ? 2000 : 0; // 2000 points for GM Anatomy and Meditation + ScaleSkills( bc, scalar, scalar ); + } + public static void ScaleSkills( BaseCreature bc, double scalar, double capScalar ) + { for ( int i = 0; i < bc.Skills.Length; ++i ) { bc.Skills[i].Base *= scalar; + bc.Skills[i].Cap = Math.Max( 100.0, bc.Skills[i].Cap * capScalar ); + if ( bc.Skills[i].Base > bc.Skills[i].Cap ) { - if( Core.SE ) - totalCapIncrease += ( bc.Skills[i].BaseFixedPoint - bc.Skills[i].CapFixedPoint ); - bc.Skills[i].Cap = bc.Skills[i].Base; } } - - bc.SkillsCap += totalCapIncrease; //increase will be 0 if not .SE per above } private class InternalTarget : Target @@ -140,6 +140,10 @@ namespace Server.SkillHandlers { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1049652, from.NetState ); // That creature can only be tamed by females. } + else if ( creature is CuSidhe && from.Race != Race.Elf ) + { + creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 502801, from.NetState ); // You can't tame that! + } else if ( from.Followers + creature.ControlSlots > from.FollowersMax ) { from.SendLocalizedMessage( 1049611 ); // You have too many followers to tame that creature. @@ -328,7 +332,12 @@ namespace Server.SkillHandlers { if ( m_Creature.Owners.Count == 0 ) // First tame { - if ( m_Paralyzed ) + if ( m_Creature is GreaterDragon ) + { + ScaleSkills( m_Creature, 0.72, 0.90 ); // 72% of original skills trainable to 90% + m_Creature.Skills[SkillName.Magery].Base = m_Creature.Skills[SkillName.Magery].Cap; // Greater dragons have a 90% cap reduction and 90% skill reduction on magery + } + else if ( m_Paralyzed ) ScaleSkills( m_Creature, 0.86 ); // 86% of original skills if they were paralyzed during the taming else ScaleSkills( m_Creature, 0.90 ); // 90% of original skills