diff --git a/Scripts/Commands/Dupe.cs b/Scripts/Commands/Dupe.cs index b2d6d2551..de311747b 100644 --- a/Scripts/Commands/Dupe.cs +++ b/Scripts/Commands/Dupe.cs @@ -101,6 +101,8 @@ namespace Server.Commands else newItem.MoveToWorld( from.Location, from.Map ); + newItem.InvalidateProperties(); + CommandLogging.WriteLine( from, "{0} {1} duped {2} creating {3}", from.AccessLevel, CommandLogging.Format( from ), CommandLogging.Format( targ ), CommandLogging.Format( newItem ) ); } } @@ -121,7 +123,7 @@ namespace Server.Commands } } - private static void CopyProperties( Item dest, Item src ) + public static void CopyProperties( Item dest, Item src ) { PropertyInfo[] props = src.GetType().GetProperties(); diff --git a/Scripts/Engines/AI/Creature/BaseCreature.cs b/Scripts/Engines/AI/Creature/BaseCreature.cs index 1a3b343a3..94f18b6cd 100644 --- a/Scripts/Engines/AI/Creature/BaseCreature.cs +++ b/Scripts/Engines/AI/Creature/BaseCreature.cs @@ -3324,8 +3324,13 @@ namespace Server.Mobiles { Skills[name].BaseFixedPoint = (int)(val * 10); - if ( Skills[name].Base > Skills[name].Cap ) + if ( Skills[name].Base > Skills[name].Cap ) + { + if ( Core.SE ) + this.SkillsCap += ( Skills[name].BaseFixedPoint - Skills[name].CapFixedPoint ); + Skills[name].Cap = Skills[name].Base; + } } public void SetSkill( SkillName name, double min, double max ) @@ -3335,8 +3340,13 @@ namespace Server.Mobiles Skills[name].BaseFixedPoint = Utility.RandomMinMax( minFixed, maxFixed ); - if ( Skills[name].Base > Skills[name].Cap ) + if ( Skills[name].Base > Skills[name].Cap ) + { + if ( Core.SE ) + this.SkillsCap += ( Skills[name].BaseFixedPoint - Skills[name].CapFixedPoint ); + Skills[name].Cap = Skills[name].Base; + } } public void SetFameLevel( int level ) @@ -3990,6 +4000,11 @@ namespace Server.Mobiles } public static List GetLootingRights( List damageEntries, int hitsMax ) + { + return GetLootingRights( damageEntries, hitsMax, false ); + } + + public static List GetLootingRights( List damageEntries, int hitsMax, bool partyAsIndividual ) { List rights = new List(); @@ -4664,7 +4679,7 @@ namespace Server.Mobiles return base.CanBeDamaged(); } - public virtual bool PlayerRangeSensitive{ get{ return true; } } + public virtual bool PlayerRangeSensitive{ get{ return (this.CurrentWayPoint == null); } } //If they are following a waypoint, they'll continue to follow it even if players aren't around public override void OnSectorDeactivate() { diff --git a/Scripts/Engines/Craft/Core/CraftItem.cs b/Scripts/Engines/Craft/Core/CraftItem.cs index 4d7835067..194224089 100644 --- a/Scripts/Engines/Craft/Core/CraftItem.cs +++ b/Scripts/Engines/Craft/Core/CraftItem.cs @@ -313,6 +313,12 @@ namespace Server.Engines.Craft private static Type[][] m_TypesTable = new Type[][] { new Type[]{ typeof( Log ), typeof( Board ) }, + new Type[]{ typeof( HeartwoodLog ), typeof( HeartwoodBoard ) }, + new Type[]{ typeof( BloodwoodLog ), typeof( BloodwoodBoard ) }, + new Type[]{ typeof( FrostwoodLog ), typeof( FrostwoodBoard ) }, + new Type[]{ typeof( OakLog ), typeof( OakBoard ) }, + new Type[]{ typeof( AshLog ), typeof( YewBoard ) }, + new Type[]{ typeof( YewLog ), typeof( YewBoard ) }, new Type[]{ typeof( Leather ), typeof( Hides ) }, new Type[]{ typeof( SpinedLeather ), typeof( SpinedHides ) }, new Type[]{ typeof( HornedLeather ), typeof( HornedHides ) }, diff --git a/Scripts/Engines/Craft/DefCarpentry.cs b/Scripts/Engines/Craft/DefCarpentry.cs index c9546f969..2b56bd217 100644 --- a/Scripts/Engines/Craft/DefCarpentry.cs +++ b/Scripts/Engines/Craft/DefCarpentry.cs @@ -352,6 +352,18 @@ namespace Server.Engines.Craft MarkOption = true; Repair = Core.AOS; + + SetSubRes( typeof( Log ), 1072643 ); + + // Add every material you want the player to be able to choose from + // This will override the overridable material TODO: Verify the required skill amount + AddSubRes( typeof( Log ), 1072643, 00.0, 1044041, 1072652 ); + AddSubRes( typeof( OakLog ), 1072644, 65.0, 1044041, 1072652 ); + AddSubRes( typeof( AshLog ), 1072645, 80.0, 1044041, 1072652 ); + AddSubRes( typeof( YewLog ), 1072646, 95.0, 1044041, 1072652 ); + AddSubRes( typeof( HeartwoodLog ), 1072647, 100.0, 1044041, 1072652 ); + AddSubRes( typeof( BloodwoodLog ), 1072648, 100.0, 1044041, 1072652 ); + AddSubRes( typeof( FrostwoodLog ), 1072649, 100.0, 1044041, 1072652 ); } } } \ No newline at end of file diff --git a/Scripts/Engines/Craft/DefInscription.cs b/Scripts/Engines/Craft/DefInscription.cs index 26430070b..3952e0d64 100644 --- a/Scripts/Engines/Craft/DefInscription.cs +++ b/Scripts/Engines/Craft/DefInscription.cs @@ -202,7 +202,7 @@ namespace Server.Engines.Craft AddSpell( typeof( FireballScroll ), Reg.BlackPearl ); AddSpell( typeof( MagicLockScroll ), Reg.Bloodmoss, Reg.Garlic, Reg.SulfurousAsh ); AddSpell( typeof( PoisonScroll ), Reg.Nightshade ); - AddSpell( typeof( TelekinisisScroll ), Reg.Garlic, Reg.SpidersSilk, Reg.SulfurousAsh ); + 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 ); diff --git a/Scripts/Engines/Factions/Core/Faction.cs b/Scripts/Engines/Factions/Core/Faction.cs index 83ac2f7f4..523a64a97 100644 --- a/Scripts/Engines/Factions/Core/Faction.cs +++ b/Scripts/Engines/Factions/Core/Faction.cs @@ -424,7 +424,9 @@ namespace Server.Factions else if ( !Guild.NewGuildSystem && guild.Type != GuildType.Regular ) pm.SendLocalizedMessage( 1042161 ); // You cannot join a faction because your guild is an Order or Chaos type. else if ( !Guild.NewGuildSystem && guild.Enemies != null && guild.Enemies.Count > 0 ) //CAN join w/wars in new system - pm.SendLocalizedMessage( 1005056 ); // You cannot join a faction with active Wars + pm.SendLocalizedMessage( 1005056 ); // You cannot join a faction with active Wars + else if ( Guild.NewGuildSystem && guild.Alliance != null ) + pm.SendLocalizedMessage( 1080454 ); // Your guild cannot join a faction while in alliance with non-factioned guilds. else if ( !CanHandleInflux( guild.Members.Count ) ) pm.SendLocalizedMessage( 1018031 ); // In the interest of faction stability, this faction declines to accept new members for now. else diff --git a/Scripts/Engines/Factions/Definitions/FactionDefinition.cs b/Scripts/Engines/Factions/Definitions/FactionDefinition.cs index 1ab9d19db..7b7beb4df 100644 --- a/Scripts/Engines/Factions/Definitions/FactionDefinition.cs +++ b/Scripts/Engines/Factions/Definitions/FactionDefinition.cs @@ -16,6 +16,7 @@ namespace Server.Factions private string m_FriendlyName; private string m_Keyword; + private string m_Abbreviation; private TextDefinition m_Name; private TextDefinition m_PropName; @@ -46,6 +47,7 @@ namespace Server.Factions public string FriendlyName{ get{ return m_FriendlyName; } } public string Keyword{ get{ return m_Keyword; } } + public string Abbreviation{ get { return m_Abbreviation; } } public TextDefinition Name{ get{ return m_Name; } } public TextDefinition PropName{ get{ return m_PropName; } } @@ -66,7 +68,7 @@ namespace Server.Factions public RankDefinition[] Ranks{ get{ return m_Ranks; } } public GuardDefinition[] Guards{ get{ return m_Guards; } } - public FactionDefinition( int sort, int huePrimary, int hueSecondary, int hueJoin, int hueBroadcast, int warHorseBody, int warHorseItem, string friendlyName, string keyword, TextDefinition name, TextDefinition propName, TextDefinition header, TextDefinition about, TextDefinition cityControl, TextDefinition sigilControl, TextDefinition signupName, TextDefinition factionStoneName, TextDefinition ownerLabel, TextDefinition guardIgnore, TextDefinition guardWarn, TextDefinition guardAttack, StrongholdDefinition stronghold, RankDefinition[] ranks, GuardDefinition[] guards ) + public FactionDefinition( int sort, int huePrimary, int hueSecondary, int hueJoin, int hueBroadcast, int warHorseBody, int warHorseItem, string friendlyName, string keyword, string abbreviation, TextDefinition name, TextDefinition propName, TextDefinition header, TextDefinition about, TextDefinition cityControl, TextDefinition sigilControl, TextDefinition signupName, TextDefinition factionStoneName, TextDefinition ownerLabel, TextDefinition guardIgnore, TextDefinition guardWarn, TextDefinition guardAttack, StrongholdDefinition stronghold, RankDefinition[] ranks, GuardDefinition[] guards ) { m_Sort = sort; m_HuePrimary = huePrimary; @@ -77,6 +79,7 @@ namespace Server.Factions m_WarHorseItem = warHorseItem; m_FriendlyName = friendlyName; m_Keyword = keyword; + m_Abbreviation = abbreviation; m_Name = name; m_PropName = propName; m_Header = header; diff --git a/Scripts/Engines/Factions/Instances/Factions/CouncilOfMages.cs b/Scripts/Engines/Factions/Instances/Factions/CouncilOfMages.cs index 9c9f94a47..f42b83aac 100644 --- a/Scripts/Engines/Factions/Instances/Factions/CouncilOfMages.cs +++ b/Scripts/Engines/Factions/Instances/Factions/CouncilOfMages.cs @@ -21,7 +21,7 @@ namespace Server.Factions 1325, // join stone : blue 1325, // broadcast : blue 0x77, 0x3EB1, // war horse - "Council of Mages", "council", + "Council of Mages", "council", "CoM", new TextDefinition( 1011535, "COUNCIL OF MAGES" ), new TextDefinition( 1060770, "Council of Mages faction" ), new TextDefinition( 1011422, "
COUNCIL OF MAGES
" ), diff --git a/Scripts/Engines/Factions/Instances/Factions/Minax.cs b/Scripts/Engines/Factions/Instances/Factions/Minax.cs index 525164ef8..bb360f359 100644 --- a/Scripts/Engines/Factions/Instances/Factions/Minax.cs +++ b/Scripts/Engines/Factions/Instances/Factions/Minax.cs @@ -21,7 +21,7 @@ namespace Server.Factions 1645, // join stone : dark red 1645, // broadcast : dark red 0x78, 0x3EAF, // war horse - "Minax", "minax", + "Minax", "minax", "Min", new TextDefinition( 1011534, "MINAX" ), new TextDefinition( 1060769, "Minax faction" ), new TextDefinition( 1011421, "
FOLLOWERS OF MINAX
" ), diff --git a/Scripts/Engines/Factions/Instances/Factions/Shadowlords.cs b/Scripts/Engines/Factions/Instances/Factions/Shadowlords.cs index fd5bcc809..3572379a8 100644 --- a/Scripts/Engines/Factions/Instances/Factions/Shadowlords.cs +++ b/Scripts/Engines/Factions/Instances/Factions/Shadowlords.cs @@ -21,7 +21,7 @@ namespace Server.Factions 1109, // join stone : shadow 2211, // broadcast : green 0x79, 0x3EB0, // war horse - "Shadowlords", "shadow", + "Shadowlords", "shadow", "SL", new TextDefinition( 1011537, "SHADOWLORDS" ), new TextDefinition( 1060772, "Shadowlords faction" ), new TextDefinition( 1011424, "
SHADES OF DARKNESS
" ), diff --git a/Scripts/Engines/Factions/Instances/Factions/TrueBritannians.cs b/Scripts/Engines/Factions/Instances/Factions/TrueBritannians.cs index ed30a150a..5e3707206 100644 --- a/Scripts/Engines/Factions/Instances/Factions/TrueBritannians.cs +++ b/Scripts/Engines/Factions/Instances/Factions/TrueBritannians.cs @@ -21,7 +21,7 @@ namespace Server.Factions 2214, // join stone : gold 2125, // broadcast : gold 0x76, 0x3EB2, // war horse - "True Britannians", "true", + "True Britannians", "true", "TB", new TextDefinition( 1011536, "LORD BRITISH" ), new TextDefinition( 1060771, "True Britannians faction" ), new TextDefinition( 1011423, "
TRUE BRITANNIANS
" ), diff --git a/Scripts/Engines/Factions/Mobiles/Vendors/BaseFactionVendor.cs b/Scripts/Engines/Factions/Mobiles/Vendors/BaseFactionVendor.cs index 06718d9e3..aa0d12fbc 100644 --- a/Scripts/Engines/Factions/Mobiles/Vendors/BaseFactionVendor.cs +++ b/Scripts/Engines/Factions/Mobiles/Vendors/BaseFactionVendor.cs @@ -30,6 +30,14 @@ namespace Server.Factions m_Town.RegisterVendor( this ); } + public override bool OnMoveOver( Mobile m ) + { + if ( Core.ML ) + return true; + + return base.OnMoveOver( m ); + } + public void Unregister() { if ( m_Town != null ) diff --git a/Scripts/Engines/Harvest/Lumberjacking.cs b/Scripts/Engines/Harvest/Lumberjacking.cs index 011a60944..ec706574f 100644 --- a/Scripts/Engines/Harvest/Lumberjacking.cs +++ b/Scripts/Engines/Harvest/Lumberjacking.cs @@ -88,13 +88,13 @@ namespace Server.Engines.Harvest veins = new HarvestVein[] { - new HarvestVein( 58.4, 0.0, res[0], null ), // Ordinary Logs + new HarvestVein( 49.0, 0.0, res[0], null ), // Ordinary Logs new HarvestVein( 30.0, 0.5, res[1], res[0] ), // Oak new HarvestVein( 10.0, 0.5, res[2], res[0] ), // Ash - new HarvestVein( 01.0, 0.5, res[3], res[0] ), // Yew - new HarvestVein( 00.3, 0.5, res[4], res[0] ), // Heartwood - new HarvestVein( 00.2, 0.5, res[5], res[0] ), // Bloodwood - new HarvestVein( 00.1, 0.5, res[6], res[0] ), // Frostwood + new HarvestVein( 05.0, 0.5, res[3], res[0] ), // Yew + new HarvestVein( 03.0, 0.5, res[4], res[0] ), // Heartwood + new HarvestVein( 02.0, 0.5, res[5], res[0] ), // Bloodwood + new HarvestVein( 01.0, 0.5, res[6], res[0] ), // Frostwood }; lumber.BonusResources = new BonusHarvestResource[] diff --git a/Scripts/Engines/Spawner/Spawner.cs b/Scripts/Engines/Spawner/Spawner.cs index d0d955bba..4ad234111 100644 --- a/Scripts/Engines/Spawner/Spawner.cs +++ b/Scripts/Engines/Spawner/Spawner.cs @@ -38,6 +38,8 @@ namespace Server.Mobiles } } + public virtual int CreaturesNameCount { get { return m_CreaturesName.Count; } } + public override void OnAfterDuped( Item newItem ) { Spawner s = newItem as Spawner; @@ -244,7 +246,7 @@ namespace Server.Mobiles { if ( !m_Running ) { - if ( m_CreaturesName.Count > 0 ) + if ( CreaturesNameCount > 0 ) { m_Running = true; DoTimer(); @@ -346,8 +348,8 @@ namespace Server.Mobiles public void Spawn() { - if ( m_CreaturesName.Count > 0 ) - Spawn( Utility.Random( m_CreaturesName.Count ) ); + if ( CreaturesNameCount > 0 ) + Spawn( Utility.Random( CreaturesNameCount ) ); } public void Spawn( string creatureName ) @@ -362,17 +364,11 @@ namespace Server.Mobiles } } - public void Spawn( int index ) + protected virtual IEntity CreateSpawnedObject( int index ) { - Map map = Map; + if ( index >= m_CreaturesName.Count ) + return null; - if ( map == null || map == Map.Internal || m_CreaturesName.Count == 0 || index >= m_CreaturesName.Count || Parent != null ) - return; - - Defrag(); - - if ( m_Creatures.Count >= m_Count ) - return; Type type = SpawnerType.GetType( m_CreaturesName[index] ); @@ -382,60 +378,81 @@ namespace Server.Mobiles { object o = Activator.CreateInstance( type ); - if ( o is Mobile ) - { - Mobile m = (Mobile)o; - - m_Creatures.Add( m ); - - - Point3D loc = ( m is BaseVendor ? this.Location : GetSpawnPosition() ); - - m.OnBeforeSpawn( loc, map ); - InvalidateProperties(); - - - m.MoveToWorld( loc, map ); - - if ( m is BaseCreature ) - { - BaseCreature c = (BaseCreature)m; - - if( m_WalkingRange >= 0 ) - c.RangeHome = m_WalkingRange; - else - c.RangeHome = m_HomeRange; - - c.CurrentWayPoint = m_WayPoint; - - if ( m_Team > 0 ) - c.Team = m_Team; - - c.Home = this.Location; - } - - m.OnAfterSpawn(); - } - else if ( o is Item ) - { - Item item = (Item)o; - - m_Creatures.Add( item ); - - Point3D loc = GetSpawnPosition(); - - item.OnBeforeSpawn( loc, map ); - InvalidateProperties(); - - item.MoveToWorld( loc, map ); - - item.OnAfterSpawn(); - } + return ( o as IEntity ); } catch { } } + + return null; + + } + + public void Spawn( int index ) + { + Map map = Map; + + if ( map == null || map == Map.Internal || CreaturesNameCount == 0 || index >= CreaturesNameCount || Parent != null ) + return; + + Defrag(); + + if ( m_Creatures.Count >= m_Count ) + return; + + + IEntity ent = CreateSpawnedObject( index ); + + if ( ent is Mobile ) + { + Mobile m = (Mobile)ent; + + m_Creatures.Add( m ); + + + Point3D loc = ( m is BaseVendor ? this.Location : GetSpawnPosition() ); + + m.OnBeforeSpawn( loc, map ); + InvalidateProperties(); + + + m.MoveToWorld( loc, map ); + + if ( m is BaseCreature ) + { + BaseCreature c = (BaseCreature)m; + + if( m_WalkingRange >= 0 ) + c.RangeHome = m_WalkingRange; + else + c.RangeHome = m_HomeRange; + + c.CurrentWayPoint = m_WayPoint; + + if ( m_Team > 0 ) + c.Team = m_Team; + + c.Home = this.Location; + } + + m.OnAfterSpawn(); + } + else if ( ent is Item ) + { + Item item = (Item)ent; + + m_Creatures.Add( item ); + + Point3D loc = GetSpawnPosition(); + + item.OnBeforeSpawn( loc, map ); + InvalidateProperties(); + + item.MoveToWorld( loc, map ); + + item.OnAfterSpawn(); + } } public Point3D GetSpawnPosition() diff --git a/Scripts/Gumps/SkillsGump.cs b/Scripts/Gumps/SkillsGump.cs index a8a8e3209..436114c8a 100644 --- a/Scripts/Gumps/SkillsGump.cs +++ b/Scripts/Gumps/SkillsGump.cs @@ -490,7 +490,8 @@ namespace Server.Gumps SkillName.Necromancy, SkillName.SpiritSpeak, SkillName.Ninjitsu, - SkillName.Bushido + SkillName.Bushido, + SkillName.Spellweaving } ), new SkillsGumpGroup( "Miscellaneous", new SkillName[] { diff --git a/Scripts/Items/Armor/BaseArmor.cs b/Scripts/Items/Armor/BaseArmor.cs index aa9adb5b1..868255f09 100644 --- a/Scripts/Items/Armor/BaseArmor.cs +++ b/Scripts/Items/Armor/BaseArmor.cs @@ -97,6 +97,18 @@ namespace Server.Items public virtual int OldDexReq{ get{ return 0; } } public virtual int OldIntReq{ get{ return 0; } } + public override void OnAfterDuped( Item newItem ) + { + BaseArmor armor = newItem as BaseArmor; + + if ( armor == null ) + return; + + armor.m_AosAttributes = new AosAttributes( newItem, m_AosAttributes ); + armor.m_AosArmorAttributes = new AosArmorAttributes( newItem, m_AosArmorAttributes ); + armor.m_AosSkillBonuses = new AosSkillBonuses( newItem, m_AosSkillBonuses ); + } + [CommandProperty( AccessLevel.GameMaster )] public AMA MeditationAllowance { diff --git a/Scripts/Items/Books/BlueBook.cs b/Scripts/Items/Books/BlueBook.cs index 6814d72b6..775edf451 100644 --- a/Scripts/Items/Books/BlueBook.cs +++ b/Scripts/Items/Books/BlueBook.cs @@ -5,8 +5,9 @@ namespace Server.Items { public class BlueBook : BaseBook { + [Constructable] - public BlueBook() : base( 0xFF2 ) + public BlueBook() : base( 0xFF2, 40, true ) { } @@ -43,4 +44,4 @@ namespace Server.Items writer.Write( (int)0 ); // version } } -} \ No newline at end of file +} diff --git a/Scripts/Items/Clothing/BaseClothing.cs b/Scripts/Items/Clothing/BaseClothing.cs index fef52e0cc..29b94d3db 100644 --- a/Scripts/Items/Clothing/BaseClothing.cs +++ b/Scripts/Items/Clothing/BaseClothing.cs @@ -449,6 +449,19 @@ namespace Server.Items m_AosResistances = new AosElementAttributes( this ); } + public override void OnAfterDuped( Item newItem ) + { + BaseClothing clothing = newItem as BaseClothing; + + if ( clothing == null ) + return; + + clothing.m_AosAttributes = new AosAttributes( newItem, m_AosAttributes ); + clothing.m_AosResistances = new AosElementAttributes( newItem, m_AosResistances ); + clothing.m_AosSkillBonuses = new AosSkillBonuses( newItem, m_AosSkillBonuses ); + clothing.m_AosClothingAttributes = new AosArmorAttributes( newItem, m_AosClothingAttributes ); + } + public BaseClothing( Serial serial ) : base( serial ) { } diff --git a/Scripts/Items/Jewels/BaseJewel.cs b/Scripts/Items/Jewels/BaseJewel.cs index 226c6680a..6372be88a 100644 --- a/Scripts/Items/Jewels/BaseJewel.cs +++ b/Scripts/Items/Jewels/BaseJewel.cs @@ -78,6 +78,18 @@ namespace Server.Items } } + public override void OnAfterDuped( Item newItem ) + { + BaseJewel jewel = newItem as BaseJewel; + + if ( jewel == null ) + return; + + jewel.m_AosAttributes = new AosAttributes( newItem, m_AosAttributes ); + jewel.m_AosResistances = new AosElementAttributes( newItem, m_AosResistances ); + jewel.m_AosSkillBonuses = new AosSkillBonuses( newItem, m_AosSkillBonuses ); + } + public virtual int ArtifactRarity{ get{ return 0; } } public BaseJewel( int itemID, Layer layer ) : base( itemID ) diff --git a/Scripts/Items/Misc/Corpses/Corpse.cs b/Scripts/Items/Misc/Corpses/Corpse.cs index 092980dfd..541ebe1aa 100644 --- a/Scripts/Items/Misc/Corpses/Corpse.cs +++ b/Scripts/Items/Misc/Corpses/Corpse.cs @@ -43,11 +43,27 @@ namespace Server.Items public static readonly TimeSpan MonsterLootRightSacrifice = TimeSpan.FromMinutes( 2.0 ); + public static readonly TimeSpan InstancedCorpseTime = TimeSpan.FromMinutes( 3.0 ); + + [CommandProperty( AccessLevel.GameMaster )] + public virtual bool InstancedCorpse + { + get + { + if ( !Core.SE ) + return false; + + return ( DateTime.Now > m_TimeOfDeath + InstancedCorpseTime ); + } + } + public override bool IsDecoContainer { get{ return false; } } + private Dictionary> m_InstancedItems; + [CommandProperty( AccessLevel.GameMaster )] public DateTime TimeOfDeath { @@ -268,6 +284,7 @@ namespace Server.Items public Corpse( Mobile owner, List equipItems ) : this( owner, null, null, equipItems ) { } + public Corpse( Mobile owner, HairInfo hair, FacialHairInfo facialhair, List equipItems ) : base( 0x2006 ) { @@ -356,6 +373,12 @@ namespace Server.Items BeginDecay( m_DefaultDecayTime ); } + private void AssignInstancedLoot() + { + if ( m_InstancedItems == null ) + m_InstancedItems = new Dictionary>(); + } + public Corpse( Serial serial ) : base( serial ) { } diff --git a/Scripts/Items/Misc/PublicMoongate.cs b/Scripts/Items/Misc/PublicMoongate.cs index e1714aceb..8b64fc690 100644 --- a/Scripts/Items/Misc/PublicMoongate.cs +++ b/Scripts/Items/Misc/PublicMoongate.cs @@ -238,7 +238,7 @@ namespace Server.Items new PMEntry( new Point3D( 1828, 2948,-20), 1012008 ), // Trinsic new PMEntry( new Point3D( 643, 2067, 5 ), 1012009 ), // Skara Brae new PMEntry( new Point3D( 3563, 2139, 34), 1012010 ), // Magincia - new PMEntry( new Point3D( 3763, 2771, 50), 1078098 ) // New Haven + new PMEntry( new Point3D( 3450, 2677, 25), 1078098 ) // New Haven } ); public static readonly PMList Felucca = diff --git a/Scripts/Items/Skill Items/Camping/Bedroll.cs b/Scripts/Items/Skill Items/Camping/Bedroll.cs index 89af196e4..e909f4396 100644 --- a/Scripts/Items/Skill Items/Camping/Bedroll.cs +++ b/Scripts/Items/Skill Items/Camping/Bedroll.cs @@ -6,6 +6,7 @@ using Server.Gumps; namespace Server.Items { + [FlipableAttribute( 0xA57, 0xA58, 0xA59 )] public class Bedroll : Item { [Constructable] diff --git a/Scripts/Items/Skill Items/Magical/Spellbook.cs b/Scripts/Items/Skill Items/Magical/Spellbook.cs index 55773fa4a..32af61f40 100644 --- a/Scripts/Items/Skill Items/Magical/Spellbook.cs +++ b/Scripts/Items/Skill Items/Magical/Spellbook.cs @@ -412,6 +412,17 @@ namespace Server.Items Content = content; } + public override void OnAfterDuped( Item newItem ) + { + Spellbook book = newItem as Spellbook; + + if ( book == null ) + return; + + book.m_AosAttributes = new AosAttributes( newItem, m_AosAttributes ); + book.m_AosSkillBonuses = new AosSkillBonuses( newItem, m_AosSkillBonuses ); + } + public override void OnAdded( object parent ) { if ( Core.AOS && parent is Mobile ) diff --git a/Scripts/Items/Weapons/Abilities/NerveStrike.cs b/Scripts/Items/Weapons/Abilities/NerveStrike.cs index bcd680a71..e89f0343c 100644 --- a/Scripts/Items/Weapons/Abilities/NerveStrike.cs +++ b/Scripts/Items/Weapons/Abilities/NerveStrike.cs @@ -59,7 +59,7 @@ namespace Server.Items AOS.Damage( defender, attacker, (int)(15.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + 10), 100, 0, 0, 0, 0 ); //10-25 - defender.Paralyze( TimeSpan.FromSeconds( 3.0 ) ); + defender.Freeze( TimeSpan.FromSeconds( 2.0 ) ); Server.Items.ParalyzingBlow.BeginImmunity( defender, Server.Items.ParalyzingBlow.FreezeDelayDuration ); } } diff --git a/Scripts/Items/Weapons/BaseWeapon.cs b/Scripts/Items/Weapons/BaseWeapon.cs index 9eb72c552..60edd45cb 100644 --- a/Scripts/Items/Weapons/BaseWeapon.cs +++ b/Scripts/Items/Weapons/BaseWeapon.cs @@ -413,6 +413,19 @@ namespace Server.Items #endregion + public override void OnAfterDuped( Item newItem ) + { + BaseWeapon weap = newItem as BaseWeapon; + + if ( weap == null ) + return; + + weap.m_AosAttributes = new AosAttributes( newItem, m_AosAttributes ); + weap.m_AosElementDamages = new AosElementAttributes( newItem, m_AosElementDamages ); + weap.m_AosSkillBonuses = new AosSkillBonuses( newItem, m_AosSkillBonuses ); + weap.m_AosWeaponAttributes = new AosWeaponAttributes( newItem, m_AosWeaponAttributes ); + } + public virtual void UnscaleDurability() { int scale = 100 + GetDurabilityBonus(); diff --git a/Scripts/Misc/AOS.cs b/Scripts/Misc/AOS.cs index 469943626..83484a009 100644 --- a/Scripts/Misc/AOS.cs +++ b/Scripts/Misc/AOS.cs @@ -196,6 +196,11 @@ namespace Server { } + public AosAttributes( Item owner, AosAttributes other ) + : base( owner, other ) + { + } + public AosAttributes( Item owner, GenericReader reader ) : base( owner, reader ) { @@ -377,6 +382,11 @@ namespace Server { } + public AosWeaponAttributes( Item owner, AosWeaponAttributes other ) + : base( owner, other ) + { + } + public AosWeaponAttributes( Item owner, GenericReader reader ) : base( owner, reader ) { @@ -514,6 +524,11 @@ namespace Server { } + public AosArmorAttributes( Item owner, AosArmorAttributes other ) + : base( owner, other ) + { + } + public static int GetValue( Mobile m, AosArmorAttribute attribute ) { if( !Core.AOS ) @@ -571,7 +586,7 @@ namespace Server public sealed class AosSkillBonuses : BaseAttributes { - private ArrayList m_Mods; + private List m_Mods; public AosSkillBonuses( Item owner ) : base( owner ) @@ -583,6 +598,11 @@ namespace Server { } + public AosSkillBonuses( Item owner, AosSkillBonuses other ) + : base( owner, other ) + { + } + public void GetProperties( ObjectPropertyList list ) { for( int i = 0; i < 5; ++i ) @@ -610,7 +630,7 @@ namespace Server continue; if( m_Mods == null ) - m_Mods = new ArrayList(); + m_Mods = new List(); SkillMod sk = new DefaultSkillMod( skill, true, bonus ); sk.ObeyCap = true; @@ -625,7 +645,7 @@ namespace Server return; for( int i = 0; i < m_Mods.Count; ++i ) - ((SkillMod)m_Mods[i]).Remove(); + m_Mods[i].Remove(); m_Mods = null; } @@ -756,6 +776,11 @@ namespace Server { } + public AosElementAttributes( Item owner, AosElementAttributes other ) + : base( owner, other ) + { + } + public AosElementAttributes( Item owner, GenericReader reader ) : base( owner, reader ) { @@ -806,6 +831,14 @@ namespace Server m_Values = m_Empty; } + public BaseAttributes( Item owner, BaseAttributes other ) + { + m_Owner = owner; + m_Values = new int[other.m_Values.Length]; + other.m_Values.CopyTo( m_Values, 0 ); + m_Names = other.m_Names; + } + public BaseAttributes( Item owner, GenericReader reader ) { m_Owner = owner; diff --git a/Scripts/Misc/Notoriety.cs b/Scripts/Misc/Notoriety.cs index 5e90a6a04..2697ce746 100644 --- a/Scripts/Misc/Notoriety.cs +++ b/Scripts/Misc/Notoriety.cs @@ -65,17 +65,18 @@ namespace Server.Misc if( from == null || target == null || from.AccessLevel > AccessLevel.Player || target.AccessLevel > AccessLevel.Player ) return true; + Map map = from.Map; + #region Factions Faction targetFaction = Faction.Find( target, true ); - if( targetFaction != null ) + if( (!Core.ML || map == Faction.Facet) && targetFaction != null ) { if( Faction.Find( from, true ) != targetFaction ) return false; } #endregion - - Map map = from.Map; + if( map != null && (map.Rules & MapRules.BeneficialRestrictions) == 0 ) return true; // In felucca, anything goes diff --git a/Scripts/Mobiles/PlayerMobile.cs b/Scripts/Mobiles/PlayerMobile.cs index acc7392af..12e1d63c4 100644 --- a/Scripts/Mobiles/PlayerMobile.cs +++ b/Scripts/Mobiles/PlayerMobile.cs @@ -3250,6 +3250,20 @@ namespace Server.Mobiles } #endregion + if ( Core.ML && this.Map == Faction.Facet ) + { + Faction faction = Faction.Find( this ); + + if ( faction != null ) + { + string adjunct = String.Format( "[{0}]", faction.Definition.Abbreviation ); + if ( suffix.Length == 0 ) + suffix = adjunct; + else + suffix = String.Concat( suffix, " ", adjunct ); + } + } + return base.ApplyNameSuffix( suffix ); } diff --git a/Scripts/Multis/BaseHouse.cs b/Scripts/Multis/BaseHouse.cs index 4365e0839..cdc4814a7 100644 --- a/Scripts/Multis/BaseHouse.cs +++ b/Scripts/Multis/BaseHouse.cs @@ -200,10 +200,15 @@ namespace Server.Multis if ( Deleted ) return; + if ( Core.ML ) + new TempNoHousingRegion( this ); + KillVendors(); Delete(); } + public virtual TimeSpan RestrictedPlacingTime { get { return TimeSpan.FromHours( 1.0 ); } } + [CommandProperty( AccessLevel.GameMaster )] public virtual double BonusStorageScalar { get { return (Core.ML ? 1.2 : 1.0); } } @@ -3384,6 +3389,8 @@ namespace Server.Multis } } + #region Targets + public class LockdownTarget : Target { private bool m_Release; @@ -3648,6 +3655,8 @@ namespace Server.Multis } } + #endregion + public class SetSecureLevelEntry : ContextMenuEntry { private Item m_Item; @@ -3713,4 +3722,20 @@ namespace Server.Multis Owner.From.SendGump( new SetSecureLevelGump( Owner.From, sec, BaseHouse.FindHouseAt( m_Item ) ) ); } } + + public class TempNoHousingRegion : BaseRegion + { + public TempNoHousingRegion( BaseHouse house ) + : base( null, house.Map, Region.DefaultPriority, house.Region.Area ) + { + Register(); + + Timer.DelayCall( house.RestrictedPlacingTime, Unregister ); + } + + public override bool AllowHousing( Mobile from, Point3D p ) + { + return false; + } + } } \ No newline at end of file diff --git a/Scripts/Multis/Deeds.cs b/Scripts/Multis/Deeds.cs index 451ed104f..d53ba774b 100644 --- a/Scripts/Multis/Deeds.cs +++ b/Scripts/Multis/Deeds.cs @@ -200,6 +200,11 @@ namespace Server.Multis.Deeds from.SendLocalizedMessage( 501265 ); // Housing cannot be created in this area. break; } + case HousePlacementResult.BadRegionTemp: + { + from.SendLocalizedMessage( 501270 ); //Lord British has decreed a 'no build' period, thus you cannot build this house at this time. + break; + } } } } diff --git a/Scripts/Multis/HouseFoundation.cs b/Scripts/Multis/HouseFoundation.cs index c5ddc0f63..6fde6273f 100644 --- a/Scripts/Multis/HouseFoundation.cs +++ b/Scripts/Multis/HouseFoundation.cs @@ -894,32 +894,32 @@ namespace Server.Multis int cost = newPrice - oldPrice; if ( !this.Deleted ) { // Temporary Fix. We should be booting a client out of customization mode in the delete handler. - if ( from.AccessLevel >= AccessLevel.GameMaster && cost != 0 ) - { - from.SendMessage( "{0} gold would have been {1} your bank if you were not a GM.", cost.ToString(), ((cost > 0 )? "withdrawn from" : "deposited into" ) ); - } - else - { - if ( cost > 0 ) - { - if ( Banker.Withdraw( from, cost ) ) - { - from.SendLocalizedMessage( 1060398, cost.ToString() ); // ~1_AMOUNT~ gold has been withdrawn from your bank box. - } - else - { - from.SendLocalizedMessage( 1061903 ); // You cannot commit this house design, because you do not have the necessary funds in your bank box to pay for the upgrade. Please back up your design, obtain the required funds, and commit your design again. - return; - } - } - else if ( cost < 0 ) - { + if ( from.AccessLevel >= AccessLevel.GameMaster && cost != 0 ) + { + from.SendMessage( "{0} gold would have been {1} your bank if you were not a GM.", cost.ToString(), ((cost > 0 )? "withdrawn from" : "deposited into" ) ); + } + else + { + if ( cost > 0 ) + { + if ( Banker.Withdraw( from, cost ) ) + { + from.SendLocalizedMessage( 1060398, cost.ToString() ); // ~1_AMOUNT~ gold has been withdrawn from your bank box. + } + else + { + from.SendLocalizedMessage( 1061903 ); // You cannot commit this house design, because you do not have the necessary funds in your bank box to pay for the upgrade. Please back up your design, obtain the required funds, and commit your design again. + return; + } + } + else if ( cost < 0 ) + { if ( Banker.Deposit( from, -cost ) ) - from.SendLocalizedMessage( 1060397, ( -cost ).ToString() ); // ~1_AMOUNT~ gold has been deposited into your bank box. - else - return; - } - } + from.SendLocalizedMessage( 1060397, ( -cost ).ToString() ); // ~1_AMOUNT~ gold has been deposited into your bank box. + else + return; + } + } } /* Client chose to commit current design state diff --git a/Scripts/Multis/HousePlacement.cs b/Scripts/Multis/HousePlacement.cs index 0259888df..54ed811ad 100644 --- a/Scripts/Multis/HousePlacement.cs +++ b/Scripts/Multis/HousePlacement.cs @@ -14,7 +14,8 @@ namespace Server.Multis BadStatic, BadItem, NoSurface, - BadRegionHidden + BadRegionHidden, + BadRegionTemp } public class HousePlacement @@ -106,6 +107,9 @@ namespace Server.Multis if ( !reg.AllowHousing( from, testPoint ) ) // Cannot place houses in dungeons, towns, treasure map areas etc { + if ( reg.IsPartOf( typeof( TempNoHousingRegion ) ) ) + return HousePlacementResult.BadRegionTemp; + if ( reg.IsPartOf( typeof( TreasureRegion ) ) ) return HousePlacementResult.BadRegionHidden; diff --git a/Scripts/Multis/HousePlacementTool.cs b/Scripts/Multis/HousePlacementTool.cs index 30b94c1c2..fa502a209 100644 --- a/Scripts/Multis/HousePlacementTool.cs +++ b/Scripts/Multis/HousePlacementTool.cs @@ -423,6 +423,11 @@ namespace Server.Items from.SendLocalizedMessage( 501265 ); // Housing cannot be created in this area. break; } + case HousePlacementResult.BadRegionTemp: + { + from.SendLocalizedMessage( 501270 ); //Lord British has decreed a 'no build' period, thus you cannot build this house at this time. + break; + } } } @@ -511,6 +516,11 @@ namespace Server.Items from.SendLocalizedMessage( 501265 ); // Housing cannot be created in this area. break; } + case HousePlacementResult.BadRegionTemp: + { + from.SendLocalizedMessage( 501270 ); //Lord British has decreed a 'no build' period, thus you cannot build this house at this time. + break; + } } return false; diff --git a/Scripts/Skills/AnimalTaming.cs b/Scripts/Skills/AnimalTaming.cs index fb4035161..78d1071d2 100644 --- a/Scripts/Skills/AnimalTaming.cs +++ b/Scripts/Skills/AnimalTaming.cs @@ -82,12 +82,22 @@ namespace Server.SkillHandlers public static void ScaleSkills( BaseCreature bc, double scalar ) { + int totalCapIncrease = 0; + for ( int i = 0; i < bc.Skills.Length; ++i ) { bc.Skills[i].Base *= scalar; - if ( bc.Skills[i].Base > 100.0 ) + + 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 @@ -195,21 +205,6 @@ namespace Server.SkillHandlers from.SendLocalizedMessage( 502801 ); // You can't tame that! } } - public static void AdjustSkillCaps( BaseCreature bc ) - { - int totalCapIncrease = 0; - - for ( int i = 0; i < bc.Skills.Length; ++i ) - { - if( bc.Skills[i].Base > bc.Skills[i].Cap ) - { - totalCapIncrease += (bc.Skills[i].BaseFixedPoint - bc.Skills[i].CapFixedPoint); - bc.Skills[i].Cap = bc.Skills[i].Base; - } - } - - bc.SkillsCap += totalCapIncrease; - } private class InternalTimer : Timer { @@ -340,9 +335,6 @@ namespace Server.SkillHandlers if ( m_Creature.StatLossAfterTame ) ScaleStats( m_Creature, 0.50 ); - - if( Core.SE ) - AdjustSkillCaps( m_Creature ); } if ( alreadyOwned ) diff --git a/Scripts/Skills/RemoveTrap.cs b/Scripts/Skills/RemoveTrap.cs index c03346d95..b61e5b1fe 100644 --- a/Scripts/Skills/RemoveTrap.cs +++ b/Scripts/Skills/RemoveTrap.cs @@ -94,7 +94,7 @@ namespace Server.SkillHandlers } else { - if ( from.CheckTargetSkill( SkillName.RemoveTrap, trap, 80.0, 100.0 ) && from.CheckTargetSkill( SkillName.Tinkering, trap, 80.0, 100.0 ) ) + if ( (Core.ML && isOwner) || (from.CheckTargetSkill( SkillName.RemoveTrap, trap, 80.0, 100.0 ) && from.CheckTargetSkill( SkillName.Tinkering, trap, 80.0, 100.0 )) ) { from.PrivateOverheadMessage( MessageType.Regular, trap.MessageHue, trap.DisarmMessage, from.NetState ); diff --git a/Scripts/Spells/Base/SpellHelper.cs b/Scripts/Spells/Base/SpellHelper.cs index b27d88ffe..19a0a50b1 100644 --- a/Scripts/Spells/Base/SpellHelper.cs +++ b/Scripts/Spells/Base/SpellHelper.cs @@ -9,6 +9,7 @@ using Server.Targeting; using Server.Engines.PartySystem; using Server.Misc; using Server.Spells.Bushido; +using Server.Spells.Necromancy; using Server.Spells.Ninjitsu; using System.Collections.Generic; using Server.Spells.Seventh; @@ -920,7 +921,10 @@ namespace Server.Spells ((BaseCreature)target).AlterSpellDamageFrom( from, ref iDamage ); WeightOverloading.DFA = dfa; - AOS.Damage( target, from, iDamage, phys, fire, cold, pois, nrgy ); + + int damageGiven = AOS.Damage( target, from, iDamage, phys, fire, cold, pois, nrgy ); + DoLeech( damageGiven, from, target ); + WeightOverloading.DFA = DFAlgorithm.Standard; } else @@ -932,6 +936,24 @@ namespace Server.Spells ((BaseCreature)target).OnDamagedBySpell( from ); } + public static void DoLeech( int damageGiven, Mobile from, Mobile target ) + { + TransformContext context = TransformationSpellHelper.GetContext( from ); + if ( context != null && context.Type == typeof( WraithFormSpell ) ) + { + int wraithLeech = ( 5 + (int)( ( 15 * from.Skills.SpiritSpeak.Value ) / 100 ) ); // Wraith form gives 5-20% mana leech + int manaLeech = AOS.Scale( damageGiven, wraithLeech ); + if ( manaLeech != 0 ) + { + // Mana leeched by the Wraith Form spell is actually stolen, not just leeched. + target.Mana -= manaLeech; + from.Mana += manaLeech; + from.PlaySound( 0x44D ); + //from.SendMessage(String.Format("You Leeched {0} Mana", manaLeech)); + } + } + } + public static void Heal( int amount, Mobile target, Mobile from ) { Heal( amount, target, from, true ); @@ -1012,7 +1034,10 @@ namespace Server.Spells ((BaseCreature)m_Target).AlterSpellDamageFrom( m_From, ref m_Damage ); WeightOverloading.DFA = m_DFA; - AOS.Damage( m_Target, m_From, m_Damage, m_Phys, m_Fire, m_Cold, m_Pois, m_Nrgy ); + + int damageGiven = AOS.Damage( m_Target, m_From, m_Damage, m_Phys, m_Fire, m_Cold, m_Pois, m_Nrgy ); + DoLeech( damageGiven, m_From, m_Target ); + WeightOverloading.DFA = DFAlgorithm.Standard; if( m_Target is BaseCreature && m_From != null ) diff --git a/Scripts/Spells/Bushido/Evasion.cs b/Scripts/Spells/Bushido/Evasion.cs index 2a06fa25d..65b1864a3 100644 --- a/Scripts/Spells/Bushido/Evasion.cs +++ b/Scripts/Spells/Bushido/Evasion.cs @@ -54,6 +54,12 @@ namespace Server.Spells.Bushido return false; } + if ( !Caster.CanBeginAction( typeof( Evasion ) ) ) + { + Caster.SendLocalizedMessage( 501789 ); // You must wait before trying again. + return false; + } + return true; } @@ -98,6 +104,9 @@ namespace Server.Spells.Bushido OnCastSuccessful( Caster ); BeginEvasion( Caster ); + + Caster.BeginAction( typeof( Evasion ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 20.0 ), delegate { Caster.EndAction( typeof( Evasion ) ); } ); } FinishSequence(); diff --git a/Scripts/Spells/Necromancy/PainSpike.cs b/Scripts/Spells/Necromancy/PainSpike.cs index 7e3ee87d2..239069ac7 100644 --- a/Scripts/Spells/Necromancy/PainSpike.cs +++ b/Scripts/Spells/Necromancy/PainSpike.cs @@ -80,6 +80,7 @@ namespace Server.Spells.Necromancy Misc.WeightOverloading.DFA = Misc.DFAlgorithm.PainSpike; m.Damage( (int) damage, Caster ); + SpellHelper.DoLeech( (int)damage, Caster, m ); Misc.WeightOverloading.DFA = Misc.DFAlgorithm.Standard; //SpellHelper.Damage( this, m, damage, 100, 0, 0, 0, 0, Misc.DFAlgorithm.PainSpike ); diff --git a/Scripts/Spells/Spellweaving/ArcaneCircle.cs b/Scripts/Spells/Spellweaving/ArcaneCircle.cs index 3ed2c79ac..79c7507aa 100644 --- a/Scripts/Spells/Spellweaving/ArcaneCircle.cs +++ b/Scripts/Spells/Spellweaving/ArcaneCircle.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using Server.Items; +using Server.Mobiles; namespace Server.Spells.Spellweaving { @@ -29,6 +30,12 @@ namespace Server.Spells.Spellweaving return false; } + if ( GetArcanists().Count < 2 ) + { + Caster.SendLocalizedMessage( 1080452 ); //There are not enough spellweavers present to create an Arcane Focus. + return false; + } + return base.CheckCast(); } @@ -111,7 +118,7 @@ namespace Server.Spells.Spellweaving //OSI Verified: Even enemies/combatants count foreach( Mobile m in Caster.GetMobilesInRange( 1 ) ) //Range verified as 1 { - if( m != Caster && Caster.CanBeBeneficial( m, false ) && Math.Abs( Caster.Skills.Spellweaving.Value - m.Skills.Spellweaving.Value ) <= 20 ) //TODO: OSI check, aggressor/agressed? Visibility? + if ( m != Caster && Caster.CanBeBeneficial( m, false ) && Math.Abs( Caster.Skills.Spellweaving.Value - m.Skills.Spellweaving.Value ) <= 20 && !(m is Clone) ) { weavers.Add( m ); }