Modernization Fixes & Updates to Default Values (#3)

This commit is contained in:
Kamron Batman 2018-10-28 00:33:16 -07:00 • committed by GitHub
parent 445eddff68
commit dcf64091b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
768 changed files with 10507 additions and 14196 deletions

View file

@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Mobiles;
using Server.Network;
using Server.Spells;
@ -14,7 +15,7 @@ namespace Server.Items
/// </summary>
public class BleedAttack : WeaponAbility
{
private static Hashtable m_Table = new Hashtable();
private static Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
public override int BaseMana => 30;
@ -53,17 +54,15 @@ namespace Server.Items
public static bool IsBleeding(Mobile m)
{
return m_Table.Contains(m);
return m_Table.ContainsKey(m);
}
public static void BeginBleed(Mobile m, Mobile from)
{
Timer t = (Timer)m_Table[m];
Timer t = m_Table[m];
t?.Stop();
t = new InternalTimer(from, m);
m_Table[m] = t;
m_Table[m] = t = new InternalTimer(from, m);
t.Start();
}
@ -80,10 +79,7 @@ namespace Server.Items
m.PlaySound(0x133);
m.Damage(damage, from);
Blood blood = new Blood();
blood.ItemID = Utility.Random(0x122A, 5);
Blood blood = new Blood { ItemID = Utility.Random(0x122A, 5) };
blood.MoveToWorld(m.Location, m.Map);
}
else
@ -94,7 +90,7 @@ namespace Server.Items
public static void EndBleed(Mobile m, bool message)
{
Timer t = (Timer)m_Table[m];
Timer t = m_Table[m];
if (t == null)
return;
@ -128,4 +124,4 @@ namespace Server.Items
}
}
}
}
}

View file

@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
namespace Server.Items
{
@ -8,7 +9,7 @@ namespace Server.Items
/// </summary>
public class Block : WeaponAbility
{
private static Hashtable m_Table = new Hashtable();
private static Dictionary<Mobile, BlockInfo> m_Table = new Dictionary<Mobile, BlockInfo>();
public override int BaseMana => 30;
@ -36,15 +37,16 @@ namespace Server.Items
attacker.FixedParticles(0x37C4, 1, 16, 0x251D, 0x39D, 0x3, EffectLayer.RightHand);
int bonus = (int)(10.0 * ((Math.Max(attacker.Skills[SkillName.Bushido].Value,
attacker.Skills[SkillName.Ninjitsu].Value) - 50.0) / 70.0 + 5));
int bonus = (int)(10.0 * ((Math.Max(attacker.Skills.Bushido.Value,
attacker.Skills.Ninjitsu.Value) - 50.0) / 70.0 + 5));
BeginBlock(attacker, bonus);
}
public static bool GetBonus(Mobile targ, ref int bonus)
{
if (!(m_Table[targ] is BlockInfo info))
BlockInfo info = m_Table[targ];
if (info == null)
return false;
bonus = info.m_Bonus;
@ -54,33 +56,29 @@ namespace Server.Items
public static void BeginBlock(Mobile m, int bonus)
{
EndBlock(m);
BlockInfo info = new BlockInfo(m, bonus);
info.m_Timer = new InternalTimer(m);
m_Table[m] = info;
m_Table[m] = new BlockInfo(m, bonus);
}
public static void EndBlock(Mobile m)
{
if (m_Table[m] is BlockInfo info)
{
info.m_Timer?.Stop();
BlockInfo info = m_Table[m];
m_Table.Remove(m);
}
if (info == null)
return;
info.m_Timer?.Stop();
m_Table.Remove(m);
}
private class BlockInfo
{
public int m_Bonus;
public Mobile m_Target;
public Timer m_Timer;
public BlockInfo(Mobile target, int bonus)
{
m_Target = target;
m_Bonus = bonus;
m_Timer = new InternalTimer(target);
}
}
@ -100,4 +98,4 @@ namespace Server.Items
}
}
}
}
}

View file

@ -1,5 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
namespace Server.Items
{
@ -9,7 +9,7 @@ namespace Server.Items
/// </summary>
public class DefenseMastery : WeaponAbility
{
private static Hashtable m_Table = new Hashtable();
private static Dictionary<Mobile, DefenseMasteryInfo> m_Table = new Dictionary<Mobile, DefenseMasteryInfo>();
public override int BaseMana => 30;
@ -38,17 +38,19 @@ namespace Server.Items
int modifier =
(int)(30.0 *
((Math.Max(attacker.Skills[SkillName.Bushido].Value, attacker.Skills[SkillName.Ninjitsu].Value) -
((Math.Max(attacker.Skills.Bushido.Value, attacker.Skills.Ninjitsu.Value) -
50.0) / 70.0));
if (m_Table[attacker] is DefenseMasteryInfo info)
DefenseMasteryInfo info = m_Table[attacker];
if (info != null)
EndDefense(info);
ResistanceMod mod = new ResistanceMod(ResistanceType.Physical, 50 + modifier);
attacker.AddResistanceMod(mod);
info = new DefenseMasteryInfo(attacker, 80 - modifier, mod);
info.m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(3.0), new TimerStateCallback(EndDefense), info);
info.m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(3.0), EndDefense, info);
m_Table[attacker] = info;
@ -57,17 +59,17 @@ namespace Server.Items
public static bool GetMalus(Mobile targ, ref int damageMalus)
{
if (!(m_Table[targ] is DefenseMasteryInfo info))
DefenseMasteryInfo info = m_Table[targ];
if (info == null)
return false;
damageMalus = info.m_DamageMalus;
return true;
}
private static void EndDefense(object state)
private static void EndDefense(DefenseMasteryInfo info)
{
DefenseMasteryInfo info = (DefenseMasteryInfo)state;
if (info.m_Mod != null)
info.m_From.RemoveResistanceMod(info.m_Mod);
@ -95,4 +97,4 @@ namespace Server.Items
}
}
}
}
}

View file

@ -21,7 +21,7 @@ namespace Server.Items
if ( !(from.Weapon is Fists) )
return true;
Skill skill = from.Skills[SkillName.ArmsLore];
Skill skill = from.Skills.ArmsLore;
if ( skill != null && skill.Base >= 80.0 )
return true;

View file

@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
namespace Server.Items
{
@ -8,7 +9,7 @@ namespace Server.Items
/// </summary>
public class DualWield : WeaponAbility
{
public static Hashtable Registry{ get; } = new Hashtable();
public static Dictionary<Mobile, DualWieldTimer> Registry{ get; } = new Dictionary<Mobile, DualWieldTimer>();
public override int BaseMana => 30;
@ -29,24 +30,23 @@ namespace Server.Items
if (!Validate(attacker) || !CheckMana(attacker, true))
return;
if (Registry.Contains(attacker))
DualWieldTimer timer = Registry[attacker];
if (timer != null)
{
DualWieldTimer existingtimer = (DualWieldTimer)Registry[attacker];
existingtimer.Stop();
timer.Stop();
Registry.Remove(attacker);
}
ClearCurrentAbility(attacker);
attacker.SendLocalizedMessage(1063362); // You dually wield for increased speed!
attacker.FixedParticles(0x3779, 1, 15, 0x7F6, 0x3E8, 3, EffectLayer.LeftHand);
Timer t = new DualWieldTimer(attacker,
(int)(20.0 + 3.0 * (attacker.Skills[SkillName.Ninjitsu].Value - 50.0) / 7.0)); //20-50 % increase
timer = new DualWieldTimer(attacker,
(int)(20.0 + 3.0 * (attacker.Skills.Ninjitsu.Value - 50.0) / 7.0)); //20-50 % increase
t.Start();
Registry.Add(attacker, t);
timer.Start();
Registry.Add(attacker, timer);
}
public class DualWieldTimer : Timer
@ -69,4 +69,4 @@ namespace Server.Items
}
}
}
}
}

View file

@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
namespace Server.Items
{
@ -8,7 +9,7 @@ namespace Server.Items
/// </summary>
public class Feint : WeaponAbility
{
public static Hashtable Registry{ get; } = new Hashtable();
public static Dictionary<Mobile, FeintTimer> Registry{ get; } = new Dictionary<Mobile, FeintTimer>();
public override int BaseMana => 30;
@ -29,10 +30,10 @@ namespace Server.Items
if (!Validate(attacker) || !CheckMana(attacker, true))
return;
if (Registry.Contains(defender))
FeintTimer timer = Registry[defender];
if (timer != null)
{
FeintTimer existingtimer = (FeintTimer)Registry[defender];
existingtimer.Stop();
timer.Stop();
Registry.Remove(defender);
}
@ -43,12 +44,12 @@ namespace Server.Items
attacker.FixedParticles(0x3728, 1, 13, 0x7F3, 0x962, 0, EffectLayer.Waist);
Timer t = new FeintTimer(defender,
(int)(20.0 + 3.0 * (Math.Max(attacker.Skills[SkillName.Ninjitsu].Value,
attacker.Skills[SkillName.Bushido].Value) - 50.0) / 7.0)); //20-50 % decrease
timer = new FeintTimer(defender,
(int)(20.0 + 3.0 * (Math.Max(attacker.Skills.Ninjitsu.Value,
attacker.Skills.Bushido.Value) - 50.0) / 7.0)); //20-50 % decrease
t.Start();
Registry.Add(defender, t);
timer.Start();
Registry.Add(defender, timer);
}
public class FeintTimer : Timer
@ -71,4 +72,4 @@ namespace Server.Items
}
}
}
}
}

View file

@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Spells;
namespace Server.Items
@ -11,7 +12,7 @@ namespace Server.Items
{
public override int BaseMana => 30;
public static Hashtable Registry{ get; } = new Hashtable();
public static Dictionary<Mobile, FrenziedWirlwindTimer> Registry{ get; } = new Dictionary<Mobile, FrenziedWirlwindTimer>();
public override bool CheckSkills(Mobile from)
{
@ -34,22 +35,19 @@ namespace Server.Items
Map map = attacker.Map;
if (map == null)
if (!(map != null && attacker.Weapon is BaseWeapon weapon))
return;
if (!(attacker.Weapon is BaseWeapon weapon))
return;
ArrayList list = new ArrayList();
List<Mobile> list = new List<Mobile>();
foreach (Mobile m in attacker.GetMobilesInRange(1))
list.Add(m);
ArrayList targets = new ArrayList();
List<Mobile> targets = new List<Mobile>();
for (int i = 0; i < list.Count; ++i)
{
Mobile m = (Mobile)list[i];
Mobile m = list[i];
if (m != defender && m != attacker && SpellHelper.ValidIndirectTarget(attacker, m))
{
@ -65,47 +63,44 @@ namespace Server.Items
}
}
if (targets.Count > 0)
if (targets.Count == 0 || !CheckMana(attacker, true))
return;
attacker.FixedEffect(0x3728, 10, 15);
attacker.PlaySound(0x2A1);
// 5-15 damage
int amount = (int)(10.0 * ((Math.Max(attacker.Skills.Bushido.Value,
attacker.Skills.Ninjitsu.Value) - 50.0) / 70.0 + 5));
for (int i = 0; i < targets.Count; ++i)
{
if (!CheckMana(attacker, true))
return;
Mobile m = targets[i];
attacker.DoHarmful(m, true);
attacker.FixedEffect(0x3728, 10, 15);
attacker.PlaySound(0x2A1);
FrenziedWirlwindTimer timer = Registry[m];
// 5-15 damage
int amount = (int)(10.0 * ((Math.Max(attacker.Skills[SkillName.Bushido].Value,
attacker.Skills[SkillName.Ninjitsu].Value) - 50.0) / 70.0 + 5));
for (int i = 0; i < targets.Count; ++i)
if (timer != null)
{
Mobile m = (Mobile)targets[i];
attacker.DoHarmful(m, true);
if (Registry[m] is Timer t)
{
t.Stop();
Registry.Remove(m);
}
t = new InternalTimer(attacker, m, amount);
t.Start();
Registry.Add(m, t);
timer.Stop();
Registry.Remove(m);
}
Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerStateCallback(RepeatEffect), attacker);
timer = new FrenziedWirlwindTimer(attacker, m, amount);
timer.Start();
Registry.Add(m, timer);
}
Timer.DelayCall(TimeSpan.FromSeconds(2.0), RepeatEffect, attacker);
}
private void RepeatEffect(object state)
private void RepeatEffect(Mobile attacker)
{
Mobile attacker = (Mobile)state;
attacker.FixedEffect(0x3728, 10, 15);
attacker.PlaySound(0x2A1);
}
private class InternalTimer : Timer
public class FrenziedWirlwindTimer : Timer
{
private readonly double DamagePerTick;
private Mobile m_Attacker;
@ -113,9 +108,9 @@ namespace Server.Items
private double m_DamageToDo;
private Mobile m_Defender;
public InternalTimer(Mobile attacker, Mobile defender, int totalDamage)
public FrenziedWirlwindTimer(Mobile attacker, Mobile defender, int totalDamage)
: base(TimeSpan.Zero, TimeSpan.FromSeconds(0.25),
12) // 3 seconds at .25 seconds apart = 12. Confirm delay inbetween of .25 each.
12) // 3 seconds at .25 seconds apart = 12. Confirm delay in between of .25 each.
{
m_Attacker = attacker;
m_Defender = defender;
@ -157,4 +152,4 @@ namespace Server.Items
}
}
}
}
}

View file

@ -47,11 +47,11 @@ namespace Server.Items
--weapon.PoisonCharges;
// Infectious strike special move now uses poisoning skill to help determine potency
int maxLevel = attacker.Skills[SkillName.Poisoning].Fixed / 200;
int maxLevel = attacker.Skills.Poisoning.Fixed / 200;
if (maxLevel < 0) maxLevel = 0;
if (p.Level > maxLevel) p = Poison.GetPoison(maxLevel);
if (attacker.Skills[SkillName.Poisoning].Value / 100.0 > Utility.RandomDouble())
if (attacker.Skills.Poisoning.Value / 100.0 > Utility.RandomDouble())
{
int level = p.Level + 1;
Poison newPoison = Poison.GetPoison(level);

View file

@ -1,5 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
namespace Server.Items
{
@ -13,7 +13,7 @@ namespace Server.Items
public static readonly TimeSpan PlayerDuration = TimeSpan.FromSeconds(6.0);
public static readonly TimeSpan NPCDuration = TimeSpan.FromSeconds(12.0);
private static Hashtable m_Table = new Hashtable();
private static Dictionary<Mobile, InternalTimer> m_Table = new Dictionary<Mobile, InternalTimer>();
public override int BaseMana => 30;
@ -36,33 +36,29 @@ namespace Server.Items
public static bool IsWounded(Mobile m)
{
return m_Table.Contains(m);
return m_Table.ContainsKey(m);
}
public static void BeginWound(Mobile m, TimeSpan duration)
{
Timer t = (Timer)m_Table[m];
InternalTimer timer = m_Table[m];
timer?.Stop();
t?.Stop();
t = new InternalTimer(m, duration);
m_Table[m] = t;
t.Start();
m_Table[m] = timer = new InternalTimer(m, duration);
timer.Start();
m.YellowHealthbar = true;
}
public static void EndWound(Mobile m)
{
if (!IsWounded(m))
return;
Timer timer = m_Table[m];
Timer t = (Timer)m_Table[m];
t?.Stop();
m_Table.Remove(m);
if (timer != null)
{
timer.Stop();
m_Table.Remove(m);
}
m.YellowHealthbar = false;
m.SendLocalizedMessage(1060208); // You are no longer mortally wounded.
@ -84,4 +80,4 @@ namespace Server.Items
}
}
}
}
}

View file

@ -59,10 +59,10 @@ namespace Server.Items
if (Core.ML)
{
AOS.Damage(defender, attacker,
(int)(15.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + Utility.Random(10)), true, 100,
(int)(15.0 * (attacker.Skills.Bushido.Value - 50.0) / 70.0 + Utility.Random(10)), true, 100,
0, 0, 0, 0); //0-25
if (!cantpara && (150.0 / 7.0 + 4.0 * attacker.Skills[SkillName.Bushido].Value / 7.0) / 100.0 >
if (!cantpara && (150.0 / 7.0 + 4.0 * attacker.Skills.Bushido.Value / 7.0) / 100.0 >
Utility.RandomDouble())
{
defender.Paralyze(TimeSpan.FromSeconds(2.0));
@ -71,7 +71,7 @@ namespace Server.Items
}
else if (!cantpara)
{
AOS.Damage(defender, attacker, (int)(15.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + 10),
AOS.Damage(defender, attacker, (int)(15.0 * (attacker.Skills.Bushido.Value - 50.0) / 70.0 + 10),
true, 100, 0, 0, 0, 0); //10-25
defender.Freeze(TimeSpan.FromSeconds(2.0));
Items.ParalyzingBlow.BeginImmunity(defender, Items.ParalyzingBlow.FreezeDelayDuration);

View file

@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
namespace Server.Items
{
@ -13,7 +14,7 @@ namespace Server.Items
public static readonly TimeSpan FreezeDelayDuration = TimeSpan.FromSeconds(8.0);
private static Hashtable m_Table = new Hashtable();
private static Dictionary<Mobile, InternalTimer> m_Table = new Dictionary<Mobile, InternalTimer>();
public override int BaseMana => 30;
@ -26,7 +27,7 @@ namespace Server.Items
if ( !(from.Weapon is Fists) )
return true;
Skill skill = from.Skills[SkillName.Anatomy];
Skill skill = from.Skills.Anatomy;
if ( skill != null && skill.Base >= 80.0 )
return true;
@ -38,10 +39,7 @@ namespace Server.Items
public override bool RequiresTactics(Mobile from)
{
if (!(from.Weapon is BaseWeapon weapon))
return true;
return weapon.Skill != SkillName.Wrestling;
return !(from.Weapon is BaseWeapon weapon && weapon.Skill == SkillName.Wrestling);
}
public override bool OnBeforeSwing(Mobile attacker, Mobile defender)
@ -85,27 +83,22 @@ namespace Server.Items
public static bool IsImmune(Mobile m)
{
return m_Table.Contains(m);
return m_Table.ContainsKey(m);
}
public static void BeginImmunity(Mobile m, TimeSpan duration)
{
Timer t = (Timer)m_Table[m];
InternalTimer timer = m_Table[m];
t?.Stop();
t = new InternalTimer(m, duration);
m_Table[m] = t;
t.Start();
timer?.Stop();
m_Table[m] = timer = new InternalTimer(m, duration);
timer.Start();
}
public static void EndImmunity(Mobile m)
{
Timer t = (Timer)m_Table[m];
t?.Stop();
InternalTimer timer = m_Table[m];
timer?.Stop();
m_Table.Remove(m);
}
@ -125,4 +118,4 @@ namespace Server.Items
}
}
}
}
}

View file

@ -47,7 +47,7 @@ namespace Server.Items
if (mount != null) //Ethy mounts don't take damage
{
int amount = 10 + (int)(10.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + 5);
int amount = 10 + (int)(10.0 * (attacker.Skills.Bushido.Value - 50.0) / 70.0 + 5);
AOS.Damage(mount, null, amount, 100, 0, 0, 0,
0); //The mount just takes damage, there's no flagging as if it was attacking the mount directly
@ -57,7 +57,7 @@ namespace Server.Items
}
else
{
int amount = 10 + (int)(10.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + 5);
int amount = 10 + (int)(10.0 * (attacker.Skills.Bushido.Value - 50.0) / 70.0 + 5);
AOS.Damage(defender, attacker, amount, 100, 0, 0, 0, 0);

View file

@ -20,7 +20,7 @@ namespace Server.Items
if (!base.CheckSkills(from))
return false;
Skill skill = from.Skills[SkillName.Stealth];
Skill skill = from.Skills.Stealth;
if (skill != null && skill.Value >= 80.0)
return true;

View file

@ -1,5 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
namespace Server.Items
{
@ -8,7 +8,7 @@ namespace Server.Items
/// </summary>
public class TalonStrike : WeaponAbility
{
public static Hashtable Registry{ get; } = new Hashtable();
private static Dictionary<Mobile, InternalTimer> m_Table = new Dictionary<Mobile, InternalTimer>();
public override int BaseMana => 30;
public override double DamageScalar => 1.2;
@ -27,7 +27,7 @@ namespace Server.Items
public override void OnHit(Mobile attacker, Mobile defender, int damage)
{
if (Registry.Contains(defender) || !Validate(attacker) || !CheckMana(attacker, true))
if (m_Table.ContainsKey(defender) || !Validate(attacker) || !CheckMana(attacker, true))
return;
ClearCurrentAbility(attacker);
@ -37,23 +37,22 @@ namespace Server.Items
defender.FixedParticles(0x373A, 1, 17, 0x26BC, 0x662, 0, EffectLayer.Waist);
Timer t = new InternalTimer(defender,
(int)(10.0 * (attacker.Skills[SkillName.Ninjitsu].Value - 50.0) / 70.0 + 5), attacker); //5 - 15 damage
InternalTimer timer = new InternalTimer(defender,
(int)(10.0 * (attacker.Skills.Ninjitsu.Value - 50.0) / 70.0 + 5)); //5 - 15 damage
t.Start();
timer.Start();
Registry.Add(defender, t);
m_Table.Add(defender, timer);
}
private class InternalTimer : Timer
{
private readonly double DamagePerTick;
private Mobile m_Attacker;
private double m_DamageRemaining;
private double m_DamageToDo;
private Mobile m_Defender;
public InternalTimer(Mobile defender, int totalDamage, Mobile attacker)
public InternalTimer(Mobile defender, int totalDamage)
: base(TimeSpan.Zero, TimeSpan.FromSeconds(0.25),
12) // 3 seconds at .25 seconds apart = 12. Confirm delay inbetween of .25 each.
{
@ -61,8 +60,6 @@ namespace Server.Items
m_DamageRemaining = totalDamage;
Priority = TimerPriority.TwentyFiveMS;
m_Attacker = attacker;
DamagePerTick = (double)totalDamage / 12 + .01;
}
@ -71,7 +68,7 @@ namespace Server.Items
if (!m_Defender.Alive || m_DamageRemaining <= 0)
{
Stop();
Registry.Remove(m_Defender);
m_Table.Remove(m_Defender);
return;
}
@ -93,9 +90,9 @@ namespace Server.Items
if (!m_Defender.Alive || m_DamageRemaining <= 0)
{
Stop();
Registry.Remove(m_Defender);
m_Table.Remove(m_Defender);
}
}
}
}
}
}

View file

@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Engines.ConPVP;
using Server.Mobiles;
using Server.Network;
@ -12,52 +13,7 @@ namespace Server.Items
{
public abstract class WeaponAbility
{
public static readonly WeaponAbility ArmorIgnore = Abilities[1];
public static readonly WeaponAbility BleedAttack = Abilities[2];
public static readonly WeaponAbility ConcussionBlow = Abilities[3];
public static readonly WeaponAbility CrushingBlow = Abilities[4];
public static readonly WeaponAbility Disarm = Abilities[5];
public static readonly WeaponAbility Dismount = Abilities[6];
public static readonly WeaponAbility DoubleStrike = Abilities[7];
public static readonly WeaponAbility InfectiousStrike = Abilities[8];
public static readonly WeaponAbility MortalStrike = Abilities[9];
public static readonly WeaponAbility MovingShot = Abilities[10];
public static readonly WeaponAbility ParalyzingBlow = Abilities[11];
public static readonly WeaponAbility ShadowStrike = Abilities[12];
public static readonly WeaponAbility WhirlwindAttack = Abilities[13];
public static readonly WeaponAbility RidingSwipe = Abilities[14];
public static readonly WeaponAbility FrenziedWhirlwind = Abilities[15];
public static readonly WeaponAbility Block = Abilities[16];
public static readonly WeaponAbility DefenseMastery = Abilities[17];
public static readonly WeaponAbility NerveStrike = Abilities[18];
public static readonly WeaponAbility TalonStrike = Abilities[19];
public static readonly WeaponAbility Feint = Abilities[20];
public static readonly WeaponAbility DualWield = Abilities[21];
public static readonly WeaponAbility DoubleShot = Abilities[22];
public static readonly WeaponAbility ArmorPierce = Abilities[23];
public static readonly WeaponAbility Bladeweave = Abilities[24];
public static readonly WeaponAbility ForceArrow = Abilities[25];
public static readonly WeaponAbility LightningArrow = Abilities[26];
public static readonly WeaponAbility PsychicAttack = Abilities[27];
public static readonly WeaponAbility SerpentArrow = Abilities[28];
public static readonly WeaponAbility ForceOfNature = Abilities[29];
public static readonly WeaponAbility Disrobe = Abilities[30];
private static Hashtable m_PlayersTable = new Hashtable();
public virtual int BaseMana => 0;
public virtual int AccuracyBonus => 0;
public virtual double DamageScalar => 1.0;
public virtual bool RequiresSE => false;
public static WeaponAbility[] Abilities{ get; } = new WeaponAbility[31]
{
public static WeaponAbility[] Abilities{ get; } = {
null,
new ArmorIgnore(),
new BleedAttack(),
@ -92,7 +48,50 @@ namespace Server.Items
new Disrobe()
};
public static Hashtable Table{ get; } = new Hashtable();
public static readonly WeaponAbility ArmorIgnore = Abilities[1];
public static readonly WeaponAbility BleedAttack = Abilities[2];
public static readonly WeaponAbility ConcussionBlow = Abilities[3];
public static readonly WeaponAbility CrushingBlow = Abilities[4];
public static readonly WeaponAbility Disarm = Abilities[5];
public static readonly WeaponAbility Dismount = Abilities[6];
public static readonly WeaponAbility DoubleStrike = Abilities[7];
public static readonly WeaponAbility InfectiousStrike = Abilities[8];
public static readonly WeaponAbility MortalStrike = Abilities[9];
public static readonly WeaponAbility MovingShot = Abilities[10];
public static readonly WeaponAbility ParalyzingBlow = Abilities[11];
public static readonly WeaponAbility ShadowStrike = Abilities[12];
public static readonly WeaponAbility WhirlwindAttack = Abilities[13];
public static readonly WeaponAbility RidingSwipe = Abilities[14];
public static readonly WeaponAbility FrenziedWhirlwind = Abilities[15];
public static readonly WeaponAbility Block = Abilities[16];
public static readonly WeaponAbility DefenseMastery = Abilities[17];
public static readonly WeaponAbility NerveStrike = Abilities[18];
public static readonly WeaponAbility TalonStrike = Abilities[19];
public static readonly WeaponAbility Feint = Abilities[20];
public static readonly WeaponAbility DualWield = Abilities[21];
public static readonly WeaponAbility DoubleShot = Abilities[22];
public static readonly WeaponAbility ArmorPierce = Abilities[23];
public static readonly WeaponAbility Bladeweave = Abilities[24];
public static readonly WeaponAbility ForceArrow = Abilities[25];
public static readonly WeaponAbility LightningArrow = Abilities[26];
public static readonly WeaponAbility PsychicAttack = Abilities[27];
public static readonly WeaponAbility SerpentArrow = Abilities[28];
public static readonly WeaponAbility ForceOfNature = Abilities[29];
public static readonly WeaponAbility Disrobe = Abilities[30];
private static Dictionary<Mobile, WeaponAbilityContext> m_PlayersTable = new Dictionary<Mobile, WeaponAbilityContext>();
public virtual int BaseMana => 0;
public virtual int AccuracyBonus => 0;
public virtual double DamageScalar => 1.0;
public virtual bool RequiresSE => false;
public static Dictionary<Mobile, WeaponAbility> Table{ get; } = new Dictionary<Mobile, WeaponAbility>();
public virtual bool ValidatesDuringHit => true;
@ -122,12 +121,13 @@ namespace Server.Items
public virtual double GetRequiredSkill(Mobile from)
{
BaseWeapon weapon = from.Weapon as BaseWeapon;
if (weapon != null && weapon.PrimaryAbility == this)
return 70.0;
if (weapon != null && weapon.SecondaryAbility == this)
return 90.0;
if (from.Weapon is BaseWeapon weapon)
{
if (weapon.PrimaryAbility == this)
return 70.0;
if (weapon.SecondaryAbility == this)
return 90.0;
}
return 200.0;
}
@ -177,7 +177,7 @@ namespace Server.Items
double reqSkill = GetRequiredSkill(from);
bool reqTactics = Core.ML && RequiresTactics(from);
if (Core.ML && reqTactics && from.Skills[SkillName.Tactics].Base < reqSkill)
if (Core.ML && reqTactics && from.Skills.Tactics.Base < reqSkill)
{
from.SendLocalizedMessage(1079308,
reqSkill.ToString()); // You need ~1_SKILL_REQUIREMENT~ weapon and tactics skill to perform that attack
@ -188,9 +188,9 @@ namespace Server.Items
return true;
/* <UBWS> */
if (weapon.WeaponAttributes.UseBestSkill > 0 && (from.Skills[SkillName.Swords].Base >= reqSkill ||
from.Skills[SkillName.Macing].Base >= reqSkill ||
from.Skills[SkillName.Fencing].Base >= reqSkill))
if (weapon.WeaponAttributes.UseBestSkill > 0 && (from.Skills.Swords.Base >= reqSkill ||
from.Skills.Macing.Base >= reqSkill ||
from.Skills.Fencing.Base >= reqSkill))
return true;
/* </UBWS> */
@ -338,13 +338,8 @@ namespace Server.Items
public static bool IsWeaponAbility(Mobile m, WeaponAbility a)
{
if (a == null)
return true;
if (!m.Player)
return true;
return m.Weapon is BaseWeapon weapon && (weapon.PrimaryAbility == a || weapon.SecondaryAbility == a);
return a == null || !m.Player || m.Weapon is BaseWeapon weapon &&
(weapon.PrimaryAbility == a || weapon.SecondaryAbility == a);
}
public static WeaponAbility GetCurrentAbility(Mobile m)
@ -355,7 +350,7 @@ namespace Server.Items
return null;
}
WeaponAbility a = (WeaponAbility)Table[m];
WeaponAbility a = Table[m];
if (!IsWeaponAbility(m, a))
{
@ -363,7 +358,7 @@ namespace Server.Items
return null;
}
if (a != null && a.ValidatesDuringHit && !a.Validate(m))
if (a?.ValidatesDuringHit == true && !a.Validate(m))
{
ClearCurrentAbility(m);
return null;
@ -451,7 +446,7 @@ namespace Server.Items
private static WeaponAbilityContext GetContext(Mobile m)
{
return m_PlayersTable[m] as WeaponAbilityContext;
return m_PlayersTable[m];
}
private class WeaponAbilityTimer : Timer
@ -481,4 +476,4 @@ namespace Server.Items
public Timer Timer{ get; }
}
}
}
}

View file

@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Spells;
namespace Server.Items
@ -33,16 +34,16 @@ namespace Server.Items
attacker.FixedEffect(0x3728, 10, 15);
attacker.PlaySound(0x2A1);
ArrayList list = new ArrayList();
List<Mobile> list = new List<Mobile>();
foreach (Mobile m in attacker.GetMobilesInRange(1))
list.Add(m);
ArrayList targets = new ArrayList();
List<Mobile> targets = new List<Mobile>();
for (int i = 0; i < list.Count; ++i)
{
Mobile m = (Mobile)list[i];
Mobile m = list[i];
if (m != defender && m != attacker && SpellHelper.ValidIndirectTarget(attacker, m))
{
@ -70,7 +71,7 @@ namespace Server.Items
for (int i = 0; i < targets.Count; ++i)
{
Mobile m = (Mobile)targets[i];
Mobile m = targets[i];
attacker.SendLocalizedMessage(1060161); // The whirling attack strikes a target!
m.SendLocalizedMessage(1060162); // You are struck by the whirling attack and take damage!

View file

@ -163,8 +163,8 @@ namespace Server.Items
base.OnHit(attacker, defender, damageBonus);
if (!Core.AOS && (attacker.Player || attacker.Body.IsHuman) && Layer == Layer.TwoHanded &&
attacker.Skills[SkillName.Anatomy].Value >= 80 &&
attacker.Skills[SkillName.Anatomy].Value / 400.0 >= Utility.RandomDouble() &&
attacker.Skills.Anatomy.Value >= 80 &&
attacker.Skills.Anatomy.Value / 400.0 >= Utility.RandomDouble() &&
DuelContext.AllowSpecialAbility(attacker, "Concussion Blow", false))
{
StatMod mod = defender.GetStatMod("Concussion");

View file

@ -48,10 +48,10 @@ namespace Server.Items
m_Resource = CraftResource.Iron;
m_AosAttributes = new AosAttributes(this);
m_AosWeaponAttributes = new AosWeaponAttributes(this);
m_AosSkillBonuses = new AosSkillBonuses(this);
m_AosElementDamages = new AosElementAttributes(this);
Attributes = new AosAttributes(this);
WeaponAttributes = new AosWeaponAttributes(this);
SkillBonuses = new AosSkillBonuses(this);
AosElementDamages = new AosElementAttributes(this);
}
public BaseWeapon(Serial serial) : base(serial)
@ -284,10 +284,10 @@ namespace Server.Items
if (!(newItem is BaseWeapon weap))
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);
weap.Attributes = new AosAttributes(newItem, Attributes);
weap.AosElementDamages = new AosElementAttributes(newItem, AosElementDamages);
weap.SkillBonuses = new AosSkillBonuses(newItem, SkillBonuses);
weap.WeaponAttributes = new AosWeaponAttributes(newItem, WeaponAttributes);
}
public int GetDurabilityBonus()
@ -318,7 +318,7 @@ namespace Server.Items
if (Core.AOS)
{
bonus += m_AosWeaponAttributes.DurabilityBonus;
bonus += WeaponAttributes.DurabilityBonus;
CraftResourceInfo resInfo = CraftResources.GetInfo(m_Resource);
CraftAttributeInfo attrInfo = null;
@ -338,7 +338,7 @@ namespace Server.Items
if (!Core.AOS)
return 0;
int v = m_AosWeaponAttributes.LowerStatReq;
int v = WeaponAttributes.LowerStatReq;
CraftAttributeInfo attrInfo = CraftResources.GetInfo(m_Resource)?.AttributeInfo;
@ -353,7 +353,7 @@ namespace Server.Items
public static void BlockEquip(Mobile m, TimeSpan duration)
{
if (m.BeginAction(typeof(BaseWeapon)))
if (m.BeginAction<BaseWeapon>())
new ResetEquipTimer(m, duration).Start();
}
@ -419,16 +419,16 @@ namespace Server.Items
return false;
}
if (!from.CanBeginAction(typeof(BaseWeapon))) return false;
if (!from.CanBeginAction<BaseWeapon>()) return false;
return base.CanEquip(from);
}
public override bool OnEquip(Mobile from)
{
int strBonus = m_AosAttributes.BonusStr;
int dexBonus = m_AosAttributes.BonusDex;
int intBonus = m_AosAttributes.BonusInt;
int strBonus = Attributes.BonusStr;
int dexBonus = Attributes.BonusDex;
int intBonus = Attributes.BonusInt;
if (strBonus != 0 || dexBonus != 0 || intBonus != 0)
{
@ -456,11 +456,11 @@ namespace Server.Items
from.AddSkillMod(m_SkillMod);
}
if (Core.AOS && m_AosWeaponAttributes.MageWeapon != 0 && m_AosWeaponAttributes.MageWeapon != 30)
if (Core.AOS && WeaponAttributes.MageWeapon != 0 && WeaponAttributes.MageWeapon != 30)
{
m_MageMod?.Remove();
m_MageMod = new DefaultSkillMod(SkillName.Magery, true, -30 + m_AosWeaponAttributes.MageWeapon);
m_MageMod = new DefaultSkillMod(SkillName.Magery, true, -30 + WeaponAttributes.MageWeapon);
from.AddSkillMod(m_MageMod);
}
@ -474,7 +474,7 @@ namespace Server.Items
if (parent is Mobile from)
{
if (Core.AOS)
m_AosSkillBonuses.AddTo(from);
SkillBonuses.AddTo(from);
from.CheckStatTimers();
from.Delta(MobileDelta.WeaponDamage);
@ -509,7 +509,7 @@ namespace Server.Items
}
if (Core.AOS)
m_AosSkillBonuses.Remove();
SkillBonuses.Remove();
ImmolatingWeaponSpell.StopImmolating(this);
@ -523,11 +523,11 @@ namespace Server.Items
{
SkillName sk;
if (checkSkillAttrs && m_AosWeaponAttributes.UseBestSkill != 0)
if (checkSkillAttrs && WeaponAttributes.UseBestSkill != 0)
{
double swrd = m.Skills[SkillName.Swords].Value;
double fenc = m.Skills[SkillName.Fencing].Value;
double mcng = m.Skills[SkillName.Macing].Value;
double swrd = m.Skills.Swords.Value;
double fenc = m.Skills.Fencing.Value;
double mcng = m.Skills.Macing.Value;
double val;
sk = SkillName.Swords;
@ -541,9 +541,9 @@ namespace Server.Items
if (mcng > val) sk = SkillName.Macing;
}
else if (m_AosWeaponAttributes.MageWeapon != 0)
else if (WeaponAttributes.MageWeapon != 0)
{
if (m.Skills[SkillName.Magery].Value > m.Skills[Skill].Value)
if (m.Skills.Magery.Value > m.Skills[Skill].Value)
sk = SkillName.Magery;
else
sk = Skill;
@ -553,7 +553,7 @@ namespace Server.Items
sk = Skill;
if (sk != SkillName.Wrestling && !m.Player && !m.Body.IsHuman &&
m.Skills[SkillName.Wrestling].Value > m.Skills[sk].Value)
m.Skills.Wrestling.Value > m.Skills[sk].Value)
sk = SkillName.Wrestling;
}
@ -704,11 +704,11 @@ namespace Server.Items
// Bonus granted by successful use of Honorable Execution.
bonus += HonorableExecution.GetSwingBonus(m);
if (DualWield.Registry.Contains(m))
bonus += ((DualWield.DualWieldTimer)DualWield.Registry[m]).BonusSwingSpeed;
if (DualWield.Registry.ContainsKey(m))
bonus += DualWield.Registry[m].BonusSwingSpeed;
if (Feint.Registry.Contains(m))
bonus -= ((Feint.FeintTimer)Feint.Registry[m]).SwingSpeedReduction;
if (Feint.Registry.ContainsKey(m))
bonus -= Feint.Registry[m].SwingSpeedReduction;
TransformContext context = TransformationSpellHelper.GetContext(m);
@ -849,9 +849,9 @@ namespace Server.Items
BaseShield shield = defender.FindItemOnLayer(Layer.TwoHanded) as BaseShield;
double parry = defender.Skills[SkillName.Parry].Value;
double bushidoNonRacial = defender.Skills[SkillName.Bushido].NonRacialValue;
double bushido = defender.Skills[SkillName.Bushido].Value;
double parry = defender.Skills.Parry.Value;
double bushidoNonRacial = defender.Skills.Bushido.NonRacialValue;
double bushido = defender.Skills.Bushido.Value;
if (shield != null)
{
@ -1261,7 +1261,6 @@ namespace Server.Items
if (nrgy < low)
{
low = nrgy;
type = 4;
}
@ -1295,7 +1294,7 @@ namespace Server.Items
bool ignoreArmor = a is ArmorIgnore || move != null && move.IgnoreArmor(attacker);
damageGiven = AOS.Damage(defender, attacker, damage, ignoreArmor, phys, fire, cold, pois, nrgy, chaos, direct,
false, this is BaseRanged, false);
false, this is BaseRanged);
double propertyBonus = move?.GetPropertyBonus(attacker) ?? 1.0;
@ -1357,7 +1356,7 @@ namespace Server.Items
if (MaxRange <= 1 && (defender is Slime || defender is AcidElemental))
attacker.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500263); // *Acid blood scars your weapon!*
if (Core.AOS && m_AosWeaponAttributes.SelfRepair > Utility.Random(10))
if (Core.AOS && WeaponAttributes.SelfRepair > Utility.Random(10))
{
HitPoints += 2;
}
@ -1482,7 +1481,7 @@ namespace Server.Items
int damageBonus = 0;
// Inscription bonus
int inscribeSkill = attacker.Skills[SkillName.Inscribe].Fixed;
int inscribeSkill = attacker.Skills.Inscribe.Fixed;
damageBonus += inscribeSkill / 200;
@ -1575,12 +1574,12 @@ namespace Server.Items
}
else
{
fire = m_AosElementDamages.Fire;
cold = m_AosElementDamages.Cold;
pois = m_AosElementDamages.Poison;
nrgy = m_AosElementDamages.Energy;
chaos = m_AosElementDamages.Chaos;
direct = m_AosElementDamages.Direct;
fire = AosElementDamages.Fire;
cold = AosElementDamages.Cold;
pois = AosElementDamages.Poison;
nrgy = AosElementDamages.Energy;
chaos = AosElementDamages.Chaos;
direct = AosElementDamages.Direct;
phys = 100 - fire - cold - pois - nrgy - chaos - direct;
@ -1765,9 +1764,9 @@ namespace Server.Items
if (checkSkills)
{
attacker.CheckSkill(SkillName.Tactics, 0.0,
attacker.Skills[SkillName.Tactics].Cap); // Passively check tactics for gain
attacker.Skills.Tactics.Cap); // Passively check tactics for gain
attacker.CheckSkill(SkillName.Anatomy, 0.0,
attacker.Skills[SkillName.Anatomy].Cap); // Passively check Anatomy for gain
attacker.Skills.Anatomy.Cap); // Passively check Anatomy for gain
if (Type == WeaponType.Axe)
attacker.CheckSkill(SkillName.Lumberjacking, 0.0, 100.0); // Passively check Lumberjacking for gain
@ -1780,9 +1779,9 @@ namespace Server.Items
* No caps apply.
*/
double strengthBonus = GetBonus(attacker.Str, 0.300, 100.0, 5.00);
double anatomyBonus = GetBonus(attacker.Skills[SkillName.Anatomy].Value, 0.500, 100.0, 5.00);
double tacticsBonus = GetBonus(attacker.Skills[SkillName.Tactics].Value, 0.625, 100.0, 6.25);
double lumberBonus = GetBonus(attacker.Skills[SkillName.Lumberjacking].Value, 0.200, 100.0, 10.00);
double anatomyBonus = GetBonus(attacker.Skills.Anatomy.Value, 0.500, 100.0, 5.00);
double tacticsBonus = GetBonus(attacker.Skills.Tactics.Value, 0.625, 100.0, 6.25);
double lumberBonus = GetBonus(attacker.Skills.Lumberjacking.Value, 0.200, 100.0, 10.00);
if (Type != WeaponType.Axe)
lumberBonus = 0.0;
@ -1838,9 +1837,9 @@ namespace Server.Items
if (checkSkills)
{
attacker.CheckSkill(SkillName.Tactics, 0.0,
attacker.Skills[SkillName.Tactics].Cap); // Passively check tactics for gain
attacker.Skills.Tactics.Cap); // Passively check tactics for gain
attacker.CheckSkill(SkillName.Anatomy, 0.0,
attacker.Skills[SkillName.Anatomy].Cap); // Passively check Anatomy for gain
attacker.Skills.Anatomy.Cap); // Passively check Anatomy for gain
if (Type == WeaponType.Axe)
attacker.CheckSkill(SkillName.Lumberjacking, 0.0, 100.0); // Passively check Lumberjacking for gain
@ -1851,7 +1850,7 @@ namespace Server.Items
* : 50.0 = unchanged
* : 100.0 = 50% bonus
*/
damage += damage * ((attacker.Skills[SkillName.Tactics].Value - 50.0) / 100.0);
damage += damage * ((attacker.Skills.Tactics.Value - 50.0) / 100.0);
/* Compute strength modifier
@ -1863,7 +1862,7 @@ namespace Server.Items
* : 1% bonus for every 5 points of anatomy
* : +10% bonus at Grandmaster or higher
*/
double anatomyValue = attacker.Skills[SkillName.Anatomy].Value;
double anatomyValue = attacker.Skills.Anatomy.Value;
modifiers += anatomyValue / 5.0 / 100.0;
if (anatomyValue >= 100.0)
@ -1875,7 +1874,7 @@ namespace Server.Items
*/
if (Type == WeaponType.Axe)
{
double lumberValue = attacker.Skills[SkillName.Lumberjacking].Value;
double lumberValue = attacker.Skills.Lumberjacking.Value;
modifiers += lumberValue / 5.0 / 100.0;
@ -2035,8 +2034,7 @@ namespace Server.Items
public int GetElementalDamageHue()
{
GetDamageTypes(null, out int phys, out int fire, out int cold, out int pois, out int nrgy, out int chaos,
out int direct);
GetDamageTypes(null, out _, out int fire, out int cold, out int pois, out int nrgy, out _, out _);
//Order is Cold, Energy, Fire, Poison, Physical left
int currentMax = 50;
@ -2158,7 +2156,7 @@ namespace Server.Items
if (base.AllowEquippedCast(from))
return true;
return m_AosAttributes.SpellChanneling != 0;
return Attributes.SpellChanneling != 0;
}
public virtual int GetLuckBonus()
@ -2187,7 +2185,7 @@ namespace Server.Items
#endregion
m_AosSkillBonuses?.GetProperties(list);
SkillBonuses?.GetProperties(list);
if (m_Quality == WeaponQuality.Exceptional)
list.Add(1060636); // exceptional
@ -2228,70 +2226,70 @@ namespace Server.Items
if (Core.ML && ranged?.Balanced == true)
list.Add(1072792); // Balanced
if ((prop = m_AosWeaponAttributes.UseBestSkill) != 0)
if ((prop = WeaponAttributes.UseBestSkill) != 0)
list.Add(1060400); // use best weapon skill
if ((prop = GetDamageBonus() + m_AosAttributes.WeaponDamage) != 0)
if ((prop = GetDamageBonus() + Attributes.WeaponDamage) != 0)
list.Add(1060401, prop.ToString()); // damage increase ~1_val~%
if ((prop = m_AosAttributes.DefendChance) != 0)
if ((prop = Attributes.DefendChance) != 0)
list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~%
if ((prop = m_AosAttributes.EnhancePotions) != 0)
if ((prop = Attributes.EnhancePotions) != 0)
list.Add(1060411, prop.ToString()); // enhance potions ~1_val~%
if ((prop = m_AosAttributes.CastRecovery) != 0)
if ((prop = Attributes.CastRecovery) != 0)
list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~
if ((prop = m_AosAttributes.CastSpeed) != 0)
if ((prop = Attributes.CastSpeed) != 0)
list.Add(1060413, prop.ToString()); // faster casting ~1_val~
if ((prop = GetHitChanceBonus() + m_AosAttributes.AttackChance) != 0)
if ((prop = GetHitChanceBonus() + Attributes.AttackChance) != 0)
list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~%
if ((prop = m_AosWeaponAttributes.HitColdArea) != 0)
if ((prop = WeaponAttributes.HitColdArea) != 0)
list.Add(1060416, prop.ToString()); // hit cold area ~1_val~%
if ((prop = m_AosWeaponAttributes.HitDispel) != 0)
if ((prop = WeaponAttributes.HitDispel) != 0)
list.Add(1060417, prop.ToString()); // hit dispel ~1_val~%
if ((prop = m_AosWeaponAttributes.HitEnergyArea) != 0)
if ((prop = WeaponAttributes.HitEnergyArea) != 0)
list.Add(1060418, prop.ToString()); // hit energy area ~1_val~%
if ((prop = m_AosWeaponAttributes.HitFireArea) != 0)
if ((prop = WeaponAttributes.HitFireArea) != 0)
list.Add(1060419, prop.ToString()); // hit fire area ~1_val~%
if ((prop = m_AosWeaponAttributes.HitFireball) != 0)
if ((prop = WeaponAttributes.HitFireball) != 0)
list.Add(1060420, prop.ToString()); // hit fireball ~1_val~%
if ((prop = m_AosWeaponAttributes.HitHarm) != 0)
if ((prop = WeaponAttributes.HitHarm) != 0)
list.Add(1060421, prop.ToString()); // hit harm ~1_val~%
if ((prop = m_AosWeaponAttributes.HitLeechHits) != 0)
if ((prop = WeaponAttributes.HitLeechHits) != 0)
list.Add(1060422, prop.ToString()); // hit life leech ~1_val~%
if ((prop = m_AosWeaponAttributes.HitLightning) != 0)
if ((prop = WeaponAttributes.HitLightning) != 0)
list.Add(1060423, prop.ToString()); // hit lightning ~1_val~%
if ((prop = m_AosWeaponAttributes.HitLowerAttack) != 0)
if ((prop = WeaponAttributes.HitLowerAttack) != 0)
list.Add(1060424, prop.ToString()); // hit lower attack ~1_val~%
if ((prop = m_AosWeaponAttributes.HitLowerDefend) != 0)
if ((prop = WeaponAttributes.HitLowerDefend) != 0)
list.Add(1060425, prop.ToString()); // hit lower defense ~1_val~%
if ((prop = m_AosWeaponAttributes.HitMagicArrow) != 0)
if ((prop = WeaponAttributes.HitMagicArrow) != 0)
list.Add(1060426, prop.ToString()); // hit magic arrow ~1_val~%
if ((prop = m_AosWeaponAttributes.HitLeechMana) != 0)
if ((prop = WeaponAttributes.HitLeechMana) != 0)
list.Add(1060427, prop.ToString()); // hit mana leech ~1_val~%
if ((prop = m_AosWeaponAttributes.HitPhysicalArea) != 0)
if ((prop = WeaponAttributes.HitPhysicalArea) != 0)
list.Add(1060428, prop.ToString()); // hit physical area ~1_val~%
if ((prop = m_AosWeaponAttributes.HitPoisonArea) != 0)
if ((prop = WeaponAttributes.HitPoisonArea) != 0)
list.Add(1060429, prop.ToString()); // hit poison area ~1_val~%
if ((prop = m_AosWeaponAttributes.HitLeechStam) != 0)
if ((prop = WeaponAttributes.HitLeechStam) != 0)
list.Add(1060430, prop.ToString()); // hit stamina leech ~1_val~%
if (ImmolatingWeaponSpell.IsImmolating(this))
@ -2300,67 +2298,67 @@ namespace Server.Items
if (Core.ML && (ranged?.Velocity ?? 0) != 0)
list.Add(1072793, prop.ToString()); // Velocity ~1_val~%
if ((prop = m_AosAttributes.BonusDex) != 0)
if ((prop = Attributes.BonusDex) != 0)
list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~
if ((prop = m_AosAttributes.BonusHits) != 0)
if ((prop = Attributes.BonusHits) != 0)
list.Add(1060431, prop.ToString()); // hit point increase ~1_val~
if ((prop = m_AosAttributes.BonusInt) != 0)
if ((prop = Attributes.BonusInt) != 0)
list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~
if ((prop = m_AosAttributes.LowerManaCost) != 0)
if ((prop = Attributes.LowerManaCost) != 0)
list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~%
if ((prop = m_AosAttributes.LowerRegCost) != 0)
if ((prop = Attributes.LowerRegCost) != 0)
list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~%
if ((prop = GetLowerStatReq()) != 0)
list.Add(1060435, prop.ToString()); // lower requirements ~1_val~%
if ((prop = GetLuckBonus() + m_AosAttributes.Luck) != 0)
if ((prop = GetLuckBonus() + Attributes.Luck) != 0)
list.Add(1060436, prop.ToString()); // luck ~1_val~
if ((prop = m_AosWeaponAttributes.MageWeapon) != 0)
if ((prop = WeaponAttributes.MageWeapon) != 0)
list.Add(1060438, (30 - prop).ToString()); // mage weapon -~1_val~ skill
if ((prop = m_AosAttributes.BonusMana) != 0)
if ((prop = Attributes.BonusMana) != 0)
list.Add(1060439, prop.ToString()); // mana increase ~1_val~
if ((prop = m_AosAttributes.RegenMana) != 0)
if ((prop = Attributes.RegenMana) != 0)
list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~
if ((prop = m_AosAttributes.NightSight) != 0)
if ((prop = Attributes.NightSight) != 0)
list.Add(1060441); // night sight
if ((prop = m_AosAttributes.ReflectPhysical) != 0)
if ((prop = Attributes.ReflectPhysical) != 0)
list.Add(1060442, prop.ToString()); // reflect physical damage ~1_val~%
if ((prop = m_AosAttributes.RegenStam) != 0)
if ((prop = Attributes.RegenStam) != 0)
list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~
if ((prop = m_AosAttributes.RegenHits) != 0)
if ((prop = Attributes.RegenHits) != 0)
list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~
if ((prop = m_AosWeaponAttributes.SelfRepair) != 0)
if ((prop = WeaponAttributes.SelfRepair) != 0)
list.Add(1060450, prop.ToString()); // self repair ~1_val~
if ((prop = m_AosAttributes.SpellChanneling) != 0)
if ((prop = Attributes.SpellChanneling) != 0)
list.Add(1060482); // spell channeling
if ((prop = m_AosAttributes.SpellDamage) != 0)
if ((prop = Attributes.SpellDamage) != 0)
list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~%
if ((prop = m_AosAttributes.BonusStam) != 0)
if ((prop = Attributes.BonusStam) != 0)
list.Add(1060484, prop.ToString()); // stamina increase ~1_val~
if ((prop = m_AosAttributes.BonusStr) != 0)
if ((prop = Attributes.BonusStr) != 0)
list.Add(1060485, prop.ToString()); // strength bonus ~1_val~
if ((prop = m_AosAttributes.WeaponSpeed) != 0)
if ((prop = Attributes.WeaponSpeed) != 0)
list.Add(1060486, prop.ToString()); // swing speed increase ~1_val~%
if (Core.ML && (prop = m_AosAttributes.IncreasedKarmaLoss) != 0)
if (Core.ML && (prop = Attributes.IncreasedKarmaLoss) != 0)
list.Add(1075210, prop.ToString()); // Increased Karma Loss ~1val~%
GetDamageTypes(null, out int phys, out int fire, out int cold, out int pois, out int nrgy, out int chaos,
@ -2407,7 +2405,7 @@ namespace Server.Items
else
list.Add(1061824); // one-handed weapon
if (Core.SE || m_AosWeaponAttributes.UseBestSkill == 0)
if (Core.SE || WeaponAttributes.UseBestSkill == 0)
switch (Skill)
{
case SkillName.Swords:
@ -2516,7 +2514,7 @@ namespace Server.Items
protected override void OnTick()
{
m_Mobile.EndAction(typeof(BaseWeapon));
m_Mobile.EndAction<BaseWeapon>();
}
}
@ -2574,11 +2572,6 @@ namespace Server.Items
private SkillMod m_SkillMod, m_MageMod;
private CraftResource m_Resource;
private AosAttributes m_AosAttributes;
private AosWeaponAttributes m_AosWeaponAttributes;
private AosSkillBonuses m_AosSkillBonuses;
private AosElementAttributes m_AosElementDamages;
// Overridable values. These values are provided to override the defaults which get defined in the individual weapon scripts.
private int m_StrReq, m_DexReq, m_IntReq;
private int m_MinDamage, m_MaxDamage;
@ -2635,11 +2628,11 @@ namespace Server.Items
public virtual bool CanFortify => true;
public override int PhysicalResistance => m_AosWeaponAttributes.ResistPhysicalBonus;
public override int FireResistance => m_AosWeaponAttributes.ResistFireBonus;
public override int ColdResistance => m_AosWeaponAttributes.ResistColdBonus;
public override int PoisonResistance => m_AosWeaponAttributes.ResistPoisonBonus;
public override int EnergyResistance => m_AosWeaponAttributes.ResistEnergyBonus;
public override int PhysicalResistance => WeaponAttributes.ResistPhysicalBonus;
public override int FireResistance => WeaponAttributes.ResistFireBonus;
public override int ColdResistance => WeaponAttributes.ResistColdBonus;
public override int PoisonResistance => WeaponAttributes.ResistPoisonBonus;
public override int EnergyResistance => WeaponAttributes.ResistEnergyBonus;
public virtual SkillName AccuracySkill => SkillName.Tactics;
@ -2648,32 +2641,16 @@ namespace Server.Items
#region Getters & Setters
[CommandProperty(AccessLevel.GameMaster)]
public AosAttributes Attributes
{
get => m_AosAttributes;
set { }
}
public AosAttributes Attributes{ get; private set; }
[CommandProperty(AccessLevel.GameMaster)]
public AosWeaponAttributes WeaponAttributes
{
get => m_AosWeaponAttributes;
set { }
}
public AosWeaponAttributes WeaponAttributes{ get; private set; }
[CommandProperty(AccessLevel.GameMaster)]
public AosSkillBonuses SkillBonuses
{
get => m_AosSkillBonuses;
set { }
}
public AosSkillBonuses SkillBonuses{ get; private set; }
[CommandProperty(AccessLevel.GameMaster)]
public AosElementAttributes AosElementDamages
{
get => m_AosElementDamages;
set { }
}
public AosElementAttributes AosElementDamages{ get; private set; }
[CommandProperty(AccessLevel.GameMaster)]
public bool Cursed{ get; set; }
@ -3217,12 +3194,12 @@ namespace Server.Items
SetSaveFlag(ref flags, SaveFlag.Type, m_Type != (WeaponType)(-1));
SetSaveFlag(ref flags, SaveFlag.Animation, m_Animation != (WeaponAnimation)(-1));
SetSaveFlag(ref flags, SaveFlag.Resource, m_Resource != CraftResource.Iron);
SetSaveFlag(ref flags, SaveFlag.xAttributes, !m_AosAttributes.IsEmpty);
SetSaveFlag(ref flags, SaveFlag.xWeaponAttributes, !m_AosWeaponAttributes.IsEmpty);
SetSaveFlag(ref flags, SaveFlag.xAttributes, !Attributes.IsEmpty);
SetSaveFlag(ref flags, SaveFlag.xWeaponAttributes, !WeaponAttributes.IsEmpty);
SetSaveFlag(ref flags, SaveFlag.PlayerConstructed, PlayerConstructed);
SetSaveFlag(ref flags, SaveFlag.SkillBonuses, !m_AosSkillBonuses.IsEmpty);
SetSaveFlag(ref flags, SaveFlag.SkillBonuses, !SkillBonuses.IsEmpty);
SetSaveFlag(ref flags, SaveFlag.Slayer2, m_Slayer2 != SlayerName.None);
SetSaveFlag(ref flags, SaveFlag.ElementalDamages, !m_AosElementDamages.IsEmpty);
SetSaveFlag(ref flags, SaveFlag.ElementalDamages, !AosElementDamages.IsEmpty);
SetSaveFlag(ref flags, SaveFlag.EngravedText, !string.IsNullOrEmpty(m_EngravedText));
writer.Write((int)flags);
@ -3297,19 +3274,19 @@ namespace Server.Items
writer.Write((int)m_Resource);
if (GetSaveFlag(flags, SaveFlag.xAttributes))
m_AosAttributes.Serialize(writer);
Attributes.Serialize(writer);
if (GetSaveFlag(flags, SaveFlag.xWeaponAttributes))
m_AosWeaponAttributes.Serialize(writer);
WeaponAttributes.Serialize(writer);
if (GetSaveFlag(flags, SaveFlag.SkillBonuses))
m_AosSkillBonuses.Serialize(writer);
SkillBonuses.Serialize(writer);
if (GetSaveFlag(flags, SaveFlag.Slayer2))
writer.Write((int)m_Slayer2);
if (GetSaveFlag(flags, SaveFlag.ElementalDamages))
m_AosElementDamages.Serialize(writer);
AosElementDamages.Serialize(writer);
if (GetSaveFlag(flags, SaveFlag.EngravedText))
writer.Write(m_EngravedText);
@ -3493,14 +3470,14 @@ namespace Server.Items
m_Resource = CraftResource.Iron;
if (GetSaveFlag(flags, SaveFlag.xAttributes))
m_AosAttributes = new AosAttributes(this, reader);
Attributes = new AosAttributes(this, reader);
else
m_AosAttributes = new AosAttributes(this);
Attributes = new AosAttributes(this);
if (GetSaveFlag(flags, SaveFlag.xWeaponAttributes))
m_AosWeaponAttributes = new AosWeaponAttributes(this, reader);
WeaponAttributes = new AosWeaponAttributes(this, reader);
else
m_AosWeaponAttributes = new AosWeaponAttributes(this);
WeaponAttributes = new AosWeaponAttributes(this);
if (UseSkillMod && m_AccuracyLevel != WeaponAccuracyLevel.Regular && parentMobile != null)
{
@ -3508,13 +3485,13 @@ namespace Server.Items
parentMobile.AddSkillMod(m_SkillMod);
}
if (version < 7 && m_AosWeaponAttributes.MageWeapon != 0)
m_AosWeaponAttributes.MageWeapon = 30 - m_AosWeaponAttributes.MageWeapon;
if (version < 7 && WeaponAttributes.MageWeapon != 0)
WeaponAttributes.MageWeapon = 30 - WeaponAttributes.MageWeapon;
if (Core.AOS && m_AosWeaponAttributes.MageWeapon != 0 && m_AosWeaponAttributes.MageWeapon != 30 &&
if (Core.AOS && WeaponAttributes.MageWeapon != 0 && WeaponAttributes.MageWeapon != 30 &&
parentMobile != null)
{
m_MageMod = new DefaultSkillMod(SkillName.Magery, true, -30 + m_AosWeaponAttributes.MageWeapon);
m_MageMod = new DefaultSkillMod(SkillName.Magery, true, -30 + WeaponAttributes.MageWeapon);
parentMobile.AddSkillMod(m_MageMod);
}
@ -3522,17 +3499,17 @@ namespace Server.Items
PlayerConstructed = true;
if (GetSaveFlag(flags, SaveFlag.SkillBonuses))
m_AosSkillBonuses = new AosSkillBonuses(this, reader);
SkillBonuses = new AosSkillBonuses(this, reader);
else
m_AosSkillBonuses = new AosSkillBonuses(this);
SkillBonuses = new AosSkillBonuses(this);
if (GetSaveFlag(flags, SaveFlag.Slayer2))
m_Slayer2 = (SlayerName)reader.ReadInt();
if (GetSaveFlag(flags, SaveFlag.ElementalDamages))
m_AosElementDamages = new AosElementAttributes(this, reader);
AosElementDamages = new AosElementAttributes(this, reader);
else
m_AosElementDamages = new AosElementAttributes(this);
AosElementDamages = new AosElementAttributes(this);
if (GetSaveFlag(flags, SaveFlag.EngravedText))
m_EngravedText = reader.ReadString();
@ -3573,10 +3550,10 @@ namespace Server.Items
if (version < 5)
{
m_Resource = CraftResource.Iron;
m_AosAttributes = new AosAttributes(this);
m_AosWeaponAttributes = new AosWeaponAttributes(this);
m_AosElementDamages = new AosElementAttributes(this);
m_AosSkillBonuses = new AosSkillBonuses(this);
Attributes = new AosAttributes(this);
WeaponAttributes = new AosWeaponAttributes(this);
AosElementDamages = new AosElementAttributes(this);
SkillBonuses = new AosSkillBonuses(this);
}
m_MinDamage = reader.ReadInt();
@ -3647,11 +3624,11 @@ namespace Server.Items
}
if (Core.AOS && parentMobile != null)
m_AosSkillBonuses.AddTo(parentMobile);
SkillBonuses.AddTo(parentMobile);
int strBonus = m_AosAttributes.BonusStr;
int dexBonus = m_AosAttributes.BonusDex;
int intBonus = m_AosAttributes.BonusInt;
int strBonus = Attributes.BonusStr;
int dexBonus = Attributes.BonusDex;
int intBonus = Attributes.BonusInt;
if (parentMobile != null && (strBonus != 0 || dexBonus != 0 || intBonus != 0))
{
@ -3684,4 +3661,4 @@ namespace Server.Items
Slayer,
Opposition
}
}
}

View file

@ -47,9 +47,9 @@ namespace Server.Items
public override double GetDefendSkillValue(Mobile attacker, Mobile defender)
{
double wresValue = defender.Skills[SkillName.Wrestling].Value;
double anatValue = defender.Skills[SkillName.Anatomy].Value;
double evalValue = defender.Skills[SkillName.EvalInt].Value;
double wresValue = defender.Skills.Wrestling.Value;
double anatValue = defender.Skills.Anatomy.Value;
double evalValue = defender.Skills.EvalInt.Value;
double incrValue = (anatValue + evalValue + 20.0) * 0.5;
if (incrValue > 120.0)
@ -64,10 +64,10 @@ namespace Server.Items
{
if (attacker.StunReady)
{
if (attacker.CanBeginAction(typeof(Fists)))
if (attacker.CanBeginAction<Fists>())
{
if (attacker.Skills[SkillName.Anatomy].Value >= 80.0 &&
attacker.Skills[SkillName.Wrestling].Value >= 80.0)
if (attacker.Skills.Anatomy.Value >= 80.0 &&
attacker.Skills.Wrestling.Value >= 80.0)
{
if (attacker.Stam >= 15)
{
@ -104,12 +104,12 @@ namespace Server.Items
}
else if (attacker.DisarmReady)
{
if (attacker.CanBeginAction(typeof(Fists)))
if (attacker.CanBeginAction<Fists>())
{
if (defender.Player || defender.Body.IsHuman)
{
if (attacker.Skills[SkillName.ArmsLore].Value >= 80.0 &&
attacker.Skills[SkillName.Wrestling].Value >= 80.0)
if (attacker.Skills.ArmsLore.Value >= 80.0 &&
attacker.Skills.Wrestling.Value >= 80.0)
{
if (attacker.Stam >= 15)
{
@ -196,7 +196,7 @@ namespace Server.Items
private static bool CheckMove(Mobile m, SkillName other)
{
double wresValue = m.Skills[SkillName.Wrestling].Value;
double wresValue = m.Skills.Wrestling.Value;
double scndValue = m.Skills[other].Value;
/* 40% chance at 80, 80
@ -233,8 +233,8 @@ namespace Server.Items
#endregion
double armsValue = m.Skills[SkillName.ArmsLore].Value;
double wresValue = m.Skills[SkillName.Wrestling].Value;
double armsValue = m.Skills.ArmsLore.Value;
double wresValue = m.Skills.Wrestling.Value;
if (!HasFreeHands(m))
{
@ -268,8 +268,8 @@ namespace Server.Items
#endregion
double anatValue = m.Skills[SkillName.Anatomy].Value;
double wresValue = m.Skills[SkillName.Wrestling].Value;
double anatValue = m.Skills.Anatomy.Value;
double wresValue = m.Skills.Wrestling.Value;
if (!HasFreeHands(m))
{
@ -304,12 +304,12 @@ namespace Server.Items
Priority = TimerPriority.TwoFiftyMS;
m_Mobile.BeginAction(typeof(Fists));
m_Mobile.BeginAction<Fists>();
}
protected override void OnTick()
{
m_Mobile.EndAction(typeof(Fists));
m_Mobile.EndAction<Fists>();
}
}
}

View file

@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
namespace Server.Items
{
@ -8,13 +9,12 @@ namespace Server.Items
public static readonly TimeSpan AttackEffectDuration = TimeSpan.FromSeconds(10.0);
public static readonly TimeSpan DefenseEffectDuration = TimeSpan.FromSeconds(8.0);
private static Hashtable m_AttackTable = new Hashtable();
private static Hashtable m_DefenseTable = new Hashtable();
private static Dictionary<Mobile, AttackTimer> m_AttackTable = new Dictionary<Mobile, AttackTimer>();
private static Dictionary<Mobile, DefenseTimer> m_DefenseTable = new Dictionary<Mobile, DefenseTimer>();
public static bool IsUnderAttackEffect(Mobile m)
{
return m_AttackTable.Contains(m);
return m_AttackTable.ContainsKey(m);
}
public static bool ApplyAttack(Mobile m)
@ -35,7 +35,7 @@ namespace Server.Items
public static bool IsUnderDefenseEffect(Mobile m)
{
return m_DefenseTable.Contains(m);
return m_DefenseTable.ContainsKey(m);
}
public static bool ApplyDefense(Mobile m)
@ -92,4 +92,4 @@ namespace Server.Items
}
}
}
}
}

View file

@ -45,8 +45,8 @@ namespace Server.Items
double damage = base.GetBaseDamage(attacker);
if (!Core.AOS && (attacker.Player || attacker.Body.IsHuman) && Layer == Layer.TwoHanded &&
attacker.Skills[SkillName.Anatomy].Value >= 80 &&
attacker.Skills[SkillName.Anatomy].Value / 400.0 >= Utility.RandomDouble() &&
attacker.Skills.Anatomy.Value >= 80 &&
attacker.Skills.Anatomy.Value / 400.0 >= Utility.RandomDouble() &&
DuelContext.AllowSpecialAbility(attacker, "Crushing Blow", false))
{
damage *= 1.5;

View file

@ -78,18 +78,11 @@ namespace Server.Items
Effects.SendMovingEffect(new Entity(Serial.Zero, startLoc, map), new Entity(Serial.Zero, endLoc, map),
0x36E4, 5, 0, false, false);
Timer.DelayCall(TimeSpan.FromSeconds(1.0), new TimerStateCallback(FinishLaunch),
new object[] { from, endLoc, map });
Timer.DelayCall(TimeSpan.FromSeconds(1.0), () => FinishLaunch(endLoc, map));
}
private void FinishLaunch(object state)
private void FinishLaunch(Point3D endLoc, Map map)
{
object[] states = (object[])state;
Mobile from = (Mobile)states[0];
Point3D endLoc = (Point3D)states[1];
Map map = (Map)states[2];
int hue = Utility.Random(40);
if (hue < 8)

View file

@ -115,8 +115,8 @@ namespace Server.Items
base.OnHit(attacker, defender, damageBonus);
if (!Core.AOS && (attacker.Player || attacker.Body.IsHuman) && Layer == Layer.TwoHanded &&
attacker.Skills[SkillName.Anatomy].Value >= 80 &&
attacker.Skills[SkillName.Anatomy].Value / 400.0 >= Utility.RandomDouble() &&
attacker.Skills.Anatomy.Value >= 80 &&
attacker.Skills.Anatomy.Value / 400.0 >= Utility.RandomDouble() &&
DuelContext.AllowSpecialAbility(attacker, "Concussion Blow", false))
{
StatMod mod = defender.GetStatMod("Concussion");

View file

@ -33,7 +33,7 @@ namespace Server.Items
{
from.SendMessage("This must be in your backpack to modify it.");
}
else if (from.Skills[SkillName.Fletching].Base < 100.0)
else if (from.Skills.Fletching.Base < 100.0)
{
from.SendMessage("Only a grandmaster bowcrafter can modify this weapon.");
}
@ -59,7 +59,7 @@ namespace Server.Items
{
from.SendMessage("This must be in your backpack to modify it.");
}
else if (from.Skills[SkillName.Fletching].Base < 100.0)
else if (from.Skills.Fletching.Base < 100.0)
{
from.SendMessage("Only a grandmaster bowcrafter can modify this weapon.");
}

View file

@ -39,7 +39,7 @@ namespace Server.Items
base.OnHit(attacker, defender, damageBonus);
if (!Core.AOS && Layer == Layer.TwoHanded &&
attacker.Skills[SkillName.Anatomy].Value / 400.0 >= Utility.RandomDouble() &&
attacker.Skills.Anatomy.Value / 400.0 >= Utility.RandomDouble() &&
DuelContext.AllowSpecialAbility(attacker, "Paralyzing Blow", false))
{
defender.SendMessage("You receive a paralyzing blow!"); // Is this not localized?

View file

@ -145,7 +145,7 @@ namespace Server.Items
double min = m_Creature.MinTameSkill - 30;
double max = m_Creature.MinTameSkill + 30 + Utility.Random(10);
if (max <= from.Skills[SkillName.Herding].Value)
if (max <= from.Skills.Herding.Value)
m_Creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502471,
from.NetState); // That wasn't even challenging.