From cd2462621f54bb14e5e67c8c890e5cb4d96fa6ce Mon Sep 17 00:00:00 2001 From: xavier Date: Sat, 25 Sep 2010 13:48:08 +0000 Subject: [PATCH] Lightning strike should not consume mana or deactivate when you miss. http://www.uodemise.com/forum/showthread.php?t=145364 BOD turn-in should have 10 second timer since pub 50 http://www.uodemise.com/forum/showthread.php?t=156441 Vet reward ore carts, gem carts, and stumps have missing range check added http://www.uodemise.com/forum/showthread.php?t=156380 Blood Oath: missing 35hp pvp dmg cap added, correct credit for kills/dmg given to caster, ML magic resist now applies. http://www.uodemise.com/forum/showthread.php?t=118729&page=3 Missing ore sizes added http://www.uodemise.com/forum/showthread.php?t=119888 Player-cast gates reveal stealthers/hiders. http://www.uodemise.com/forum/showthread.php?t=149218 Some necro spells should disturb a casting target http://www.uodemise.com/forum/showthread.php?t=149361 Failed snoop attempts should reveal thief if hidden. http://www.uodemise.com/forum/showthread.php?t=153962 Pets do not autostable in the case of a server restart/cash: fixed http://www.uodemise.com/forum/showthread.php?t=122745 Misc Aesthetic changes to spells, etc. earthquake wrong sound magic arrow inappropriate particles curse wrong sound agility wrong sound chain lightning should always play sound poison wrong sound dispel evil missing sound noble sacrifice male/female, diff sounds sacred journey missing sound --- Scripts/Engines/Harvest/Core/HarvestSystem.cs | 4 +- Scripts/Items/Resources/Blacksmithing/Ore.cs | 164 ++++++++++++++++-- .../Skill Items/Magical/Misc/Moongate.cs | 8 + .../Special/Veteran Rewards/MiningCart.cs | 6 +- .../Special/Veteran Rewards/TreeStump.cs | 8 +- Scripts/Mobiles/Monsters/Ants/AntLion.cs | 16 +- .../Elemental/Melee/EarthElemental.cs | 5 +- .../Monsters/Elemental/Melee/SnowElemental.cs | 4 +- .../Ore Elementals/AgapiteElemental.cs | 4 +- .../Ore Elementals/BronzeElemental.cs | 4 +- .../Ore Elementals/CopperElemental.cs | 4 +- .../Ore Elementals/DullCopperElemental.cs | 4 +- .../Ore Elementals/GoldenElemental.cs | 4 +- .../Ore Elementals/ShadowIronElemental.cs | 4 +- .../Ore Elementals/ValoriteElemental.cs | 4 +- .../Ore Elementals/VeriteElemental.cs | 4 +- Scripts/Mobiles/PlayerMobile.cs | 50 +++++- Scripts/Mobiles/Vendors/BaseVendor.cs | 16 ++ Scripts/Skills/Snooping.cs | 3 + Scripts/Spells/Bushido/LightningStrike.cs | 6 - Scripts/Spells/Chivalry/DispelEvil.cs | 3 +- Scripts/Spells/Chivalry/NobleSacrifice.cs | 2 +- Scripts/Spells/Chivalry/SacredJourney.cs | 2 + Scripts/Spells/Eighth/Earthquake.cs | 2 +- Scripts/Spells/First/MagicArrow.cs | 2 +- Scripts/Spells/Fourth/Curse.cs | 2 +- Scripts/Spells/Necromancy/BloodOathSpell.cs | 3 + Scripts/Spells/Necromancy/CorpseSkin.cs | 3 + Scripts/Spells/Necromancy/EvilOmen.cs | 3 + Scripts/Spells/Necromancy/MindRot.cs | 3 + Scripts/Spells/Necromancy/Strangle.cs | 3 + Scripts/Spells/Second/Agility.cs | 2 +- Scripts/Spells/Seventh/ChainLightning.cs | 10 +- Scripts/Spells/Third/Poison.cs | 2 +- 34 files changed, 313 insertions(+), 51 deletions(-) diff --git a/Scripts/Engines/Harvest/Core/HarvestSystem.cs b/Scripts/Engines/Harvest/Core/HarvestSystem.cs index e5947acfc..87e2bca0e 100644 --- a/Scripts/Engines/Harvest/Core/HarvestSystem.cs +++ b/Scripts/Engines/Harvest/Core/HarvestSystem.cs @@ -176,11 +176,11 @@ namespace Server.Engines.Harvest bool eligableForRacialBonus = ( def.RaceBonus && from.Race == Race.Human ); bool inFelucca = (map == Map.Felucca); - if( eligableForRacialBonus && inFelucca && bank.Current >= feluccaRacialAmount ) + if( eligableForRacialBonus && inFelucca && bank.Current >= feluccaRacialAmount && 0.1 > Utility.RandomDouble() ) item.Amount = feluccaRacialAmount; else if( inFelucca && bank.Current >= feluccaAmount ) item.Amount = feluccaAmount; - else if( eligableForRacialBonus && bank.Current >= racialAmount ) + else if( eligableForRacialBonus && bank.Current >= racialAmount && 0.1 > Utility.RandomDouble() ) item.Amount = racialAmount; else item.Amount = amount; diff --git a/Scripts/Items/Resources/Blacksmithing/Ore.cs b/Scripts/Items/Resources/Blacksmithing/Ore.cs index f8c5648a4..41da8264c 100644 --- a/Scripts/Items/Resources/Blacksmithing/Ore.cs +++ b/Scripts/Items/Resources/Blacksmithing/Ore.cs @@ -3,6 +3,7 @@ using Server.Items; using Server.Network; using Server.Targeting; using Server.Engines.Craft; +using Server.Mobiles; namespace Server.Items { @@ -79,10 +80,21 @@ namespace Server.Items { } - public BaseOre( CraftResource resource, int amount ) : base( 0x19B9 ) + public BaseOre( CraftResource resource, int amount ) : base( Utility.Random( 4 ) ) { + { + double random = Utility.RandomDouble(); + if ( 0.12 >= random ) + ItemID = 0x19B7; + else if ( 0.18 >= random ) + ItemID = 0x19B8; + else if ( 0.25 >= random ) + ItemID = 0x19BA; + else + ItemID = 0x19B9; + } + Stackable = true; - Weight = 12.0; Amount = amount; Hue = CraftResources.GetHue( resource ); @@ -131,8 +143,13 @@ namespace Server.Items { if ( !Movable ) return; - - if ( from.InRange( this.GetWorldLocation(), 2 ) ) + + if ( RootParent is BaseCreature ) + { + from.SendLocalizedMessage( 500447 ); // That is not accessible + return; + } + else if ( from.InRange( this.GetWorldLocation(), 2 ) ) { from.SendLocalizedMessage( 501971 ); // Select the forge on which to smelt the ore, or another pile of ore with which to combine it. from.Target = new InternalTarget( this ); @@ -180,6 +197,90 @@ namespace Server.Items from.SendLocalizedMessage( 501976 ); // The ore is too far away. return; } + + #region Combine Ore + if ( targeted is BaseOre ) + { + BaseOre ore = (BaseOre)targeted; + if ( !ore.Movable ) + return; + else if ( m_Ore == ore ) + { + from.SendLocalizedMessage( 501972 ); // Select another pile or ore with which to combine this. + from.Target = new InternalTarget( ore ); + return; + } + else if ( ore.Resource != m_Ore.Resource ) + { + from.SendLocalizedMessage( 501979 ); // You cannot combine ores of different metals. + return; + } + + int worth = ore.Amount; + if ( ore.ItemID == 0x19B9 ) + worth *= 8; + else if ( ore.ItemID == 0x19B7 ) + worth *= 2; + else + worth *= 4; + int sourceWorth = m_Ore.Amount; + if ( m_Ore.ItemID == 0x19B9 ) + sourceWorth *= 8; + else if ( m_Ore.ItemID == 0x19B7 ) + sourceWorth *= 2; + else + sourceWorth *= 4; + worth += sourceWorth; + + int plusWeight = 0; + int newID = ore.ItemID; + if ( ore.DefaultWeight != m_Ore.DefaultWeight ) + { + if ( ore.ItemID == 0x19B7 || m_Ore.ItemID == 0x19B7 ) + { + newID = 0x19B7; + } + else if ( ore.ItemID == 0x19B9 ) + { + newID = m_Ore.ItemID; + plusWeight = ore.Amount * 2; + } + else + { + plusWeight = m_Ore.Amount * 2; + } + } + + if ( (ore.ItemID == 0x19B9 && worth > 120000) || (( ore.ItemID == 0x19B8 || ore.ItemID == 0x19BA ) && worth > 60000) || (ore.ItemID == 0x19B7 && worth > 30000)) + { + from.SendLocalizedMessage( 1062844 ); // There is too much ore to combine. + return; + } + else if ( ore.RootParent is Mobile && (plusWeight + ((Mobile)ore.RootParent).Backpack.TotalWeight) > ((Mobile)ore.RootParent).Backpack.MaxWeight ) + { + from.SendLocalizedMessage( 501978 ); // The weight is too great to combine in a container. + return; + } + + ore.ItemID = newID; + if ( ore.ItemID == 0x19B9 ) + { + ore.Amount = worth / 8; + m_Ore.Delete(); + } + else if ( ore.ItemID == 0x19B7 ) + { + ore.Amount = worth / 2; + m_Ore.Delete(); + } + else + { + ore.Amount = worth / 4; + m_Ore.Delete(); + } + return; + } + #endregion if ( IsForge( targeted ) ) { @@ -206,24 +307,54 @@ namespace Server.Items from.SendLocalizedMessage( 501986 ); // You have no idea how to smelt this strange ore! return; } + + if ( m_Ore.Amount <= 1 && m_Ore.ItemID == 0x19B7 ) + { + from.SendLocalizedMessage( 501987 ); // There is not enough metal-bearing ore in this pile to make an ingot. + return; + } if ( from.CheckTargetSkill( SkillName.Mining, targeted, minSkill, maxSkill ) ) { - int toConsume = m_Ore.Amount; - - if ( toConsume <= 0 ) + if ( m_Ore.Amount <= 0 ) { from.SendLocalizedMessage( 501987 ); // There is not enough metal-bearing ore in this pile to make an ingot. } else { - if ( toConsume > 30000 ) - toConsume = 30000; + int amount = m_Ore.Amount; + if ( m_Ore.Amount > 30000 ) + amount = 30000; BaseIngot ingot = m_Ore.GetIngot(); - ingot.Amount = toConsume * 2; + + if ( m_Ore.ItemID == 0x19B7 ) + { + if ( m_Ore.Amount % 2 == 0 ) + { + amount /= 2; + m_Ore.Delete(); + } + else + { + amount /= 2; + m_Ore.Amount = 1; + } + } + + else if ( m_Ore.ItemID == 0x19B9 ) + { + amount *= 2; + m_Ore.Delete(); + } + + else + { + amount /= 1; + m_Ore.Delete(); + } - m_Ore.Consume( toConsume ); + ingot.Amount = amount; from.AddToBackpack( ingot ); //from.PlaySound( 0x57 ); @@ -231,10 +362,15 @@ namespace Server.Items from.SendLocalizedMessage( 501988 ); // You smelt the ore removing the impurities and put the metal in your backpack. } } - else if ( m_Ore.Amount < 2 ) + else if ( m_Ore.Amount < 2 && m_Ore.ItemID == 0x19B9 ) { - from.SendLocalizedMessage( 501989 ); // You burn away the impurities but are left with no useable metal. - m_Ore.Delete(); + from.SendLocalizedMessage( 501990 ); // You burn away the impurities but are left with less useable metal. + m_Ore.ItemID = 0x19B8; + } + else if ( m_Ore.Amount < 2 && m_Ore.ItemID == 0x19B8 || m_Ore.ItemID == 0x19BA ) + { + from.SendLocalizedMessage( 501990 ); // You burn away the impurities but are left with less useable metal. + m_Ore.ItemID = 0x19B7; } else { diff --git a/Scripts/Items/Skill Items/Magical/Misc/Moongate.cs b/Scripts/Items/Skill Items/Magical/Misc/Moongate.cs index 57196c32a..49278eae7 100644 --- a/Scripts/Items/Skill Items/Magical/Misc/Moongate.cs +++ b/Scripts/Items/Skill Items/Magical/Misc/Moongate.cs @@ -103,6 +103,14 @@ namespace Server.Items public virtual void CheckGate( Mobile m, int range ) { + #region Mondain's Legacy + if ( m.Hidden && Core.ML ) + { + m.RevealingAction(); + m.SendLocalizedMessage( 501955 ); // Your spirit lacks the cohesion for gate travel at this time. + } + #endregion + new DelayTimer( m, this, range ).Start(); } diff --git a/Scripts/Items/Special/Veteran Rewards/MiningCart.cs b/Scripts/Items/Special/Veteran Rewards/MiningCart.cs index bb561c5ca..facdd2bcb 100644 --- a/Scripts/Items/Special/Veteran Rewards/MiningCart.cs +++ b/Scripts/Items/Special/Veteran Rewards/MiningCart.cs @@ -144,7 +144,11 @@ namespace Server.Items { BaseHouse house = BaseHouse.FindHouseAt( this ); - if ( house != null && house.HasSecureAccess( from, SecureLevel.Friends ) ) + if ( !from.InRange( GetWorldLocation(), 2 ) ) + { + from.LocalOverheadMessage( Network.MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. + } + else if ( house != null && house.HasSecureAccess( from, SecureLevel.Friends ) ) { switch ( m_CartType ) { diff --git a/Scripts/Items/Special/Veteran Rewards/TreeStump.cs b/Scripts/Items/Special/Veteran Rewards/TreeStump.cs index bb0b119a4..46c8979ca 100644 --- a/Scripts/Items/Special/Veteran Rewards/TreeStump.cs +++ b/Scripts/Items/Special/Veteran Rewards/TreeStump.cs @@ -60,10 +60,14 @@ namespace Server.Items } public override void OnComponentUsed( AddonComponent c, Mobile from ) - { + { BaseHouse house = BaseHouse.FindHouseAt( this ); - if ( house != null && house.HasSecureAccess( from, SecureLevel.Friends ) ) + if ( !from.InRange( GetWorldLocation(), 2 ) ) + { + from.LocalOverheadMessage( Network.MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. + } + else if ( house != null && house.HasSecureAccess( from, SecureLevel.Friends ) ) { if ( m_Logs > 0 ) { diff --git a/Scripts/Mobiles/Monsters/Ants/AntLion.cs b/Scripts/Mobiles/Monsters/Ants/AntLion.cs index cf6ca343d..d3fcfc27f 100644 --- a/Scripts/Mobiles/Monsters/Ants/AntLion.cs +++ b/Scripts/Mobiles/Monsters/Ants/AntLion.cs @@ -47,12 +47,20 @@ namespace Server.Mobiles if ( Core.ML && Utility.RandomDouble() < .33 ) PackItem( Engines.Plants.Seed.RandomPeculiarSeed(2) ); + Item dullore = new DullCopperOre( Utility.RandomMinMax( 1, 10 ) ); + dullore.ItemID = 0x19B9; + Item shadowore = new ShadowIronOre( Utility.RandomMinMax( 1, 10 ) ); + shadowore.ItemID = 0x19B9; + Item copperore = new CopperOre( Utility.RandomMinMax( 1, 10 ) ); + copperore.ItemID = 0x19B9; + Item bronzeore = new BronzeOre( Utility.RandomMinMax( 1, 10 ) ); + bronzeore.ItemID = 0x19B9; switch ( Utility.Random( 4 ) ) { - case 0: PackItem( new DullCopperOre( Utility.RandomMinMax( 1, 10 ) ) ); break; - case 1: PackItem( new ShadowIronOre( Utility.RandomMinMax( 1, 10 ) ) ); break; - case 2: PackItem( new CopperOre( Utility.RandomMinMax( 1, 10 ) ) ); break; - case 3: PackItem( new BronzeOre( Utility.RandomMinMax( 1, 10 ) ) ); break; + case 0: PackItem( dullore ); break; + case 1: PackItem( shadowore ); break; + case 2: PackItem( copperore ); break; + case 3: PackItem( bronzeore ); break; } // TODO: skeleton diff --git a/Scripts/Mobiles/Monsters/Elemental/Melee/EarthElemental.cs b/Scripts/Mobiles/Monsters/Elemental/Melee/EarthElemental.cs index 44ff5ac6c..e4b91b723 100644 --- a/Scripts/Mobiles/Monsters/Elemental/Melee/EarthElemental.cs +++ b/Scripts/Mobiles/Monsters/Elemental/Melee/EarthElemental.cs @@ -45,8 +45,11 @@ namespace Server.Mobiles ControlSlots = 2; PackItem( new FertileDirt( Utility.RandomMinMax( 1, 4 ) ) ); - PackItem( new IronOre( 3 ) ); // TODO: Five small iron ore PackItem( new MandrakeRoot() ); + + Item ore = new IronOre( 5 ); + ore.ItemID = 0x19B7; + PackItem( ore ); } public override void GenerateLoot() diff --git a/Scripts/Mobiles/Monsters/Elemental/Melee/SnowElemental.cs b/Scripts/Mobiles/Monsters/Elemental/Melee/SnowElemental.cs index 7dd058ef3..afdd3f58a 100644 --- a/Scripts/Mobiles/Monsters/Elemental/Melee/SnowElemental.cs +++ b/Scripts/Mobiles/Monsters/Elemental/Melee/SnowElemental.cs @@ -39,8 +39,10 @@ namespace Server.Mobiles VirtualArmor = 50; - PackItem( new IronOre( 3 ) ); PackItem( new BlackPearl( 3 ) ); + Item ore = new IronOre( 3 ); + ore.ItemID = 0x19B8; + PackItem( ore ); } public override void GenerateLoot() diff --git a/Scripts/Mobiles/Monsters/Ore Elementals/AgapiteElemental.cs b/Scripts/Mobiles/Monsters/Ore Elementals/AgapiteElemental.cs index be8c1936d..15d165d52 100644 --- a/Scripts/Mobiles/Monsters/Ore Elementals/AgapiteElemental.cs +++ b/Scripts/Mobiles/Monsters/Ore Elementals/AgapiteElemental.cs @@ -44,7 +44,9 @@ namespace Server.Mobiles VirtualArmor = 32; - PackItem( new AgapiteOre( oreAmount ) ); + Item ore = new AgapiteOre( oreAmount ); + ore.ItemID = 0x19B9; + PackItem( ore ); } public override void GenerateLoot() diff --git a/Scripts/Mobiles/Monsters/Ore Elementals/BronzeElemental.cs b/Scripts/Mobiles/Monsters/Ore Elementals/BronzeElemental.cs index 5f45b7c7e..0f1b7d474 100644 --- a/Scripts/Mobiles/Monsters/Ore Elementals/BronzeElemental.cs +++ b/Scripts/Mobiles/Monsters/Ore Elementals/BronzeElemental.cs @@ -46,7 +46,9 @@ namespace Server.Mobiles VirtualArmor = 29; - PackItem( new BronzeOre( oreAmount ) ); + Item ore = new BronzeOre( oreAmount ); + ore.ItemID = 0x19B9; + PackItem( ore ); } public override void GenerateLoot() diff --git a/Scripts/Mobiles/Monsters/Ore Elementals/CopperElemental.cs b/Scripts/Mobiles/Monsters/Ore Elementals/CopperElemental.cs index dc931ccea..f58d90ad9 100644 --- a/Scripts/Mobiles/Monsters/Ore Elementals/CopperElemental.cs +++ b/Scripts/Mobiles/Monsters/Ore Elementals/CopperElemental.cs @@ -44,7 +44,9 @@ namespace Server.Mobiles VirtualArmor = 26; - PackItem( new CopperOre( oreAmount ) ); + Item ore = new CopperOre( oreAmount ); + ore.ItemID = 0x19B9; + PackItem( ore ); } public override void GenerateLoot() diff --git a/Scripts/Mobiles/Monsters/Ore Elementals/DullCopperElemental.cs b/Scripts/Mobiles/Monsters/Ore Elementals/DullCopperElemental.cs index a6298f910..8b5f9b2c6 100644 --- a/Scripts/Mobiles/Monsters/Ore Elementals/DullCopperElemental.cs +++ b/Scripts/Mobiles/Monsters/Ore Elementals/DullCopperElemental.cs @@ -44,7 +44,9 @@ namespace Server.Mobiles VirtualArmor = 20; - PackItem( new DullCopperOre( oreAmount ) ); + Item ore = new DullCopperOre( oreAmount ); + ore.ItemID = 0x19B9; + PackItem( ore ); } public override void GenerateLoot() diff --git a/Scripts/Mobiles/Monsters/Ore Elementals/GoldenElemental.cs b/Scripts/Mobiles/Monsters/Ore Elementals/GoldenElemental.cs index 14cb8345f..7c8356248 100644 --- a/Scripts/Mobiles/Monsters/Ore Elementals/GoldenElemental.cs +++ b/Scripts/Mobiles/Monsters/Ore Elementals/GoldenElemental.cs @@ -44,7 +44,9 @@ namespace Server.Mobiles VirtualArmor = 60; - PackItem( new GoldOre( oreAmount ) ); + Item ore = new GoldOre( oreAmount ); + ore.ItemID = 0x19B9; + PackItem( ore ); } public override void GenerateLoot() diff --git a/Scripts/Mobiles/Monsters/Ore Elementals/ShadowIronElemental.cs b/Scripts/Mobiles/Monsters/Ore Elementals/ShadowIronElemental.cs index 8a8504359..78288c932 100644 --- a/Scripts/Mobiles/Monsters/Ore Elementals/ShadowIronElemental.cs +++ b/Scripts/Mobiles/Monsters/Ore Elementals/ShadowIronElemental.cs @@ -44,7 +44,9 @@ namespace Server.Mobiles VirtualArmor = 23; - PackItem( new ShadowIronOre( oreAmount ) ); + Item ore = new ShadowIronOre( oreAmount ); + ore.ItemID = 0x19B9; + PackItem( ore ); } public override void GenerateLoot() diff --git a/Scripts/Mobiles/Monsters/Ore Elementals/ValoriteElemental.cs b/Scripts/Mobiles/Monsters/Ore Elementals/ValoriteElemental.cs index 16b775d5b..eafa1ff53 100644 --- a/Scripts/Mobiles/Monsters/Ore Elementals/ValoriteElemental.cs +++ b/Scripts/Mobiles/Monsters/Ore Elementals/ValoriteElemental.cs @@ -48,7 +48,9 @@ namespace Server.Mobiles VirtualArmor = 38; - PackItem( new ValoriteOre( oreAmount ) ); + Item ore = new ValoriteOre( oreAmount ); + ore.ItemID = 0x19B9; + PackItem( ore ); } public override void GenerateLoot() diff --git a/Scripts/Mobiles/Monsters/Ore Elementals/VeriteElemental.cs b/Scripts/Mobiles/Monsters/Ore Elementals/VeriteElemental.cs index 2d521f7b7..8c39f284b 100644 --- a/Scripts/Mobiles/Monsters/Ore Elementals/VeriteElemental.cs +++ b/Scripts/Mobiles/Monsters/Ore Elementals/VeriteElemental.cs @@ -45,7 +45,9 @@ namespace Server.Mobiles VirtualArmor = 35; - PackItem( new VeriteOre( oreAmount ) ); + Item ore = new VeriteOre( oreAmount ); + ore.ItemID = 0x19B9; + PackItem( ore ); } public override void GenerateLoot() diff --git a/Scripts/Mobiles/PlayerMobile.cs b/Scripts/Mobiles/PlayerMobile.cs index 234f5a0b8..a103b7b2f 100644 --- a/Scripts/Mobiles/PlayerMobile.cs +++ b/Scripts/Mobiles/PlayerMobile.cs @@ -96,6 +96,7 @@ namespace Server.Mobiles private NpcGuild m_NpcGuild; private DateTime m_NpcGuildJoinTime; + private DateTime m_NextBODTurnInTime; private TimeSpan m_NpcGuildGameTime; private PlayerFlag m_Flags; private int m_StepsTaken; @@ -207,6 +208,13 @@ namespace Server.Mobiles set{ m_NpcGuildJoinTime = value; } } + [CommandProperty( AccessLevel.GameMaster )] + public DateTime NextBODTurnInTime + { + get{ return m_NextBODTurnInTime; } + set{ m_NextBODTurnInTime = value; } + } + [CommandProperty( AccessLevel.GameMaster )] public DateTime LastOnline { @@ -581,6 +589,28 @@ namespace Server.Mobiles EventSink.Logout += new LogoutEventHandler( OnLogout ); EventSink.Connected += new ConnectedEventHandler( EventSink_Connected ); EventSink.Disconnected += new DisconnectedEventHandler( EventSink_Disconnected ); + + if( Core.SE ) + { + Timer.DelayCall( TimeSpan.Zero, new TimerCallback( CheckPets ) ); + } + } + + private static void CheckPets() + { + foreach( Mobile m in World.Mobiles.Values ) + { + if( m is PlayerMobile ) + { + PlayerMobile pm = (PlayerMobile)m; + + if((( !pm.Mounted || ( pm.Mount != null && pm.Mount is EtherealMount )) && ( pm.AllFollowers.Count > pm.AutoStabled.Count )) || + ( pm.Mounted && ( pm.AllFollowers.Count > ( pm.AutoStabled.Count +1 )))) + { + pm.AutoStablePets(); /* autostable checks summons, et al: no need here */ + } + } + } } public override void OnSkillInvalidated( Skill skill ) @@ -2438,10 +2468,27 @@ namespace Server.Mobiles Mobile oath = Spells.Necromancy.BloodOathSpell.GetBloodOath( from ); + /* Per EA's UO Herald Pub48 (ML): + * ((resist spellsx10)/20 + 10=percentage of damage resisted) + */ + if ( oath == this ) { amount = (int)(amount * 1.1); - from.Damage( amount, from ); + + if( amount > 35 && from is PlayerMobile ) /* capped @ 35, seems no expansion */ + { + amount = 35; + } + + if( Core.ML ) + { + from.Damage( (int)(amount * ( 1 - ((( from.Skills.MagicResist.Value * .5 ) + 10) / 100 ))), this ); + } + else + { + from.Damage( amount, this ); + } } base.Damage( amount, from ); @@ -2836,7 +2883,6 @@ namespace Server.Mobiles CheckAtrophies( this ); - if( Hidden ) //Hiding is the only buff where it has an effect that's serialized. AddBuff( new BuffInfo( BuffIcon.HidingAndOrStealth, 1075655 ) ); } diff --git a/Scripts/Mobiles/Vendors/BaseVendor.cs b/Scripts/Mobiles/Vendors/BaseVendor.cs index ccf96ee94..af423f9c9 100644 --- a/Scripts/Mobiles/Vendors/BaseVendor.cs +++ b/Scripts/Mobiles/Vendors/BaseVendor.cs @@ -740,8 +740,19 @@ namespace Server.Mobiles public override bool OnDragDrop( Mobile from, Item dropped ) { + /* TODO: Thou art giving me? and fame/karma for gold gifts */ + if ( dropped is SmallBOD || dropped is LargeBOD ) { + if( Core.ML ) + { + if( ((PlayerMobile)from).NextBODTurnInTime > DateTime.Now ) + { + SayTo( from, 1079976 ); // + return false; + } + } + if ( !IsValidBulkOrder( dropped ) || !SupportsBulkOrders( from ) ) { SayTo( from, 1045130 ); // That order is for some other shopkeeper. @@ -777,6 +788,11 @@ namespace Server.Mobiles OnSuccessfulBulkOrderReceive( from ); + if( Core.ML ) + { + ((PlayerMobile)from).NextBODTurnInTime = DateTime.Now + TimeSpan.FromSeconds( 10.0 ); + } + dropped.Delete(); return true; } diff --git a/Scripts/Skills/Snooping.cs b/Scripts/Skills/Snooping.cs index c335d42fa..7de7d889a 100644 --- a/Scripts/Skills/Snooping.cs +++ b/Scripts/Skills/Snooping.cs @@ -92,6 +92,9 @@ namespace Server.SkillHandlers else { from.SendLocalizedMessage( 500210 ); // You failed to peek into the container. + + if ( from.Skills[SkillName.Hiding].Value / 2 < Utility.Random( 100 ) ) + from.RevealingAction(); } } else diff --git a/Scripts/Spells/Bushido/LightningStrike.cs b/Scripts/Spells/Bushido/LightningStrike.cs index 8c64ed384..50662e982 100644 --- a/Scripts/Spells/Bushido/LightningStrike.cs +++ b/Scripts/Spells/Bushido/LightningStrike.cs @@ -66,12 +66,6 @@ namespace Server.Spells.Bushido } } - public override void OnMiss( Mobile attacker, Mobile defender ) - { - ClearCurrentMove( attacker ); - SetContext( attacker ); - } - public override void OnClearMove( Mobile attacker ) { PlayerMobile ThePlayer = attacker as PlayerMobile; // this can be deletet if the PlayerMobile parts are moved to Server.Mobile diff --git a/Scripts/Spells/Chivalry/DispelEvil.cs b/Scripts/Spells/Chivalry/DispelEvil.cs index f2e01a2a5..abb7bb02d 100644 --- a/Scripts/Spells/Chivalry/DispelEvil.cs +++ b/Scripts/Spells/Chivalry/DispelEvil.cs @@ -46,7 +46,8 @@ namespace Server.Spells.Chivalry if ( Caster != m && SpellHelper.ValidIndirectTarget( Caster, m ) && Caster.CanBeHarmful( m, false ) ) targets.Add( m ); } - + + Caster.PlaySound( 0xF5 ); Caster.PlaySound( 0x299 ); Caster.FixedParticles( 0x37C4, 1, 25, 9922, 14, 3, EffectLayer.Head ); diff --git a/Scripts/Spells/Chivalry/NobleSacrifice.cs b/Scripts/Spells/Chivalry/NobleSacrifice.cs index cb6332787..6bd8c35d1 100644 --- a/Scripts/Spells/Chivalry/NobleSacrifice.cs +++ b/Scripts/Spells/Chivalry/NobleSacrifice.cs @@ -161,7 +161,7 @@ namespace Server.Spells.Chivalry if ( sacrifice ) { - Caster.PlaySound( 0x423 ); + Caster.PlaySound( Caster.Body.IsFemale ? 0x150 : 0x423 ); Caster.Hits = 1; Caster.Stam = 1; Caster.Mana = 1; diff --git a/Scripts/Spells/Chivalry/SacredJourney.cs b/Scripts/Spells/Chivalry/SacredJourney.cs index 4c5f23fee..2898f3281 100644 --- a/Scripts/Spells/Chivalry/SacredJourney.cs +++ b/Scripts/Spells/Chivalry/SacredJourney.cs @@ -131,7 +131,9 @@ namespace Server.Spells.Chivalry Effects.SendLocationParticles( EffectItem.Create( Caster.Location, Caster.Map, EffectItem.DefaultDuration ), 0, 0, 0, 5033 ); + Caster.PlaySound( 0x1FC ); Caster.MoveToWorld( loc, map ); + Caster.PlaySound( 0x1FC ); } FinishSequence(); diff --git a/Scripts/Spells/Eighth/Earthquake.cs b/Scripts/Spells/Eighth/Earthquake.cs index d00a7c930..72f2f6a56 100644 --- a/Scripts/Spells/Eighth/Earthquake.cs +++ b/Scripts/Spells/Eighth/Earthquake.cs @@ -40,7 +40,7 @@ namespace Server.Spells.Eighth if ( Caster != m && SpellHelper.ValidIndirectTarget( Caster, m ) && Caster.CanBeHarmful( m, false ) && (!Core.AOS || Caster.InLOS( m )) ) targets.Add( m ); - Caster.PlaySound( 0x2F3 ); + Caster.PlaySound( 0x220 ); for ( int i = 0; i < targets.Count; ++i ) { diff --git a/Scripts/Spells/First/MagicArrow.cs b/Scripts/Spells/First/MagicArrow.cs index 61809e51c..48f99b5eb 100644 --- a/Scripts/Spells/First/MagicArrow.cs +++ b/Scripts/Spells/First/MagicArrow.cs @@ -62,7 +62,7 @@ namespace Server.Spells.First damage *= GetDamageScalar( m ); } - source.MovingParticles( m, 0x36E4, 5, 0, false, true, 3006, 4006, 0 ); + source.MovingParticles( m, 0x36E4, 5, 0, false, false, 3006, 0, 0 ); source.PlaySound( 0x1E5 ); SpellHelper.Damage( this, m, damage, 0, 100, 0, 0, 0 ); diff --git a/Scripts/Spells/Fourth/Curse.cs b/Scripts/Spells/Fourth/Curse.cs index df4fcc479..2caf53853 100644 --- a/Scripts/Spells/Fourth/Curse.cs +++ b/Scripts/Spells/Fourth/Curse.cs @@ -74,7 +74,7 @@ namespace Server.Spells.Fourth m.Paralyzed = false; m.FixedParticles( 0x374A, 10, 15, 5028, EffectLayer.Waist ); - m.PlaySound( 0x1EA ); + m.PlaySound( 0x1E1 ); int percentage = (int)(SpellHelper.GetOffsetScalar(Caster, m, true) * 100); TimeSpan length = SpellHelper.GetDuration(Caster, m); diff --git a/Scripts/Spells/Necromancy/BloodOathSpell.cs b/Scripts/Spells/Necromancy/BloodOathSpell.cs index 0496a2ba5..f94034bab 100644 --- a/Scripts/Spells/Necromancy/BloodOathSpell.cs +++ b/Scripts/Spells/Necromancy/BloodOathSpell.cs @@ -65,6 +65,9 @@ namespace Server.Spells.Necromancy m_OathTable[Caster] = Caster; m_OathTable[m] = Caster; + if ( m.Spell != null ) + m.Spell.OnCasterHurt(); + Caster.PlaySound( 0x175 ); Caster.FixedParticles( 0x375A, 1, 17, 9919, 33, 7, EffectLayer.Waist ); diff --git a/Scripts/Spells/Necromancy/CorpseSkin.cs b/Scripts/Spells/Necromancy/CorpseSkin.cs index cedbabee2..bd5038d2a 100644 --- a/Scripts/Spells/Necromancy/CorpseSkin.cs +++ b/Scripts/Spells/Necromancy/CorpseSkin.cs @@ -55,6 +55,9 @@ namespace Server.Spells.Necromancy else m.SendLocalizedMessage( 1061689 ); // Your skin turns dry and corpselike. + if ( m.Spell != null ) + m.Spell.OnCasterHurt(); + m.FixedParticles( 0x373A, 1, 15, 9913, 67, 7, EffectLayer.Head ); m.PlaySound( 0x1BB ); diff --git a/Scripts/Spells/Necromancy/EvilOmen.cs b/Scripts/Spells/Necromancy/EvilOmen.cs index 4b7bec0f4..cd1acfe91 100644 --- a/Scripts/Spells/Necromancy/EvilOmen.cs +++ b/Scripts/Spells/Necromancy/EvilOmen.cs @@ -49,6 +49,9 @@ namespace Server.Spells.Necromancy * The effect lasts for one harmful event only. */ + if ( m.Spell != null ) + m.Spell.OnCasterHurt(); + m.PlaySound( 0xFC ); m.FixedParticles( 0x3728, 1, 13, 9912, 1150, 7, EffectLayer.Head ); m.FixedParticles( 0x3779, 1, 15, 9502, 67, 7, EffectLayer.Head ); diff --git a/Scripts/Spells/Necromancy/MindRot.cs b/Scripts/Spells/Necromancy/MindRot.cs index b9224fa70..b2ada7a94 100644 --- a/Scripts/Spells/Necromancy/MindRot.cs +++ b/Scripts/Spells/Necromancy/MindRot.cs @@ -46,6 +46,9 @@ namespace Server.Spells.Necromancy * The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 50 ) + 20 seconds. */ + if ( m.Spell != null ) + m.Spell.OnCasterHurt(); + m.PlaySound( 0x1FB ); m.PlaySound( 0x258 ); m.FixedParticles( 0x373A, 1, 17, 9903, 15, 4, EffectLayer.Head ); diff --git a/Scripts/Spells/Necromancy/Strangle.cs b/Scripts/Spells/Necromancy/Strangle.cs index 52aebdadc..29cb41666 100644 --- a/Scripts/Spells/Necromancy/Strangle.cs +++ b/Scripts/Spells/Necromancy/Strangle.cs @@ -52,6 +52,9 @@ namespace Server.Spells.Necromancy * for a target at 20% Stamina the damage multiplier is 2.6 */ + if ( m.Spell != null ) + m.Spell.OnCasterHurt(); + m.PlaySound( 0x22F ); m.FixedParticles( 0x36CB, 1, 9, 9911, 67, 5, EffectLayer.Head ); m.FixedParticles( 0x374A, 1, 17, 9502, 1108, 4, (EffectLayer)255 ); diff --git a/Scripts/Spells/Second/Agility.cs b/Scripts/Spells/Second/Agility.cs index 7673c8d25..72710f181 100644 --- a/Scripts/Spells/Second/Agility.cs +++ b/Scripts/Spells/Second/Agility.cs @@ -38,7 +38,7 @@ namespace Server.Spells.Second SpellHelper.AddStatBonus( Caster, m, StatType.Dex ); m.FixedParticles( 0x375A, 10, 15, 5010, EffectLayer.Waist ); - m.PlaySound( 0x28E ); + m.PlaySound( 0x1e7 ); int percentage = (int)(SpellHelper.GetOffsetScalar( Caster, m, false )*100); TimeSpan length = SpellHelper.GetDuration( Caster, m ); diff --git a/Scripts/Spells/Seventh/ChainLightning.cs b/Scripts/Spells/Seventh/ChainLightning.cs index e0f8e7738..aef6d332f 100644 --- a/Scripts/Spells/Seventh/ChainLightning.cs +++ b/Scripts/Spells/Seventh/ChainLightning.cs @@ -102,12 +102,16 @@ namespace Server.Spells.Seventh m.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy. } - Caster.DoHarmful( m ); - SpellHelper.Damage( this, m, toDeal, 0, 0, 0, 0, 100 ); + Caster.DoHarmful( m ); + SpellHelper.Damage( this, m, toDeal, 0, 0, 0, 0, 100 ); - m.BoltEffect( 0 ); + m.BoltEffect( 0 ); } } + else + { + Caster.PlaySound ( 0x29 ); + } } FinishSequence(); diff --git a/Scripts/Spells/Third/Poison.cs b/Scripts/Spells/Third/Poison.cs index fe8e6afe0..cc4415cfa 100644 --- a/Scripts/Spells/Third/Poison.cs +++ b/Scripts/Spells/Third/Poison.cs @@ -92,7 +92,7 @@ namespace Server.Spells.Third } m.FixedParticles( 0x374A, 10, 15, 5021, EffectLayer.Waist ); - m.PlaySound( 0x474 ); + m.PlaySound( 0x205 ); } FinishSequence();