From 754877f880d6448b5cfb6449c9444738ff2d5d73 Mon Sep 17 00:00:00 2001 From: mark Date: Sat, 3 Nov 2012 21:37:59 +0000 Subject: [PATCH] --- Scripts/Engines/CannedEvil/ChampionSpawn.cs | 2 +- Scripts/Gumps/{honorself.cs => HonorSelf.cs} | 0 Scripts/Items/Weapons/BaseWeapon.cs | 69 +++++++++----------- Scripts/Misc/LootPack.cs | 2 +- Scripts/Mobiles/Animals/Mounts/Ethereals.cs | 12 +++- Scripts/Mobiles/Monsters/AOS/DemonKnight.cs | 2 +- Scripts/Mobiles/Special/BaseChampion.cs | 2 +- Scripts/Mobiles/Special/Harrower.cs | 2 +- Scripts/Mobiles/Special/Neira.cs | 2 +- Scripts/Spells/Base/Spell.cs | 27 ++++++-- Scripts/Spells/Base/SpellHelper.cs | 4 +- Scripts/Spells/Fifth/MindBlast.cs | 2 +- 12 files changed, 70 insertions(+), 56 deletions(-) rename Scripts/Gumps/{honorself.cs => HonorSelf.cs} (100%) diff --git a/Scripts/Engines/CannedEvil/ChampionSpawn.cs b/Scripts/Engines/CannedEvil/ChampionSpawn.cs index 45963e2a4..6818a29c9 100644 --- a/Scripts/Engines/CannedEvil/ChampionSpawn.cs +++ b/Scripts/Engines/CannedEvil/ChampionSpawn.cs @@ -386,7 +386,7 @@ namespace Server.Engines.CannedEvil case 4: Type = ChampionSpawnType.Arachnid; break; } } - + m_HasBeenAdvanced = false; Start(); diff --git a/Scripts/Gumps/honorself.cs b/Scripts/Gumps/HonorSelf.cs similarity index 100% rename from Scripts/Gumps/honorself.cs rename to Scripts/Gumps/HonorSelf.cs diff --git a/Scripts/Items/Weapons/BaseWeapon.cs b/Scripts/Items/Weapons/BaseWeapon.cs index dfa2bbada..6312cfec5 100644 --- a/Scripts/Items/Weapons/BaseWeapon.cs +++ b/Scripts/Items/Weapons/BaseWeapon.cs @@ -2113,7 +2113,22 @@ namespace Server.Items GetBaseDamageRange( attacker, out min, out max ); - return Utility.RandomMinMax( min, max ); + int damage = Utility.RandomMinMax( min, max ); + + if ( Core.AOS ) return damage; + + /* Apply damage level offset + * : Regular : 0 + * : Ruin : 1 + * : Might : 3 + * : Force : 5 + * : Power : 7 + * : Vanq : 9 + */ + if ( m_DamageLevel != WeaponDamageLevel.Regular ) + damage += (2 * (int)m_DamageLevel) - 1; + + return damage; } public virtual double GetBonus( double value, double scalar, double threshold, double offset ) @@ -2269,72 +2284,48 @@ namespace Server.Items * : 50.0 = unchanged * : 100.0 = 50% bonus */ - double tacticsBonus = (attacker.Skills[SkillName.Tactics].Value - 50.0) / 100.0; + damage += ( damage * ( ( attacker.Skills[SkillName.Tactics].Value - 50.0 ) / 100.0 ) ); + /* Compute strength modifier * : 1% bonus for every 5 strength */ - double strBonus = (attacker.Str / 5.0) / 100.0; + double modifiers = ( attacker.Str / 5.0 ) / 100.0; /* Compute anatomy modifier * : 1% bonus for every 5 points of anatomy * : +10% bonus at Grandmaster or higher */ double anatomyValue = attacker.Skills[SkillName.Anatomy].Value; - double anatomyBonus = (anatomyValue / 5.0) / 100.0; + modifiers += ( ( anatomyValue / 5.0 ) / 100.0 ); if ( anatomyValue >= 100.0 ) - anatomyBonus += 0.1; + modifiers += 0.1; /* Compute lumberjacking bonus * : 1% bonus for every 5 points of lumberjacking * : +10% bonus at Grandmaster or higher */ - double lumberBonus; - if ( Type == WeaponType.Axe ) { double lumberValue = attacker.Skills[SkillName.Lumberjacking].Value; - lumberBonus = (lumberValue / 5.0) / 100.0; + modifiers += ( ( lumberValue / 5.0 ) / 100.0 ); if ( lumberValue >= 100.0 ) - lumberBonus += 0.1; - } - else - { - lumberBonus = 0.0; + modifiers += 0.1; } // New quality bonus: - double qualityBonus = ((int)m_Quality - 1) * 0.2; + if ( m_Quality != WeaponQuality.Regular ) + modifiers += ( ( (int)m_Quality - 1 ) * 0.2 ); + + // Virtual damage bonus: + if ( VirtualDamageBonus != 0 ) + modifiers += ( VirtualDamageBonus / 100.0 ); // Apply bonuses - damage += (damage * tacticsBonus) + (damage * strBonus) + (damage * anatomyBonus) + (damage * lumberBonus) + (damage * qualityBonus) + ((damage * VirtualDamageBonus) / 100); - - // Old quality bonus: -#if false - /* Apply quality offset - * : Low : -4 - * : Regular : 0 - * : Exceptional : +4 - */ - damage += ((int)m_Quality - 1) * 4.0; -#endif - - /* Apply damage level offset - * : Regular : 0 - * : Ruin : 1 - * : Might : 3 - * : Force : 5 - * : Power : 7 - * : Vanq : 9 - */ - if ( m_DamageLevel != WeaponDamageLevel.Regular ) - damage += (2.0 * (int)m_DamageLevel) - 1.0; - - // Halve the computed damage and return - damage /= 2.0; + damage += ( damage * modifiers ); return ScaleDamageByDurability( (int)damage ); } diff --git a/Scripts/Misc/LootPack.cs b/Scripts/Misc/LootPack.cs index ea3f8783c..29b7a8dd0 100644 --- a/Scripts/Misc/LootPack.cs +++ b/Scripts/Misc/LootPack.cs @@ -1,9 +1,9 @@ using System; using System.Collections; +using System.Collections.Generic; using Server; using Server.Items; using Server.Mobiles; -using System.Collections.Generic; namespace Server { diff --git a/Scripts/Mobiles/Animals/Mounts/Ethereals.cs b/Scripts/Mobiles/Animals/Mounts/Ethereals.cs index bba696b1f..6d0bc1eaa 100644 --- a/Scripts/Mobiles/Animals/Mounts/Ethereals.cs +++ b/Scripts/Mobiles/Animals/Mounts/Ethereals.cs @@ -128,7 +128,7 @@ namespace Server.Mobiles from.SayTo( from, 1010095 ); // This must be on your person to use. return false; } - else if( m_IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy( from, this, null ) ) + else if( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) ) { // CheckIsUsableBy sends the message return false; @@ -173,6 +173,16 @@ namespace Server.Mobiles new EtherealSpell( this, from ).Cast(); } + public override void OnSingleClick( Mobile from ) + { + base.OnSingleClick( from ); + + if ( m_IsDonationItem ) + LabelTo( from, "Donation Ethereal" ); + else + LabelTo( from, "Veteran Reward" ); + } + public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); diff --git a/Scripts/Mobiles/Monsters/AOS/DemonKnight.cs b/Scripts/Mobiles/Monsters/AOS/DemonKnight.cs index 3fe5aea13..73e769608 100644 --- a/Scripts/Mobiles/Monsters/AOS/DemonKnight.cs +++ b/Scripts/Mobiles/Monsters/AOS/DemonKnight.cs @@ -1,8 +1,8 @@ using System; using System.Collections; +using System.Collections.Generic; using Server; using Server.Items; -using System.Collections.Generic; namespace Server.Mobiles { diff --git a/Scripts/Mobiles/Special/BaseChampion.cs b/Scripts/Mobiles/Special/BaseChampion.cs index 86568536e..e36970ad6 100644 --- a/Scripts/Mobiles/Special/BaseChampion.cs +++ b/Scripts/Mobiles/Special/BaseChampion.cs @@ -1,9 +1,9 @@ using System; using System.Collections; +using System.Collections.Generic; using Server; using Server.Items; using Server.Engines.CannedEvil; -using System.Collections.Generic; namespace Server.Mobiles { diff --git a/Scripts/Mobiles/Special/Harrower.cs b/Scripts/Mobiles/Special/Harrower.cs index 9292432be..924beddbb 100644 --- a/Scripts/Mobiles/Special/Harrower.cs +++ b/Scripts/Mobiles/Special/Harrower.cs @@ -1,9 +1,9 @@ using System; using System.Collections; +using System.Collections.Generic; using Server; using Server.Items; using Server.Engines.CannedEvil; -using System.Collections.Generic; namespace Server.Mobiles { diff --git a/Scripts/Mobiles/Special/Neira.cs b/Scripts/Mobiles/Special/Neira.cs index f9d77dbbc..e08d8f58e 100644 --- a/Scripts/Mobiles/Special/Neira.cs +++ b/Scripts/Mobiles/Special/Neira.cs @@ -208,7 +208,7 @@ namespace Server.Mobiles if ( 0.1 >= Utility.RandomDouble() ) // 10% chance to drop or throw an unholy bone AddUnholyBone( defender, 0.25 ); - + CheckSpeedBoost(); } diff --git a/Scripts/Spells/Base/Spell.cs b/Scripts/Spells/Base/Spell.cs index 6203529b1..63d14aa8b 100644 --- a/Scripts/Spells/Base/Spell.cs +++ b/Scripts/Spells/Base/Spell.cs @@ -412,7 +412,7 @@ namespace Server.Spells if ( m_State == SpellState.Casting ) { - if( !firstCircle && !Core.AOS && this is MagerySpell && ((MagerySpell)this).Circle == SpellCircle.First ) + if( !firstCircle && !Core.AOS && this is MagerySpell && ((MagerySpell)this).Circle == SpellCircle.First ) return; m_State = SpellState.None; @@ -433,7 +433,7 @@ namespace Server.Spells } else if ( m_State == SpellState.Sequencing ) { - if( !firstCircle && !Core.AOS && this is MagerySpell && ((MagerySpell)this).Circle == SpellCircle.First ) + if( !firstCircle && !Core.AOS && this is MagerySpell && ((MagerySpell)this).Circle == SpellCircle.First ) return; m_State = SpellState.None; @@ -558,10 +558,16 @@ namespace Server.Spells WeaponAbility.ClearCurrentAbility( m_Caster ); m_CastTimer = new CastTimer( this, castDelay ); - m_CastTimer.Start(); + //m_CastTimer.Start(); OnBeginCast(); + if ( castDelay > TimeSpan.Zero ) { + m_CastTimer.Start(); + } else { + m_CastTimer.Tick(); + } + return true; } else @@ -659,8 +665,6 @@ namespace Server.Spells return TimeSpan.FromSeconds( (double)delay / CastRecoveryPerSecond ); } - - public abstract TimeSpan CastDelayBase { get; } public virtual double CastDelayFastScalar { get { return 1; } } @@ -898,12 +902,17 @@ namespace Server.Spells protected override void OnTick() { - if ( m_Spell.m_State == SpellState.Casting && m_Spell.m_Caster.Spell == m_Spell ) + if ( m_Spell == null || m_Spell.m_Caster == null ) + { + return; + } + else if ( m_Spell.m_State == SpellState.Casting && m_Spell.m_Caster.Spell == m_Spell ) { m_Spell.m_State = SpellState.Sequencing; m_Spell.m_CastTimer = null; m_Spell.m_Caster.OnSpellCast( m_Spell ); - m_Spell.m_Caster.Region.OnSpellCast( m_Spell.m_Caster, m_Spell ); + if ( m_Spell.m_Caster.Region != null ) + m_Spell.m_Caster.Region.OnSpellCast( m_Spell.m_Caster, m_Spell ); m_Spell.m_Caster.NextSpellTime = DateTime.Now + m_Spell.GetCastRecovery();// Spell.NextSpellDelay; Target originalTarget = m_Spell.m_Caster.Target; @@ -916,6 +925,10 @@ namespace Server.Spells m_Spell.m_CastTimer = null; } } + + public void Tick() { + OnTick(); + } } } } \ No newline at end of file diff --git a/Scripts/Spells/Base/SpellHelper.cs b/Scripts/Spells/Base/SpellHelper.cs index 98782c635..556f8685b 100644 --- a/Scripts/Spells/Base/SpellHelper.cs +++ b/Scripts/Spells/Base/SpellHelper.cs @@ -104,7 +104,7 @@ namespace Server.Spells return true; } } - + return false; } @@ -176,7 +176,7 @@ namespace Server.Spells return false; } - + public static bool CanRevealCaster( Mobile m ) { if ( m is BaseCreature ) diff --git a/Scripts/Spells/Fifth/MindBlast.cs b/Scripts/Spells/Fifth/MindBlast.cs index c611114e5..5a2a19ea5 100644 --- a/Scripts/Spells/Fifth/MindBlast.cs +++ b/Scripts/Spells/Fifth/MindBlast.cs @@ -65,7 +65,7 @@ namespace Server.Spells.Fifth SpellHelper.CheckReflect( (int)this.Circle, ref from, ref target ); int damage = (int)((Caster.Skills[SkillName.Magery].Value + Caster.Int) / 5); - + if ( damage > 60 ) damage = 60;