From 99b0ad9de52b3b12bda759ce30ea0004c0bf4e31 Mon Sep 17 00:00:00 2001 From: eos Date: Sun, 20 May 2012 02:35:53 +0000 Subject: [PATCH] - Fixed the Palace of Paroxysmus region bounds. - Fixed a typo in the Huntsman's Forest region name. - Added the Bravehorn's drinking pool and Huntsman's Forest quest regions to Felucca. - Fixed CheckObjectTypes not sending invalid condition replies, because the commands are not always flushed after checking this. - When using an item condition with [online or [ipaddress, the command will now correctly say it does not support items. - The [Go menu now handles comments in the XML location files correctly. - Added the Increased Karma Loss attribute. - Renamed DummyTheif to DummyThief. --- Data/Regions.xml | 10 ++++++--- .../Implementors/AreaCommandImplementor.cs | 2 +- .../Implementors/BaseCommandImplementor.cs | 6 ++--- .../ContainedCommandImplementor.cs | 2 +- .../Implementors/GlobalCommandImplementor.cs | 2 +- .../IPAddressCommandImplementor.cs | 4 ++-- .../Implementors/OnlineCommandImplementor.cs | 4 ++-- .../Implementors/RegionCommandImplementor.cs | 2 +- Scripts/Gumps/Go/ParentNode.cs | 5 ++++- Scripts/Items/Armor/BaseArmor.cs | 3 +++ Scripts/Items/Clothing/BaseClothing.cs | 3 +++ Scripts/Items/Jewels/BaseJewel.cs | 3 +++ .../Items/Skill Items/Magical/Spellbook.cs | 3 +++ .../8th Anniversary Items/OssianGrimoire.cs | 9 +++++--- Scripts/Items/Talismans/BaseTalisman.cs | 22 +++++-------------- Scripts/Items/Weapons/BaseWeapon.cs | 3 +++ Scripts/Misc/AOS.cs | 6 ++++- Scripts/Mobiles/Special/DummySpecific.cs | 12 +++++----- Scripts/Spells/Necromancy/NecromancerSpell.cs | 7 ++++-- 19 files changed, 64 insertions(+), 44 deletions(-) diff --git a/Data/Regions.xml b/Data/Regions.xml index cd0f432be..57cd9e871 100644 --- a/Data/Regions.xml +++ b/Data/Regions.xml @@ -49,7 +49,12 @@ - + + + + + + @@ -794,12 +799,11 @@ - - + diff --git a/Scripts/Commands/Generic/Implementors/AreaCommandImplementor.cs b/Scripts/Commands/Generic/Implementors/AreaCommandImplementor.cs index 4913b13a6..d948b8732 100644 --- a/Scripts/Commands/Generic/Implementors/AreaCommandImplementor.cs +++ b/Scripts/Commands/Generic/Implementors/AreaCommandImplementor.cs @@ -44,7 +44,7 @@ namespace Server.Commands.Generic bool items, mobiles; - if ( !CheckObjectTypes( command, ext, out items, out mobiles ) ) + if ( !CheckObjectTypes( from, command, ext, out items, out mobiles ) ) return; IPooledEnumerable eable; diff --git a/Scripts/Commands/Generic/Implementors/BaseCommandImplementor.cs b/Scripts/Commands/Generic/Implementors/BaseCommandImplementor.cs index 15fa711af..8c0a36215 100644 --- a/Scripts/Commands/Generic/Implementors/BaseCommandImplementor.cs +++ b/Scripts/Commands/Generic/Implementors/BaseCommandImplementor.cs @@ -113,7 +113,7 @@ namespace Server.Commands.Generic m_Commands[command.Commands[i]] = command; } - public bool CheckObjectTypes( BaseCommand command, Extensions ext, out bool items, out bool mobiles ) + public bool CheckObjectTypes( Mobile from, BaseCommand command, Extensions ext, out bool items, out bool mobiles ) { items = mobiles = false; @@ -153,7 +153,7 @@ namespace Server.Commands.Generic } else if ( condIsMobile ) { - command.LogFailure( "You may not use a mobile type condition for this command." ); + from.SendMessage( "You may not use a mobile type condition for this command." ); return false; } @@ -167,7 +167,7 @@ namespace Server.Commands.Generic } else if ( condIsItem ) { - command.LogFailure( "You may not use an item type condition for this command." ); + from.SendMessage( "You may not use an item type condition for this command." ); return false; } diff --git a/Scripts/Commands/Generic/Implementors/ContainedCommandImplementor.cs b/Scripts/Commands/Generic/Implementors/ContainedCommandImplementor.cs index 3e979f8c9..54760dbf7 100644 --- a/Scripts/Commands/Generic/Implementors/ContainedCommandImplementor.cs +++ b/Scripts/Commands/Generic/Implementors/ContainedCommandImplementor.cs @@ -50,7 +50,7 @@ namespace Server.Commands.Generic bool items, mobiles; - if ( !CheckObjectTypes( command, ext, out items, out mobiles ) ) + if ( !CheckObjectTypes( from, command, ext, out items, out mobiles ) ) return; if ( !items ) diff --git a/Scripts/Commands/Generic/Implementors/GlobalCommandImplementor.cs b/Scripts/Commands/Generic/Implementors/GlobalCommandImplementor.cs index b91ef5f47..7e67180a3 100644 --- a/Scripts/Commands/Generic/Implementors/GlobalCommandImplementor.cs +++ b/Scripts/Commands/Generic/Implementors/GlobalCommandImplementor.cs @@ -24,7 +24,7 @@ namespace Server.Commands.Generic bool items, mobiles; - if ( !CheckObjectTypes( command, ext, out items, out mobiles ) ) + if ( !CheckObjectTypes( from, command, ext, out items, out mobiles ) ) return; ArrayList list = new ArrayList(); diff --git a/Scripts/Commands/Generic/Implementors/IPAddressCommandImplementor.cs b/Scripts/Commands/Generic/Implementors/IPAddressCommandImplementor.cs index 0491c4ca9..d519e1e48 100644 --- a/Scripts/Commands/Generic/Implementors/IPAddressCommandImplementor.cs +++ b/Scripts/Commands/Generic/Implementors/IPAddressCommandImplementor.cs @@ -25,12 +25,12 @@ namespace Server.Commands.Generic bool items, mobiles; - if ( !CheckObjectTypes( command, ext, out items, out mobiles ) ) + if ( !CheckObjectTypes( from, command, ext, out items, out mobiles ) ) return; if ( !mobiles ) // sanity check { - command.LogFailure( "This command does not support mobiles." ); + command.LogFailure( "This command does not support items." ); return; } diff --git a/Scripts/Commands/Generic/Implementors/OnlineCommandImplementor.cs b/Scripts/Commands/Generic/Implementors/OnlineCommandImplementor.cs index 92429b544..165abf83e 100644 --- a/Scripts/Commands/Generic/Implementors/OnlineCommandImplementor.cs +++ b/Scripts/Commands/Generic/Implementors/OnlineCommandImplementor.cs @@ -26,12 +26,12 @@ namespace Server.Commands.Generic bool items, mobiles; - if ( !CheckObjectTypes( command, ext, out items, out mobiles ) ) + if ( !CheckObjectTypes( from, command, ext, out items, out mobiles ) ) return; if ( !mobiles ) // sanity check { - command.LogFailure( "This command does not support mobiles." ); + command.LogFailure( "This command does not support items." ); return; } diff --git a/Scripts/Commands/Generic/Implementors/RegionCommandImplementor.cs b/Scripts/Commands/Generic/Implementors/RegionCommandImplementor.cs index 4fae4f0d5..8408abb0d 100644 --- a/Scripts/Commands/Generic/Implementors/RegionCommandImplementor.cs +++ b/Scripts/Commands/Generic/Implementors/RegionCommandImplementor.cs @@ -24,7 +24,7 @@ namespace Server.Commands.Generic bool items, mobiles; - if ( !CheckObjectTypes( command, ext, out items, out mobiles ) ) + if ( !CheckObjectTypes( from, command, ext, out items, out mobiles ) ) return; Region reg = from.Region; diff --git a/Scripts/Gumps/Go/ParentNode.cs b/Scripts/Gumps/Go/ParentNode.cs index 31c771023..4ba5ef1d9 100644 --- a/Scripts/Gumps/Go/ParentNode.cs +++ b/Scripts/Gumps/Go/ParentNode.cs @@ -34,8 +34,11 @@ namespace Server.Gumps { ArrayList children = new ArrayList(); - while ( xml.Read() && xml.NodeType == XmlNodeType.Element ) + while ( xml.Read() && ( xml.NodeType == XmlNodeType.Element || xml.NodeType == XmlNodeType.Comment ) ) { + if ( xml.NodeType == XmlNodeType.Comment ) + continue; + if ( xml.Name == "child" ) { ChildNode n = new ChildNode( xml, this ); diff --git a/Scripts/Items/Armor/BaseArmor.cs b/Scripts/Items/Armor/BaseArmor.cs index f817377ca..45dc7fa6e 100644 --- a/Scripts/Items/Armor/BaseArmor.cs +++ b/Scripts/Items/Armor/BaseArmor.cs @@ -1531,6 +1531,9 @@ namespace Server.Items if ( (prop = m_AosAttributes.WeaponSpeed) != 0 ) list.Add( 1060486, prop.ToString() ); // swing speed increase ~1_val~% + if ( Core.ML && (prop = m_AosAttributes.IncreasedKarmaLoss) != 0 ) + list.Add( 1075210, prop.ToString() ); // Increased Karma Loss ~1val~% + base.AddResistanceProperties( list ); if ( (prop = GetDurabilityBonus()) > 0 ) diff --git a/Scripts/Items/Clothing/BaseClothing.cs b/Scripts/Items/Clothing/BaseClothing.cs index a6a13a16e..4bff72a3f 100644 --- a/Scripts/Items/Clothing/BaseClothing.cs +++ b/Scripts/Items/Clothing/BaseClothing.cs @@ -657,6 +657,9 @@ namespace Server.Items if ( (prop = m_AosAttributes.WeaponSpeed) != 0 ) list.Add( 1060486, prop.ToString() ); // swing speed increase ~1_val~% + if ( Core.ML && (prop = m_AosAttributes.IncreasedKarmaLoss) != 0 ) + list.Add( 1075210, prop.ToString() ); // Increased Karma Loss ~1val~% + base.AddResistanceProperties( list ); if ( (prop = m_AosClothingAttributes.DurabilityBonus) > 0 ) diff --git a/Scripts/Items/Jewels/BaseJewel.cs b/Scripts/Items/Jewels/BaseJewel.cs index a77835f30..57c5b5140 100644 --- a/Scripts/Items/Jewels/BaseJewel.cs +++ b/Scripts/Items/Jewels/BaseJewel.cs @@ -273,6 +273,9 @@ namespace Server.Items if ( (prop = m_AosAttributes.WeaponSpeed) != 0 ) list.Add( 1060486, prop.ToString() ); // swing speed increase ~1_val~% + if ( Core.ML && (prop = m_AosAttributes.IncreasedKarmaLoss) != 0 ) + list.Add( 1075210, prop.ToString() ); // Increased Karma Loss ~1val~% + base.AddResistanceProperties( list ); if ( m_HitPoints >= 0 && m_MaxHitPoints > 0 ) diff --git a/Scripts/Items/Skill Items/Magical/Spellbook.cs b/Scripts/Items/Skill Items/Magical/Spellbook.cs index af0f1c724..08be2bd87 100644 --- a/Scripts/Items/Skill Items/Magical/Spellbook.cs +++ b/Scripts/Items/Skill Items/Magical/Spellbook.cs @@ -672,6 +672,9 @@ namespace Server.Items if ( (prop = m_AosAttributes.WeaponSpeed) != 0 ) list.Add( 1060486, prop.ToString() ); // swing speed increase ~1_val~% + if ( Core.ML && (prop = m_AosAttributes.IncreasedKarmaLoss) != 0 ) + list.Add( 1075210, prop.ToString() ); // Increased Karma Loss ~1val~% + list.Add( 1042886, m_Count.ToString() ); // ~1_NUMBERS_OF_SPELLS~ Spells } diff --git a/Scripts/Items/Special/8th Anniversary Items/OssianGrimoire.cs b/Scripts/Items/Special/8th Anniversary Items/OssianGrimoire.cs index b9e3061bc..e3624cb79 100644 --- a/Scripts/Items/Special/8th Anniversary Items/OssianGrimoire.cs +++ b/Scripts/Items/Special/8th Anniversary Items/OssianGrimoire.cs @@ -7,14 +7,14 @@ namespace Server.Items public override int LabelNumber { get { return 1078148; } } // Ossian Grimoire [Constructable] - public OssianGrimoire() : base() + public OssianGrimoire() { LootType = LootType.Blessed; SkillBonuses.SetValues( 0, SkillName.Necromancy, 10.0 ); Attributes.RegenMana = 1; Attributes.CastSpeed = 1; - //Attributes.IncreasedKarmaLoss = 5; + Attributes.IncreasedKarmaLoss = 5; } public OssianGrimoire( Serial serial ) : base( serial ) @@ -25,7 +25,7 @@ namespace Server.Items { base.Serialize( writer ); - writer.WriteEncodedInt( 0 ); //version + writer.WriteEncodedInt( 1 ); //version } public override void Deserialize( GenericReader reader ) @@ -33,6 +33,9 @@ namespace Server.Items base.Deserialize( reader ); int version = reader.ReadEncodedInt(); + + if ( version == 0 ) + Attributes.IncreasedKarmaLoss = 5; } } } diff --git a/Scripts/Items/Talismans/BaseTalisman.cs b/Scripts/Items/Talismans/BaseTalisman.cs index 22b6b1eb4..deef9751e 100644 --- a/Scripts/Items/Talismans/BaseTalisman.cs +++ b/Scripts/Items/Talismans/BaseTalisman.cs @@ -42,20 +42,12 @@ namespace Server.Items public override int LabelNumber { get { return 1071023; } } // Talisman public virtual bool ForceShowName { get { return false; } } // used to override default summoner/removal name - private int m_KarmaLoss; private int m_MaxCharges; private int m_Charges; private int m_MaxChargeTime; private int m_ChargeTime; private bool m_Blessed; - [CommandProperty(AccessLevel.GameMaster)] - public int KarmaLoss - { - get { return m_KarmaLoss; } - set { m_KarmaLoss = value; InvalidateProperties(); } - } - [CommandProperty(AccessLevel.GameMaster)] public int MaxCharges { @@ -497,8 +489,8 @@ namespace Server.Items if ((prop = m_AosAttributes.WeaponSpeed) != 0) list.Add(1060486, prop.ToString()); // swing speed increase ~1_val~% - if (m_KarmaLoss != 0) - list.Add(1075210, m_KarmaLoss.ToString()); // Increased Karma Loss ~1val~% + if (Core.ML && (prop = m_AosAttributes.IncreasedKarmaLoss) != 0) + list.Add(1075210, prop.ToString()); // Increased Karma Loss ~1val~% if (m_MaxCharges > 0) list.Add(1060741, m_Charges.ToString()); // charges: ~1_val~ @@ -529,7 +521,7 @@ namespace Server.Items Killer = 0x00000010, Summoner = 0x00000020, Removal = 0x00000040, - KarmaLoss = 0x00000080, + OldKarmaLoss = 0x00000080, Skill = 0x00000100, SuccessBonus = 0x00000200, ExceptionalBonus = 0x00000400, @@ -555,7 +547,6 @@ namespace Server.Items SetSaveFlag(ref flags, SaveFlag.Killer, m_Killer != null && !m_Killer.IsEmpty); SetSaveFlag(ref flags, SaveFlag.Summoner, m_Summoner != null && !m_Summoner.IsEmpty); SetSaveFlag(ref flags, SaveFlag.Removal, m_Removal != TalismanRemoval.None); - SetSaveFlag(ref flags, SaveFlag.KarmaLoss, m_KarmaLoss != 0); SetSaveFlag(ref flags, SaveFlag.Skill, (int)m_Skill != 0); SetSaveFlag(ref flags, SaveFlag.SuccessBonus, m_SuccessBonus != 0); SetSaveFlag(ref flags, SaveFlag.ExceptionalBonus, m_ExceptionalBonus != 0); @@ -586,9 +577,6 @@ namespace Server.Items if (GetSaveFlag(flags, SaveFlag.Removal)) writer.WriteEncodedInt((int)m_Removal); - if (GetSaveFlag(flags, SaveFlag.KarmaLoss)) - writer.WriteEncodedInt(m_KarmaLoss); - if (GetSaveFlag(flags, SaveFlag.Skill)) writer.WriteEncodedInt((int)m_Skill); @@ -658,8 +646,8 @@ namespace Server.Items if (GetSaveFlag(flags, SaveFlag.Removal)) m_Removal = (TalismanRemoval)reader.ReadEncodedInt(); - if (GetSaveFlag(flags, SaveFlag.KarmaLoss)) - m_KarmaLoss = reader.ReadEncodedInt(); + if (GetSaveFlag(flags, SaveFlag.OldKarmaLoss)) + m_AosAttributes.IncreasedKarmaLoss = reader.ReadEncodedInt(); if (GetSaveFlag(flags, SaveFlag.Skill)) m_Skill = (SkillName)reader.ReadEncodedInt(); diff --git a/Scripts/Items/Weapons/BaseWeapon.cs b/Scripts/Items/Weapons/BaseWeapon.cs index 241fea3c7..dfa2bbada 100644 --- a/Scripts/Items/Weapons/BaseWeapon.cs +++ b/Scripts/Items/Weapons/BaseWeapon.cs @@ -3306,6 +3306,9 @@ namespace Server.Items if ( (prop = m_AosAttributes.WeaponSpeed) != 0 ) list.Add( 1060486, prop.ToString() ); // swing speed increase ~1_val~% + if ( Core.ML && (prop = m_AosAttributes.IncreasedKarmaLoss) != 0 ) + list.Add( 1075210, prop.ToString() ); // Increased Karma Loss ~1val~% + int phys, fire, cold, pois, nrgy, chaos, direct; GetDamageTypes( null, out phys, out fire, out cold, out pois, out nrgy, out chaos, out direct ); diff --git a/Scripts/Misc/AOS.cs b/Scripts/Misc/AOS.cs index 4fdb5dbb2..304819ca3 100644 --- a/Scripts/Misc/AOS.cs +++ b/Scripts/Misc/AOS.cs @@ -232,7 +232,8 @@ namespace Server EnhancePotions=0x00080000, Luck=0x00100000, SpellChanneling=0x00200000, - NightSight=0x00400000 + NightSight=0x00400000, + IncreasedKarmaLoss=0x00800000 } public sealed class AosAttributes : BaseAttributes @@ -437,6 +438,9 @@ namespace Server [CommandProperty( AccessLevel.GameMaster )] public int NightSight { get { return this[AosAttribute.NightSight]; } set { this[AosAttribute.NightSight] = value; } } + + [CommandProperty( AccessLevel.GameMaster )] + public int IncreasedKarmaLoss { get { return this[AosAttribute.IncreasedKarmaLoss]; } set { this[AosAttribute.IncreasedKarmaLoss] = value; } } } [Flags] diff --git a/Scripts/Mobiles/Special/DummySpecific.cs b/Scripts/Mobiles/Special/DummySpecific.cs index aca1538fa..203496104 100644 --- a/Scripts/Mobiles/Special/DummySpecific.cs +++ b/Scripts/Mobiles/Special/DummySpecific.cs @@ -719,13 +719,13 @@ namespace Server.Mobiles } } - public class DummyTheif : Dummy + [TypeAlias( "Server.Mobiles.DummyTheif" )] + public class DummyThief : Dummy { - [Constructable] - public DummyTheif() : base(AIType.AI_Thief, FightMode.Closest, 15, 1, 0.2, 0.6) + public DummyThief() : base(AIType.AI_Thief, FightMode.Closest, 15, 1, 0.2, 0.6) { - // A Dummy Hybrid Theif + // A Dummy Hybrid Thief int iHue = 20 + Team * 40; int jHue = 25 + Team * 40; @@ -739,7 +739,7 @@ namespace Server.Mobiles this.Skills[SkillName.Wrestling].Base = 120; // Name - this.Name = "Hybrid Theif"; + this.Name = "Hybrid Thief"; // Equip Spellbook book = new Spellbook(); @@ -793,7 +793,7 @@ namespace Server.Mobiles AddToBackpack( band ); } - public DummyTheif( Serial serial ) : base( serial ) + public DummyThief( Serial serial ) : base( serial ) { } diff --git a/Scripts/Spells/Necromancy/NecromancerSpell.cs b/Scripts/Spells/Necromancy/NecromancerSpell.cs index 99046805e..af21e28ba 100644 --- a/Scripts/Spells/Necromancy/NecromancerSpell.cs +++ b/Scripts/Spells/Necromancy/NecromancerSpell.cs @@ -25,10 +25,13 @@ namespace Server.Spells.Necromancy public override int ComputeKarmaAward() { //TODO: Verify this formula being that Necro spells don't HAVE a circle. + //int karma = -(70 + (10 * (int)Circle)); + int karma = -(40 + (int)(10 * (CastDelayBase.TotalSeconds / CastDelaySecondsPerTick))); - //return -(70 + (10 * (int)Circle)); + if ( Core.ML ) // Pub 36: "Added a new property called Increased Karma Loss which grants higher karma loss for casting necromancy spells." + karma += AOS.Scale( karma, AosAttributes.GetValue( Caster, AosAttribute.IncreasedKarmaLoss ) ); - return -(40 + (int)(10 * (CastDelayBase.TotalSeconds / CastDelaySecondsPerTick))); + return karma; } public override void GetCastSkills( out double min, out double max )