From 2a9b547f7b7d84e5f99757b713f4a56c11fefe3d Mon Sep 17 00:00:00 2001 From: "mark@runuo.com" Date: Wed, 4 Sep 2013 23:07:39 +0000 Subject: [PATCH] just misc merge cleanups --- Scripts/Engines/CannedEvil/ChampionSpawn.cs | 2 +- Scripts/Engines/ConPVP/RulesetLayout.cs | 1 - .../Special/Holiday/Christmas/HolidayTree.cs | 2 +- .../Items/Weapons/Abilities/NerveStrike.cs | 32 +++++++++++-------- Scripts/Items/Weapons/BaseWeapon.cs | 21 +++++++----- Scripts/Items/Weapons/Maces/WarMace.cs | 2 +- Scripts/Mobiles/BaseCreature.cs | 9 ++++++ Scripts/Mobiles/Special/BaseChampion.cs | 3 ++ Scripts/Mobiles/Special/Paragon.cs | 3 +- Scripts/Mobiles/Vendors/GenericBuy.cs | 19 +++++++++-- Scripts/Multis/BaseHouse.cs | 2 +- Scripts/Spells/Ninjitsu/KiAttack.cs | 6 +++- Server/Main.cs | 5 ++- 13 files changed, 73 insertions(+), 34 deletions(-) diff --git a/Scripts/Engines/CannedEvil/ChampionSpawn.cs b/Scripts/Engines/CannedEvil/ChampionSpawn.cs index a674b92f8..04c4e0639 100644 --- a/Scripts/Engines/CannedEvil/ChampionSpawn.cs +++ b/Scripts/Engines/CannedEvil/ChampionSpawn.cs @@ -676,7 +676,7 @@ namespace Server.Engines.CannedEvil if( m == null ) return; - Point3D loc = GetSpawnLocation(); + Point3D loc = GetSpawnLocation(); // Allow creatures to turn into Paragons at Ilshenar champions. m.OnBeforeSpawn( loc, Map ); diff --git a/Scripts/Engines/ConPVP/RulesetLayout.cs b/Scripts/Engines/ConPVP/RulesetLayout.cs index 6e15b3eb4..e4c13f12c 100644 --- a/Scripts/Engines/ConPVP/RulesetLayout.cs +++ b/Scripts/Engines/ConPVP/RulesetLayout.cs @@ -344,7 +344,6 @@ namespace Server.Engines.ConPVP if( !Core.AOS ) { - #region Mage 5x Ruleset m5x = new Ruleset( m_Root ); diff --git a/Scripts/Items/Special/Holiday/Christmas/HolidayTree.cs b/Scripts/Items/Special/Holiday/Christmas/HolidayTree.cs index a4aea581a..d4b753574 100644 --- a/Scripts/Items/Special/Holiday/Christmas/HolidayTree.cs +++ b/Scripts/Items/Special/Holiday/Christmas/HolidayTree.cs @@ -265,7 +265,7 @@ namespace Server.Items } } - Timer.DelayCall( TimeSpan.Zero, ValidatePlacement ); + Timer.DelayCall( TimeSpan.Zero, ValidatePlacement ); } public void ValidatePlacement() diff --git a/Scripts/Items/Weapons/Abilities/NerveStrike.cs b/Scripts/Items/Weapons/Abilities/NerveStrike.cs index 64a079325..ed6d51714 100644 --- a/Scripts/Items/Weapons/Abilities/NerveStrike.cs +++ b/Scripts/Items/Weapons/Abilities/NerveStrike.cs @@ -43,34 +43,38 @@ namespace Server.Items ClearCurrentAbility( attacker ); - if( Server.Items.ParalyzingBlow.IsImmune( defender ) ) //After mana consumption intentional + bool cantpara = Server.Items.ParalyzingBlow.IsImmune(defender); + + if ( cantpara ) { - attacker.SendLocalizedMessage( 1070804 ); // Your target resists paralysis. - defender.SendLocalizedMessage( 1070813 ); // You resist paralysis. - return; + attacker.SendLocalizedMessage(1070804); // Your target resists paralysis. + defender.SendLocalizedMessage(1070813); // You resist paralysis. + } + else + { + attacker.SendLocalizedMessage(1063356); // You cripple your target with a nerve strike! + defender.SendLocalizedMessage(1063357); // Your attacker dealt a crippling nerve strike! } - attacker.SendLocalizedMessage( 1063356 ); // You cripple your target with a nerve strike! - defender.SendLocalizedMessage( 1063357 ); // Your attacker dealt a crippling nerve strike! - - attacker.PlaySound( 0x204 ); - defender.FixedEffect( 0x376A, 9, 32 ); - defender.FixedParticles( 0x37C4, 1, 8, 0x13AF, 0, 0, EffectLayer.Waist ); + attacker.PlaySound(0x204); + defender.FixedEffect(0x376A, 9, 32); + defender.FixedParticles(0x37C4, 1, 8, 0x13AF, 0, 0, EffectLayer.Waist); if ( Core.ML ) { AOS.Damage( defender, attacker, (int)( 15.0 * ( attacker.Skills[SkillName.Bushido].Value - 50.0 ) / 70.0 + Utility.Random( 10 ) ), true, 100, 0, 0, 0, 0 ); //0-25 - if ( ( ( 150.0 / 7.0 + ( 4.0 * attacker.Skills[SkillName.Bushido].Value ) / 7.0) / 100.0 ) > Utility.RandomDouble() ) + + if (!cantpara && ((150.0 / 7.0 + (4.0 * attacker.Skills[SkillName.Bushido].Value) / 7.0) / 100.0) > Utility.RandomDouble()) { defender.Paralyze( TimeSpan.FromSeconds( 2.0 ) ); Server.Items.ParalyzingBlow.BeginImmunity( defender, Server.Items.ParalyzingBlow.FreezeDelayDuration ); } } - else + else if( !cantpara ) { AOS.Damage( defender, attacker, (int)(15.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + 10), true, 100, 0, 0, 0, 0 ); //10-25 - defender.Freeze( TimeSpan.FromSeconds( 2.0 ) ); - Server.Items.ParalyzingBlow.BeginImmunity( defender, Server.Items.ParalyzingBlow.FreezeDelayDuration ); + 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 5f11ce2b1..6a7a36e2d 100644 --- a/Scripts/Items/Weapons/BaseWeapon.cs +++ b/Scripts/Items/Weapons/BaseWeapon.cs @@ -1910,7 +1910,9 @@ namespace Server.Items List list = new List(); - foreach ( Mobile m in from.GetMobilesInRange( 10 ) ) + int range = Core.ML ? 5 : 10; + + foreach ( Mobile m in from.GetMobilesInRange( range ) ) { if ( from != m && defender != m && SpellHelper.ValidIndirectTarget( from, m ) && from.CanBeHarmful( m, false ) && ( !Core.ML || from.InLOS( m ) ) ) list.Add( m ); @@ -1921,22 +1923,25 @@ namespace Server.Items Effects.PlaySound( from.Location, map, sound ); - // TODO: What is the damage calculation? - for ( int i = 0; i < list.Count; ++i ) { Mobile m = list[i]; - double scalar = (11 - from.GetDistanceToSqrt( m )) / 10; + double scalar = Core.ML ? 1.0 : ( 11 - from.GetDistanceToSqrt( m ) ) / 10; + double damage = GetBaseDamage( from ); - if ( scalar > 1.0 ) - scalar = 1.0; - else if ( scalar < 0.0 ) + if(scalar <= 0) + { continue; + } + else if( scalar < 1.0 ) + { + damage *= ( 11 - from.GetDistanceToSqrt( m ) ) / 10; + } from.DoHarmful( m, true ); m.FixedEffect( 0x3779, 1, 15, hue, 0 ); - AOS.Damage( m, from, (int)(GetBaseDamage( from ) * scalar), phys, fire, cold, pois, nrgy ); + AOS.Damage(m, from, (int)damage, phys, fire, cold, pois, nrgy); } } #endregion diff --git a/Scripts/Items/Weapons/Maces/WarMace.cs b/Scripts/Items/Weapons/Maces/WarMace.cs index 27ba4605e..876df1ecf 100644 --- a/Scripts/Items/Weapons/Maces/WarMace.cs +++ b/Scripts/Items/Weapons/Maces/WarMace.cs @@ -8,7 +8,7 @@ namespace Server.Items public class WarMace : BaseBashing { public override WeaponAbility PrimaryAbility{ get{ return WeaponAbility.CrushingBlow; } } - public override WeaponAbility SecondaryAbility{ get{ return WeaponAbility.BleedAttack; } } + public override WeaponAbility SecondaryAbility{ get{ return WeaponAbility.MortalStrike; } } public override int AosStrengthReq{ get{ return 80; } } public override int AosMinDamage{ get{ return 16; } } diff --git a/Scripts/Mobiles/BaseCreature.cs b/Scripts/Mobiles/BaseCreature.cs index 15756673f..8c3fe2063 100644 --- a/Scripts/Mobiles/BaseCreature.cs +++ b/Scripts/Mobiles/BaseCreature.cs @@ -3349,6 +3349,15 @@ namespace Server.Mobiles { if ( m is BaseCreature && !((BaseCreature)m).Controlled ) return ( !Alive || !m.Alive || IsDeadBondedPet || m.IsDeadBondedPet ) || ( Hidden && AccessLevel > AccessLevel.Player ); + #region Dueling + if ( Region.IsPartOf( typeof( Engines.ConPVP.SafeZone ) ) && m is PlayerMobile ) + { + PlayerMobile pm = (PlayerMobile) m; + + if ( pm.DuelContext == null || pm.DuelPlayer == null || !pm.DuelContext.Started || pm.DuelContext.Finished || pm.DuelPlayer.Eliminated ) + return true; + } + #endregion return base.OnMoveOver( m ); } diff --git a/Scripts/Mobiles/Special/BaseChampion.cs b/Scripts/Mobiles/Special/BaseChampion.cs index e36970ad6..4e42edeae 100644 --- a/Scripts/Mobiles/Special/BaseChampion.cs +++ b/Scripts/Mobiles/Special/BaseChampion.cs @@ -9,6 +9,9 @@ namespace Server.Mobiles { public abstract class BaseChampion : BaseCreature { + public override bool CanMoveOverObstacles { get { return true; } } + public override bool CanDestroyObstacles { get { return true; } } + public BaseChampion( AIType aiType ) : this( aiType, FightMode.Closest ) { } diff --git a/Scripts/Mobiles/Special/Paragon.cs b/Scripts/Mobiles/Special/Paragon.cs index 31608ac29..4f790e77f 100644 --- a/Scripts/Mobiles/Special/Paragon.cs +++ b/Scripts/Mobiles/Special/Paragon.cs @@ -127,12 +127,11 @@ namespace Server.Mobiles public static void UnConvert( BaseCreature bc ) { if( !bc.IsParagon ) - if( !bc.IsParagon ) return; bc.Hue = 0; - if ( bc.HitsMaxSeed >= 0 ) + if( bc.HitsMaxSeed >= 0 ) bc.HitsMaxSeed = (int)( bc.HitsMaxSeed / HitsBuff ); bc.RawStr = (int)( bc.RawStr / StrBuff ); diff --git a/Scripts/Mobiles/Vendors/GenericBuy.cs b/Scripts/Mobiles/Vendors/GenericBuy.cs index d46a3384f..e75eee80e 100644 --- a/Scripts/Mobiles/Vendors/GenericBuy.cs +++ b/Scripts/Mobiles/Vendors/GenericBuy.cs @@ -307,10 +307,23 @@ namespace Server.Mobiles { if ( m_Amount <= 0 ) { - m_MaxAmount *= 2; + /* + Core.ML using this vendor system is undefined behavior, so being + as it lends itself to an abusable exploit to cause ingame havok + and the stackable items are not found to be over 20 items, this is + changed until there is a better solution. + */ - if ( m_MaxAmount >= 999 ) - m_MaxAmount = 999; + object Obj_Disp = GetDisplayEntity(); + + if( Core.ML && Obj_Disp is Item && !( Obj_Disp as Item ).Stackable ) + { + m_MaxAmount = Math.Min( 20, m_MaxAmount ); + } + else + { + m_MaxAmount = Math.Min( 999, m_MaxAmount * 2 ); + } } else { diff --git a/Scripts/Multis/BaseHouse.cs b/Scripts/Multis/BaseHouse.cs index 505779348..cff6c18fb 100644 --- a/Scripts/Multis/BaseHouse.cs +++ b/Scripts/Multis/BaseHouse.cs @@ -2298,7 +2298,7 @@ namespace Server.Multis { from.SendLocalizedMessage( 501362 ); // That can't be a co-owner of the house. } - else if ( HasAccountHouse( targ ) ) + else if ( !Core.AOS && HasAccountHouse( targ ) ) { from.SendLocalizedMessage( 501364 ); // That person is already a house owner. } diff --git a/Scripts/Spells/Ninjitsu/KiAttack.cs b/Scripts/Spells/Ninjitsu/KiAttack.cs index d4e64b64e..89ab1303d 100644 --- a/Scripts/Spells/Ninjitsu/KiAttack.cs +++ b/Scripts/Spells/Ninjitsu/KiAttack.cs @@ -57,7 +57,11 @@ namespace Server.Spells.Ninjitsu if ( attacker.Hidden ) return 1.0; - return 1.0 + GetBonus( attacker ) / 10; + /* + * Pub40 changed pvp damage max to 55% + */ + + return 1.0 + GetBonus(attacker) / ( (Core.ML && attacker.Player && defender.Player) ? 40 : 10 ); } public override void OnHit( Mobile attacker, Mobile defender, int damage ) diff --git a/Server/Main.cs b/Server/Main.cs index 07739804e..6a3874db2 100644 --- a/Server/Main.cs +++ b/Server/Main.cs @@ -507,11 +507,14 @@ namespace Server const int sampleInterval = 100; const float ticksPerSecond = (float)(TimeSpan.TicksPerSecond * sampleInterval); + TimeSpan _oneMS = TimeSpan.FromMilliseconds( 1 ); long sample = 0; - while( m_Signal.WaitOne() ) + while( !m_Closing ) { + m_Signal.WaitOne( _oneMS ); + Mobile.ProcessDeltaQueue(); Item.ProcessDeltaQueue();