Adds style cop (#109)

This commit is contained in:
Kamron Batman 2020-04-26 00:16:02 -07:00 committed by GitHub
parent 3e715bcb60
commit 556a17aba8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1725 changed files with 33831 additions and 38046 deletions

View file

@ -6,7 +6,7 @@ namespace Server.Targets
{
public class AIControlMobileTarget : Target
{
private List<BaseAI> m_List;
private readonly List<BaseAI> m_List;
public AIControlMobileTarget(BaseAI ai, OrderType order) : base(-1, false,
order == OrderType.Attack ? TargetFlags.Harmful : TargetFlags.None)
@ -17,7 +17,7 @@ namespace Server.Targets
AddAI(ai);
}
public OrderType Order{ get; }
public OrderType Order { get; }
public void AddAI(BaseAI ai)
{

View file

@ -1,6 +1,6 @@
// Ideas
// When you run on animals the panic
// When if ( distance < 8 && Utility.RandomDouble() * Math.Sqrt( (8 - distance) / 6 ) >= incoming.Skills.AnimalTaming.Value )
// When if (distance < 8 && Utility.RandomDouble() * Math.Sqrt( (8 - distance) / 6 ) >= incoming.Skills.AnimalTaming.Value)
// More your close, the more it can panic
/*
* AnimalHunterAI, AnimalHidingAI, AnimalDomesticAI...

View file

@ -74,7 +74,6 @@ namespace Server.Mobiles
return true;
}
// At 20% we should check if we must leave
if (m_Mobile.Hits < m_Mobile.HitsMax * 20 / 100 && m_Mobile.CanFlee)
{

View file

@ -42,7 +42,7 @@ namespace Server.Mobiles
public abstract class BaseAI
{
private static SkillName[] m_KeywordTable =
private static readonly SkillName[] m_KeywordTable =
{
SkillName.Parry,
SkillName.Healing,
@ -61,7 +61,7 @@ namespace Server.Mobiles
SkillName.Cartography,
SkillName.Cooking,
SkillName.DetectHidden,
SkillName.Discordance, //??
SkillName.Discordance, // ??
SkillName.EvalInt,
SkillName.Fishing,
SkillName.Provocation,
@ -94,7 +94,7 @@ namespace Server.Mobiles
SkillName.Meditation
};
private static Queue<Item> m_Obstacles = new Queue<Item>();
private static readonly Queue<Item> m_Obstacles = new Queue<Item>();
protected ActionType m_Action;
public BaseCreature m_Mobile;
@ -138,7 +138,7 @@ namespace Server.Mobiles
}
}
public long NextMove{ get; set; }
public long NextMove { get; set; }
public virtual bool CanDetectHidden => m_Mobile.Skills.DetectHidden.Value > 0;
@ -433,76 +433,76 @@ namespace Server.Mobiles
switch (keyword)
{
case 0x164: // all come
{
if (!isOwner)
break;
if (m_Mobile.CheckControlChance(e.Mobile))
{
m_Mobile.ControlTarget = null;
m_Mobile.ControlOrder = OrderType.Come;
}
if (!isOwner)
break;
return;
}
if (m_Mobile.CheckControlChance(e.Mobile))
{
m_Mobile.ControlTarget = null;
m_Mobile.ControlOrder = OrderType.Come;
}
return;
}
case 0x165: // all follow
{
BeginPickTarget(e.Mobile, OrderType.Follow);
return;
}
{
BeginPickTarget(e.Mobile, OrderType.Follow);
return;
}
case 0x166: // all guard
case 0x16B: // all guard me
{
if (!isOwner)
break;
if (m_Mobile.CheckControlChance(e.Mobile))
{
m_Mobile.ControlTarget = null;
m_Mobile.ControlOrder = OrderType.Guard;
}
if (!isOwner)
break;
return;
}
if (m_Mobile.CheckControlChance(e.Mobile))
{
m_Mobile.ControlTarget = null;
m_Mobile.ControlOrder = OrderType.Guard;
}
return;
}
case 0x167: // all stop
{
if (m_Mobile.CheckControlChance(e.Mobile))
{
m_Mobile.ControlTarget = null;
m_Mobile.ControlOrder = OrderType.Stop;
}
if (m_Mobile.CheckControlChance(e.Mobile))
{
m_Mobile.ControlTarget = null;
m_Mobile.ControlOrder = OrderType.Stop;
}
return;
}
return;
}
case 0x168: // all kill
case 0x169: // all attack
{
if (!isOwner)
break;
{
if (!isOwner)
break;
BeginPickTarget(e.Mobile, OrderType.Attack);
return;
}
BeginPickTarget(e.Mobile, OrderType.Attack);
return;
}
case 0x16C: // all follow me
{
if (m_Mobile.CheckControlChance(e.Mobile))
{
m_Mobile.ControlTarget = e.Mobile;
m_Mobile.ControlOrder = OrderType.Follow;
}
if (m_Mobile.CheckControlChance(e.Mobile))
{
m_Mobile.ControlTarget = e.Mobile;
m_Mobile.ControlOrder = OrderType.Follow;
}
return;
}
return;
}
case 0x170: // all stay
{
if (m_Mobile.CheckControlChance(e.Mobile))
{
m_Mobile.ControlTarget = null;
m_Mobile.ControlOrder = OrderType.Stay;
}
if (m_Mobile.CheckControlChance(e.Mobile))
{
m_Mobile.ControlTarget = null;
m_Mobile.ControlOrder = OrderType.Stay;
}
return;
}
return;
}
}
}
@ -514,164 +514,164 @@ namespace Server.Mobiles
switch (keyword)
{
case 0x155: // *come
{
if (!isOwner)
break;
if (WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
{
m_Mobile.ControlTarget = null;
m_Mobile.ControlOrder = OrderType.Come;
}
if (!isOwner)
break;
return;
}
case 0x156: // *drop
{
if (!isOwner)
break;
if (!m_Mobile.IsDeadPet && !m_Mobile.Summoned && WasNamed(speech) &&
m_Mobile.CheckControlChance(e.Mobile))
{
m_Mobile.ControlTarget = null;
m_Mobile.ControlOrder = OrderType.Drop;
}
return;
}
case 0x15A: // *follow
{
if (WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
BeginPickTarget(e.Mobile, OrderType.Follow);
return;
}
case 0x15B: // *friend
{
if (!isOwner)
break;
if (WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
{
if (m_Mobile.Summoned || m_Mobile is GrizzledMare)
e.Mobile.SendLocalizedMessage(
1005481); // Summoned creatures are loyal only to their summoners.
else if (e.Mobile.HasTrade)
e.Mobile.SendLocalizedMessage(
1070947); // You cannot friend a pet with a trade pending
else
BeginPickTarget(e.Mobile, OrderType.Friend);
}
return;
}
case 0x15C: // *guard
{
if (!isOwner)
break;
if (!m_Mobile.IsDeadPet && WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
{
m_Mobile.ControlTarget = null;
m_Mobile.ControlOrder = OrderType.Guard;
}
return;
}
case 0x15D: // *kill
case 0x15E: // *attack
{
if (!isOwner)
break;
if (!m_Mobile.IsDeadPet && WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
BeginPickTarget(e.Mobile, OrderType.Attack);
return;
}
case 0x15F: // *patrol
{
if (!isOwner)
break;
if (WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
{
m_Mobile.ControlTarget = null;
m_Mobile.ControlOrder = OrderType.Patrol;
}
return;
}
case 0x161: // *stop
{
if (WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
{
m_Mobile.ControlTarget = null;
m_Mobile.ControlOrder = OrderType.Stop;
}
return;
}
case 0x163: // *follow me
{
if (WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
{
m_Mobile.ControlTarget = e.Mobile;
m_Mobile.ControlOrder = OrderType.Follow;
}
return;
}
case 0x16D: // *release
{
if (!isOwner)
break;
if (WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
{
if (!m_Mobile.Summoned)
{
e.Mobile.SendGump(new ConfirmReleaseGump(e.Mobile, m_Mobile));
}
else
if (WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
{
m_Mobile.ControlTarget = null;
m_Mobile.ControlOrder = OrderType.Release;
m_Mobile.ControlOrder = OrderType.Come;
}
}
return;
}
return;
}
case 0x156: // *drop
{
if (!isOwner)
break;
if (!m_Mobile.IsDeadPet && !m_Mobile.Summoned && WasNamed(speech) &&
m_Mobile.CheckControlChance(e.Mobile))
{
m_Mobile.ControlTarget = null;
m_Mobile.ControlOrder = OrderType.Drop;
}
return;
}
case 0x15A: // *follow
{
if (WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
BeginPickTarget(e.Mobile, OrderType.Follow);
return;
}
case 0x15B: // *friend
{
if (!isOwner)
break;
if (WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
{
if (m_Mobile.Summoned || m_Mobile is GrizzledMare)
e.Mobile.SendLocalizedMessage(
1005481); // Summoned creatures are loyal only to their summoners.
else if (e.Mobile.HasTrade)
e.Mobile.SendLocalizedMessage(
1070947); // You cannot friend a pet with a trade pending
else
BeginPickTarget(e.Mobile, OrderType.Friend);
}
return;
}
case 0x15C: // *guard
{
if (!isOwner)
break;
if (!m_Mobile.IsDeadPet && WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
{
m_Mobile.ControlTarget = null;
m_Mobile.ControlOrder = OrderType.Guard;
}
return;
}
case 0x15D: // *kill
case 0x15E: // *attack
{
if (!isOwner)
break;
if (!m_Mobile.IsDeadPet && WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
BeginPickTarget(e.Mobile, OrderType.Attack);
return;
}
case 0x15F: // *patrol
{
if (!isOwner)
break;
if (WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
{
m_Mobile.ControlTarget = null;
m_Mobile.ControlOrder = OrderType.Patrol;
}
return;
}
case 0x161: // *stop
{
if (WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
{
m_Mobile.ControlTarget = null;
m_Mobile.ControlOrder = OrderType.Stop;
}
return;
}
case 0x163: // *follow me
{
if (WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
{
m_Mobile.ControlTarget = e.Mobile;
m_Mobile.ControlOrder = OrderType.Follow;
}
return;
}
case 0x16D: // *release
{
if (!isOwner)
break;
if (WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
{
if (!m_Mobile.Summoned)
{
e.Mobile.SendGump(new ConfirmReleaseGump(e.Mobile, m_Mobile));
}
else
{
m_Mobile.ControlTarget = null;
m_Mobile.ControlOrder = OrderType.Release;
}
}
return;
}
case 0x16E: // *transfer
{
if (!isOwner)
break;
if (!m_Mobile.IsDeadPet && WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
{
if (m_Mobile.Summoned || m_Mobile is GrizzledMare)
e.Mobile.SendLocalizedMessage(
1005487); // You cannot transfer ownership of a summoned creature.
else if (e.Mobile.HasTrade)
e.Mobile.SendLocalizedMessage(
1010507); // You cannot transfer a pet with a trade pending
else
BeginPickTarget(e.Mobile, OrderType.Transfer);
}
if (!isOwner)
break;
return;
}
if (!m_Mobile.IsDeadPet && WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
{
if (m_Mobile.Summoned || m_Mobile is GrizzledMare)
e.Mobile.SendLocalizedMessage(
1005487); // You cannot transfer ownership of a summoned creature.
else if (e.Mobile.HasTrade)
e.Mobile.SendLocalizedMessage(
1010507); // You cannot transfer a pet with a trade pending
else
BeginPickTarget(e.Mobile, OrderType.Transfer);
}
return;
}
case 0x16F: // *stay
{
if (WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
{
m_Mobile.ControlTarget = null;
m_Mobile.ControlOrder = OrderType.Stay;
}
if (WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
{
m_Mobile.ControlTarget = null;
m_Mobile.ControlOrder = OrderType.Stay;
}
return;
}
return;
}
}
}
}
@ -864,7 +864,7 @@ namespace Server.Mobiles
else if (Core.TickCount - m_NextStopGuard < 0)
{
m_Mobile.DebugSay("I am on guard");
//m_Mobile.Turn( Utility.Random(0, 2) - 1 );
// m_Mobile.Turn( Utility.Random(0, 2) - 1 );
}
else
{
@ -970,7 +970,7 @@ namespace Server.Mobiles
m_Mobile.Warmode = true;
m_Mobile.Combatant = null;
string petname = $"{m_Mobile.Name}";
m_Mobile.ControlMaster.SendLocalizedMessage(1049671, petname); //~1_PETNAME~ is now guarding you.
m_Mobile.ControlMaster.SendLocalizedMessage(1049671, petname); // ~1_PETNAME~ is now guarding you.
break;
case OrderType.Attack:
@ -1341,7 +1341,7 @@ namespace Server.Mobiles
if (attacker?.Deleted == false &&
attacker.GetDistanceToSqrt(m_Mobile) <= m_Mobile.RangePerception)
if (combatant == null || attacker.GetDistanceToSqrt(controlMaster) <
combatant.GetDistanceToSqrt(controlMaster))
combatant.GetDistanceToSqrt(controlMaster))
combatant = attacker;
}
@ -1483,7 +1483,7 @@ namespace Server.Mobiles
else
m_Mobile.DebugSay("My master told me to stay");
//m_Mobile.Direction = m_Mobile.GetDirectionTo( m_Mobile.ControlMaster );
// m_Mobile.Direction = m_Mobile.GetDirectionTo( m_Mobile.ControlMaster );
return true;
}
@ -1759,7 +1759,7 @@ namespace Server.Mobiles
MoveResult res = DoMoveImpl(d);
return res == MoveResult.Success || res == MoveResult.SuccessAutoTurn ||
badStateOk && res == MoveResult.BadState;
(badStateOk && res == MoveResult.BadState);
}
public virtual MoveResult DoMoveImpl(Direction d)
@ -2257,7 +2257,7 @@ namespace Server.Mobiles
if (bFacFriend && !m_Mobile.IsFriend(m))
continue;
//Ignore anyone under EtherealVoyage
// Ignore anyone under EtherealVoyage
if (TransformationSpellHelper.UnderTransformation(m, typeof(EtherealVoyageSpell)))
continue;
@ -2329,7 +2329,6 @@ namespace Server.Mobiles
return false;
}
public virtual void DetectHidden()
{
if (m_Mobile.Deleted || m_Mobile.Map == null)
@ -2422,10 +2421,10 @@ namespace Server.Mobiles
private class InternalEntry : ContextMenuEntry
{
private BaseAI m_AI;
private Mobile m_From;
private BaseCreature m_Mobile;
private OrderType m_Order;
private readonly BaseAI m_AI;
private readonly Mobile m_From;
private readonly BaseCreature m_Mobile;
private readonly OrderType m_Order;
public InternalEntry(Mobile from, int number, int range, BaseCreature mobile, BaseAI ai, OrderType order)
: base(number, range)
@ -2463,31 +2462,31 @@ namespace Server.Mobiles
case OrderType.Transfer:
case OrderType.Friend:
case OrderType.Unfriend:
{
if (m_Order == OrderType.Transfer && m_From.HasTrade)
m_From.SendLocalizedMessage(1010507); // You cannot transfer a pet with a trade pending
else if (m_Order == OrderType.Friend && m_From.HasTrade)
m_From.SendLocalizedMessage(1070947); // You cannot friend a pet with a trade pending
else
m_AI.BeginPickTarget(m_From, m_Order);
{
if (m_Order == OrderType.Transfer && m_From.HasTrade)
m_From.SendLocalizedMessage(1010507); // You cannot transfer a pet with a trade pending
else if (m_Order == OrderType.Friend && m_From.HasTrade)
m_From.SendLocalizedMessage(1070947); // You cannot friend a pet with a trade pending
else
m_AI.BeginPickTarget(m_From, m_Order);
break;
}
break;
}
case OrderType.Release:
{
if (m_Mobile.Summoned)
goto default;
m_From.SendGump(new ConfirmReleaseGump(m_From, m_Mobile));
{
if (m_Mobile.Summoned)
goto default;
m_From.SendGump(new ConfirmReleaseGump(m_From, m_Mobile));
break;
}
break;
}
default:
{
if (m_Mobile.CheckControlChance(m_From))
m_Mobile.ControlOrder = m_Order;
{
if (m_Mobile.CheckControlChance(m_From))
m_Mobile.ControlOrder = m_Order;
break;
}
break;
}
}
}
}
@ -2495,7 +2494,7 @@ namespace Server.Mobiles
private class TransferItem : Item
{
private BaseCreature m_Creature;
private readonly BaseCreature m_Creature;
public TransferItem(BaseCreature creature)
: base(ShrinkTable.Lookup(creature))
@ -2510,7 +2509,7 @@ namespace Server.Mobiles
creature.GetType().IsDefined(typeof(FriendlyNameAttribute), false) || creature is Reptalon)
Name = FriendlyNameAttribute.GetFriendlyNameFor(creature.GetType()).ToString();
//(As Per OSI)No name. Normally, set by the ItemID of the Shrink Item unless we either explicitly set it with an Attribute, or, no lookup found
// (As Per OSI)No name. Normally, set by the ItemID of the Shrink Item unless we either explicitly set it with an Attribute, or, no lookup found
Hue = creature.Hue & 0x0FFF;
}
@ -2652,7 +2651,7 @@ namespace Server.Mobiles
*/
private class AITimer : Timer
{
private BaseAI m_Owner;
private readonly BaseAI m_Owner;
public AITimer(BaseAI owner)
: base(TimeSpan.FromSeconds(Utility.RandomDouble()),
@ -2679,7 +2678,7 @@ namespace Server.Mobiles
return;
}
if (m_Owner.m_Mobile.PlayerRangeSensitive) //have to check this in the timer....
if (m_Owner.m_Mobile.PlayerRangeSensitive) // have to check this in the timer....
{
Sector sect = m_Owner.m_Mobile.Map.GetSector(m_Owner.m_Mobile);
if (!sect.Active)

View file

@ -8,13 +8,13 @@ namespace Server.Mobiles
{
public class HealerAI : BaseAI
{
private static NeedDelegate m_Cure = NeedCure;
private static NeedDelegate m_GHeal = NeedGHeal;
private static NeedDelegate m_LHeal = NeedLHeal;
private static NeedDelegate[] m_ACure = { m_Cure };
private static NeedDelegate[] m_AGHeal = { m_GHeal };
private static NeedDelegate[] m_ALHeal = { m_LHeal };
private static NeedDelegate[] m_All = { m_Cure, m_GHeal, m_LHeal };
private static readonly NeedDelegate m_Cure = NeedCure;
private static readonly NeedDelegate m_GHeal = NeedGHeal;
private static readonly NeedDelegate m_LHeal = NeedLHeal;
private static readonly NeedDelegate[] m_ACure = { m_Cure };
private static readonly NeedDelegate[] m_AGHeal = { m_GHeal };
private static readonly NeedDelegate[] m_ALHeal = { m_LHeal };
private static readonly NeedDelegate[] m_All = { m_Cure, m_GHeal, m_LHeal };
public HealerAI(BaseCreature m) : base(m)
{

View file

@ -19,7 +19,7 @@ namespace Server.Mobiles
private const double TeleportChance = 0.05; // 5% chance to teleport at gm magery
private const double DispelChance = 0.75; // 75% chance to dispel at gm magery
private static int[] m_Offsets =
private static readonly int[] m_Offsets =
{
-1, -1,
-1, 0,
@ -392,64 +392,64 @@ namespace Server.Mobiles
{
case 0:
case 1: // Poison them
{
if (c.Poisoned)
goto default;
{
if (c.Poisoned)
goto default;
m_Mobile.DebugSay("Attempting to poison");
m_Mobile.DebugSay("Attempting to poison");
spell = new PoisonSpell(m_Mobile);
break;
}
spell = new PoisonSpell(m_Mobile);
break;
}
case 2: // Bless ourselves
{
m_Mobile.DebugSay("Blessing myself");
{
m_Mobile.DebugSay("Blessing myself");
spell = new BlessSpell(m_Mobile);
break;
}
spell = new BlessSpell(m_Mobile);
break;
}
case 3:
case 4: // Curse them
{
m_Mobile.DebugSay("Attempting to curse");
{
m_Mobile.DebugSay("Attempting to curse");
spell = GetRandomCurseSpell();
break;
}
spell = GetRandomCurseSpell();
break;
}
case 5: // Paralyze them
{
if (c.Paralyzed || m_Mobile.Skills.Magery.Value <= 50.0)
goto default;
{
if (c.Paralyzed || m_Mobile.Skills.Magery.Value <= 50.0)
goto default;
m_Mobile.DebugSay("Attempting to paralyze");
m_Mobile.DebugSay("Attempting to paralyze");
spell = new ParalyzeSpell(m_Mobile);
break;
}
spell = new ParalyzeSpell(m_Mobile);
break;
}
case 6: // Drain mana
{
m_Mobile.DebugSay("Attempting to drain mana");
{
m_Mobile.DebugSay("Attempting to drain mana");
spell = GetRandomManaDrainSpell();
break;
}
spell = GetRandomManaDrainSpell();
break;
}
case 7: // Invis ourselves
{
if (Utility.RandomBool())
goto default;
{
if (Utility.RandomBool())
goto default;
m_Mobile.DebugSay("Attempting to invis myself");
m_Mobile.DebugSay("Attempting to invis myself");
spell = new InvisibilitySpell(m_Mobile);
break;
}
spell = new InvisibilitySpell(m_Mobile);
break;
}
default: // Damage them
{
m_Mobile.DebugSay("Just doing damage");
{
m_Mobile.DebugSay("Just doing damage");
spell = GetRandomDamageSpell();
break;
}
spell = GetRandomDamageSpell();
break;
}
}
return spell;
@ -463,50 +463,50 @@ namespace Server.Mobiles
switch (Utility.Random(3))
{
case 0: // Poison them
{
if (c.Poisoned)
goto case 1;
{
if (c.Poisoned)
goto case 1;
spell = new PoisonSpell(m_Mobile);
break;
}
spell = new PoisonSpell(m_Mobile);
break;
}
case 1: // Deal some damage
{
spell = GetRandomDamageSpell();
{
spell = GetRandomDamageSpell();
break;
}
break;
}
default: // Set up a combo
{
if (m_Mobile.Mana > 15 && m_Mobile.Mana < 40)
{
if (c.Paralyzed && !c.Poisoned && !m_Mobile.Meditating)
if (m_Mobile.Mana > 15 && m_Mobile.Mana < 40)
{
m_Mobile.DebugSay("I am going to meditate");
if (c.Paralyzed && !c.Poisoned && !m_Mobile.Meditating)
{
m_Mobile.DebugSay("I am going to meditate");
m_Mobile.UseSkill(SkillName.Meditation);
m_Mobile.UseSkill(SkillName.Meditation);
}
else if (!c.Poisoned)
{
spell = new ParalyzeSpell(m_Mobile);
}
}
else if (!c.Poisoned)
else if (m_Mobile.Mana > 60)
{
spell = new ParalyzeSpell(m_Mobile);
if (Utility.RandomBool() && !c.Paralyzed && !c.Frozen && !c.Poisoned)
{
m_Combo = 0;
spell = new ParalyzeSpell(m_Mobile);
}
else
{
m_Combo = 1;
spell = new ExplosionSpell(m_Mobile);
}
}
}
else if (m_Mobile.Mana > 60)
{
if (Utility.RandomBool() && !c.Paralyzed && !c.Frozen && !c.Poisoned)
{
m_Combo = 0;
spell = new ParalyzeSpell(m_Mobile);
}
else
{
m_Combo = 1;
spell = new ExplosionSpell(m_Mobile);
}
}
break;
}
break;
}
}
return spell;
@ -541,34 +541,34 @@ namespace Server.Mobiles
switch (Utility.Random(IsNecromancer ? 4 : 3))
{
case 0:
{
if (c.Int < c.Dex)
spell = new FeeblemindSpell(m_Mobile);
else
spell = new ClumsySpell(m_Mobile);
{
if (c.Int < c.Dex)
spell = new FeeblemindSpell(m_Mobile);
else
spell = new ClumsySpell(m_Mobile);
++m_Combo; // Move to next spell
++m_Combo; // Move to next spell
break;
}
break;
}
case 1:
{
spell = new EnergyBoltSpell(m_Mobile);
m_Combo = -1; // Reset combo state
break;
}
{
spell = new EnergyBoltSpell(m_Mobile);
m_Combo = -1; // Reset combo state
break;
}
case 2:
{
spell = new FlameStrikeSpell(m_Mobile);
m_Combo = -1; // Reset combo state
break;
}
{
spell = new FlameStrikeSpell(m_Mobile);
m_Combo = -1; // Reset combo state
break;
}
default:
{
spell = new PainSpikeSpell(m_Mobile);
m_Combo = -1; // Reset combo state
break;
}
{
spell = new PainSpikeSpell(m_Mobile);
m_Combo = -1; // Reset combo state
break;
}
}
}
else if (m_Combo == 4 && spell == null)
@ -711,8 +711,7 @@ namespace Server.Mobiles
{
spell = DoCombo(c);
}
else if (SmartAI && (c.Spell is HealSpell || c.Spell is GreaterHealSpell) && !c.Poisoned
) // They have a heal spell out
else if (SmartAI && (c.Spell is HealSpell || c.Spell is GreaterHealSpell) && !c.Poisoned) // They have a heal spell out
{
spell = new PoisonSpell(m_Mobile);
}

View file

@ -1,8 +1,3 @@
//
// This is a first simple AI
//
//
namespace Server.Mobiles
{
public class MeleeAI : BaseAI
@ -70,9 +65,9 @@ namespace Server.Mobiles
}
}
/*if ( !m_Mobile.InLOS( combatant ) )
/*if (!m_Mobile.InLOS( combatant ))
{
if ( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
if (AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ))
{
m_Mobile.Combatant = combatant = m_Mobile.FocusMob;
m_Mobile.FocusMob = null;

View file

@ -5,11 +5,11 @@ namespace Server
{
public class OppositionGroup
{
private Type[][] m_Types;
private readonly Type[][] m_Types;
public OppositionGroup(Type[][] types) => m_Types = types;
public static OppositionGroup TerathansAndOphidians{ get; } = new OppositionGroup(new[]
public static OppositionGroup TerathansAndOphidians { get; } = new OppositionGroup(new[]
{
new[]
{
@ -28,7 +28,7 @@ namespace Server
}
});
public static OppositionGroup SavagesAndOrcs{ get; } = new OppositionGroup(new[]
public static OppositionGroup SavagesAndOrcs { get; } = new OppositionGroup(new[]
{
new[]
{
@ -49,7 +49,7 @@ namespace Server
}
});
public static OppositionGroup FeyAndUndead{ get; } = new OppositionGroup(new[]
public static OppositionGroup FeyAndUndead { get; } = new OppositionGroup(new[]
{
new[]
{

View file

@ -1,9 +1,3 @@
/*
* PredatorAI, its an animal that can attack
* Dont flee but dont attack if not hurt or attacked
*
*/
namespace Server.Mobiles
{
public class PredatorAI : BaseAI

View file

@ -8,11 +8,11 @@ namespace Server
public class SpeedInfo
{
// Should we use the new method of speeds?
private static bool Enabled = true;
private static readonly bool Enabled = true;
private static Dictionary<Type, SpeedInfo> m_Table;
private static SpeedInfo[] m_Speeds =
private static readonly SpeedInfo[] m_Speeds =
{
/* Slow */
new SpeedInfo(0.3, 0.6, new[]
@ -43,11 +43,7 @@ namespace Server
typeof(DemonKnight), typeof(GiantBlackWidow), typeof(SummonedAirElemental),
typeof(LesserHiryu), typeof(Hiryu), typeof(LadyOfTheSnow),
typeof(RaiJu), typeof(Ronin), typeof(RuneBeetle),
typeof(Changeling),
#region ML named mobs - before Paragon speedboost
typeof(LadyJennifyr), typeof(LadyMarai), typeof(MasterJonath),
typeof(Changeling), typeof(LadyJennifyr), typeof(LadyMarai), typeof(MasterJonath),
typeof(MasterMikael), typeof(MasterTheophilus), typeof(RedDeath),
typeof(SirPatrick), typeof(Miasma), typeof(Rend),
typeof(Grobu), typeof(Gnaw), typeof(Guile),
@ -55,8 +51,6 @@ namespace Server
typeof(LadySabrix), typeof(Malefic), typeof(Silk),
typeof(Virulent)
// TODO: Where to put Lurg, Putrefier, Swoop and Pyre? They seem slower.
#endregion
}),
/* Very Fast */
new SpeedInfo(0.175, 0.350, new[]
@ -155,11 +149,11 @@ namespace Server
Types = types;
}
public double ActiveSpeed{ get; set; }
public double ActiveSpeed { get; set; }
public double PassiveSpeed{ get; set; }
public double PassiveSpeed { get; set; }
public Type[] Types{ get; set; }
public Type[] Types { get; set; }
public static bool Contains(object obj)
{

View file

@ -1,10 +1,5 @@
using Server.Items;
//
// This is a first simple AI
//
//
namespace Server.Mobiles
{
public class ThiefAI : BaseAI

View file

@ -1,8 +1,3 @@
//
// This is a first simple AI
//
//
namespace Server.Mobiles
{
public class VendorAI : BaseAI

View file

@ -41,7 +41,6 @@ namespace Server.Mobiles
public override int Meat => 1;
public override int Feathers => 25;
public override int GetAngerSound() => 0x4D9;
public override int GetIdleSound() => 0x4D8;

View file

@ -8,7 +8,7 @@ namespace Server.Mobiles
Body = Utility.RandomList(0xE8, 0xE9);
BaseSoundID = 0x64;
if (0.5 >= Utility.RandomDouble())
if (Utility.RandomDouble() <= 0.5)
Hue = 0x901;
SetStr(77, 111);

View file

@ -49,10 +49,10 @@ namespace Server.Mobiles
public override string CorpseName => "a cow corpse";
[CommandProperty(AccessLevel.GameMaster)]
public DateTime MilkedOn{ get; set; }
public DateTime MilkedOn { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public int Milk{ get; set; }
public int Milk { get; set; }
public override string DefaultName => "a cow";

View file

@ -78,8 +78,6 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
#region Pack Animal Methods
public override bool OnBeforeDeath()
{
if (!base.OnBeforeDeath())
@ -129,14 +127,12 @@ namespace Server.Mobiles
PackAnimal.GetContextMenuEntries(this, from, list);
}
#endregion
}
public class PackAnimalBackpackEntry : ContextMenuEntry
{
private BaseCreature m_Animal;
private Mobile m_From;
private readonly BaseCreature m_Animal;
private readonly Mobile m_From;
public PackAnimalBackpackEntry(BaseCreature animal, Mobile from) : base(6145, 3)
{

View file

@ -77,8 +77,6 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
#region Pack Animal Methods
public override bool OnBeforeDeath()
{
if (!base.OnBeforeDeath())
@ -128,7 +126,5 @@ namespace Server.Mobiles
PackAnimal.GetContextMenuEntries(this, from, list);
}
#endregion
}
}

View file

@ -105,10 +105,10 @@ namespace Server.Mobiles
switch (version)
{
case 1:
{
NextWoolTime = reader.ReadDeltaTime();
break;
}
{
NextWoolTime = reader.ReadDeltaTime();
break;
}
}
}
}

View file

@ -28,9 +28,9 @@ namespace Server.Mobiles
public virtual TimeSpan MountAbilityDelay => TimeSpan.Zero;
[CommandProperty(AccessLevel.GameMaster)]
public DateTime NextMountAbility{ get; set; }
public DateTime NextMountAbility { get; set; }
protected Item InternalItem{ get; private set; }
protected Item InternalItem { get; private set; }
public virtual bool AllowMaleRider => true;
public virtual bool AllowFemaleRider => true;
@ -160,20 +160,20 @@ namespace Server.Mobiles
switch (version)
{
case 1:
{
NextMountAbility = reader.ReadDateTime();
goto case 0;
}
{
NextMountAbility = reader.ReadDateTime();
goto case 0;
}
case 0:
{
m_Rider = reader.ReadMobile();
InternalItem = reader.ReadItem();
{
m_Rider = reader.ReadMobile();
InternalItem = reader.ReadItem();
if (InternalItem == null)
Delete();
if (InternalItem == null)
Delete();
break;
}
break;
}
}
}
@ -224,8 +224,8 @@ namespace Server.Mobiles
if (from.InRange(this, 1))
{
bool canAccess = from.AccessLevel >= AccessLevel.GameMaster
|| Controlled && ControlMaster == from
|| Summoned && SummonMaster == from;
|| (Controlled && ControlMaster == from)
|| (Summoned && SummonMaster == from);
if (canAccess)
{
@ -334,14 +334,14 @@ namespace Server.Mobiles
switch (version)
{
case 0:
{
m_Mount = reader.ReadMobile() as BaseMount;
{
m_Mount = reader.ReadMobile() as BaseMount;
if (m_Mount == null)
Delete();
if (m_Mount == null)
Delete();
break;
}
break;
}
}
}
}

View file

@ -7,8 +7,7 @@ namespace Server.Mobiles
public class Beetle : BaseMount
{
[Constructible]
public Beetle(string name = "a giant beetle") :
base(name, 0x317, 0x3EBC, AIType.AI_Melee, FightMode.Closest, 10, 1, 0.25, 0.5)
public Beetle(string name = "a giant beetle") : base(name, 0x317, 0x3EBC, AIType.AI_Melee, FightMode.Closest, 10, 1, 0.25, 0.5)
{
SetStr(300);
SetDex(100);
@ -95,8 +94,6 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
#region Pack Animal Methods
public override bool OnBeforeDeath()
{
if (!base.OnBeforeDeath())
@ -141,7 +138,5 @@ namespace Server.Mobiles
PackAnimal.GetContextMenuEntries(this, from, list);
}
#endregion
}
}

View file

@ -3,8 +3,7 @@ namespace Server.Mobiles
public class DesertOstard : BaseMount
{
[Constructible]
public DesertOstard(string name = "a desert ostard") :
base(name, 0xD2, 0x3EA3, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
public DesertOstard(string name = "a desert ostard") : base(name, 0xD2, 0x3EA3, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
{
BaseSoundID = 0x270;

View file

@ -122,7 +122,7 @@ namespace Server.Mobiles
public IMount Mount => this;
[CommandProperty(AccessLevel.GameMaster)]
public bool IsRewardItem{ get; set; }
public bool IsRewardItem { get; set; }
public override void GetProperties(ObjectPropertyList list)
{
@ -161,7 +161,7 @@ namespace Server.Mobiles
return false;
}
if (IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this) || !BaseMount.CheckMountAllowed(from))
if ((IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this)) || !BaseMount.CheckMountAllowed(from))
return false;
if (from.Mounted)
@ -228,29 +228,29 @@ namespace Server.Mobiles
switch (version)
{
case 3:
{
m_IsDonationItem = reader.ReadBool();
goto case 2;
}
{
m_IsDonationItem = reader.ReadBool();
goto case 2;
}
case 2:
{
IsRewardItem = reader.ReadBool();
goto case 0;
}
{
IsRewardItem = reader.ReadBool();
goto case 0;
}
case 1:
reader.ReadInt();
goto case 0;
case 0:
{
m_MountedID = reader.ReadInt();
m_RegularID = reader.ReadInt();
m_Rider = reader.ReadMobile();
{
m_MountedID = reader.ReadInt();
m_RegularID = reader.ReadInt();
m_Rider = reader.ReadMobile();
if (m_MountedID == 0x3EA2)
m_MountedID = 0x3EAA;
if (m_MountedID == 0x3EA2)
m_MountedID = 0x3EAA;
break;
}
break;
}
}
AddFollowers();
@ -261,7 +261,7 @@ namespace Server.Mobiles
public override DeathMoveResult OnParentDeath(Mobile parent)
{
Rider = null; //get off, move to pack
Rider = null; // get off, move to pack
return DeathMoveResult.RemainEquipped;
}
@ -327,10 +327,10 @@ namespace Server.Mobiles
private class EtherealSpell : Spell
{
private static SpellInfo m_Info = new SpellInfo("Ethereal Mount", "", 230);
private static readonly SpellInfo m_Info = new SpellInfo("Ethereal Mount", "", 230);
private EtherealMount m_Mount;
private Mobile m_Rider;
private readonly EtherealMount m_Mount;
private readonly Mobile m_Rider;
private bool m_Stop;
@ -390,7 +390,7 @@ namespace Server.Mobiles
Caster.SendLocalizedMessage(
1049455); // You have been disrupted while attempting to summon your ethereal mount!
//m_Mount.UnmountMe();
// m_Mount.UnmountMe();
}
public override void OnCast()

View file

@ -6,8 +6,7 @@ namespace Server.Mobiles
public class FireSteed : BaseMount
{
[Constructible]
public FireSteed(string name = "a fire steed") :
base(name, 0xBE, 0x3E9E, AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
public FireSteed(string name = "a fire steed") : base(name, 0xBE, 0x3E9E, AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
{
BaseSoundID = 0xA8;

View file

@ -3,8 +3,7 @@ namespace Server.Mobiles
public class ForestOstard : BaseMount
{
[Constructible]
public ForestOstard(string name = "a forest ostard") :
base(name, 0xDB, 0x3EA5, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
public ForestOstard(string name = "a forest ostard") : base(name, 0xDB, 0x3EA5, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
{
Hue = Utility.RandomSlimeHue() | 0x8000;

View file

@ -3,8 +3,7 @@ namespace Server.Mobiles
public class FrenziedOstard : BaseMount
{
[Constructible]
public FrenziedOstard(string name = "a frenzied ostard") :
base(name, 0xDA, 0x3EA4, AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
public FrenziedOstard(string name = "a frenzied ostard") : base(name, 0xDA, 0x3EA4, AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
{
Hue = Race.Human.RandomHairHue() | 0x8000;

View file

@ -3,8 +3,7 @@ namespace Server.Mobiles
public class HellSteed : BaseMount
{
[Constructible]
public HellSteed(string name = "a hellsteed") :
base(name, 793, 0x3EBB, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
public HellSteed(string name = "a hellsteed") : base(name, 793, 0x3EBB, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
{
SetStats(this);
}

View file

@ -7,7 +7,7 @@ namespace Server.Mobiles
{
public class Hiryu : BaseMount
{
private static Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
private static readonly Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
[Constructible]
public Hiryu()
@ -73,29 +73,6 @@ namespace Server.Mobiles
{
int rand = Utility.Random(1075);
/*
1000 1075 No Hue Color 93.02% 0x0
*
10 1075 Ice Green 0.93% 0x847F
10 1075 Light Blue 0.93% 0x848D
10 1075 Strong Cyan 0.93% 0x8495
10 1075 Agapite 0.93% 0x8899
10 1075 Gold 0.93% 0x8032
*
8 1075 Blue and Yellow 0.74% 0x8487
*
5 1075 Ice Blue 0.47% 0x8482
*
3 1075 Cyan 0.28% 0x8123
3 1075 Light Green 0.28% 0x8295
*
2 1075 Strong Yellow 0.19% 0x8037
2 1075 Green 0.19% 0x8030 //this one is an approximation
*
1 1075 Strong Purple 0.09% 0x8490
1 1075 Strong Green 0.09% 0x855C
* */
if (rand <= 0)
return 0x855C;
if (rand <= 1)
@ -123,11 +100,9 @@ namespace Server.Mobiles
if (rand <= 74)
return 0x847F;
return 0;
}
public override int GetAngerSound() => 0x4FE;
public override int GetIdleSound() => 0x4FD;
@ -148,7 +123,7 @@ namespace Server.Mobiles
{
base.OnGaveMeleeAttack(defender);
if (0.1 <= Utility.RandomDouble())
if (Utility.RandomDouble() >= 0.1)
return;
/* Grasping Claw
@ -193,10 +168,10 @@ namespace Server.Mobiles
int version = reader.ReadInt();
if (version == 0)
Timer.DelayCall(TimeSpan.Zero, delegate { Hue = GetHue(); });
Timer.DelayCall(TimeSpan.Zero, () => { Hue = GetHue(); });
if (version <= 1)
Timer.DelayCall(TimeSpan.Zero, delegate
Timer.DelayCall(TimeSpan.Zero, () =>
{
if (InternalItem != null) InternalItem.Hue = Hue;
});
@ -212,8 +187,8 @@ namespace Server.Mobiles
private class ExpireTimer : Timer
{
private Mobile m_Mobile;
private ResistanceMod m_Mod;
private readonly Mobile m_Mobile;
private readonly ResistanceMod m_Mod;
public ExpireTimer(Mobile m, ResistanceMod mod, TimeSpan delay)
: base(delay)

View file

@ -4,7 +4,7 @@ namespace Server.Mobiles
"Server.Mobiles.TanHorse")]
public class Horse : BaseMount
{
private static int[] m_IDs =
private static readonly int[] m_IDs =
{
0xC8, 0x3E9F,
0xE2, 0x3EA0,
@ -13,8 +13,7 @@ namespace Server.Mobiles
};
[Constructible]
public Horse(string name = "a horse") :
base(name, 0xE2, 0x3EA0, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
public Horse(string name = "a horse") : base(name, 0xE2, 0x3EA0, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
{
int random = Utility.Random(4);

View file

@ -7,8 +7,7 @@ namespace Server.Mobiles
public class Kirin : BaseMount
{
[Constructible]
public Kirin(string name = "a ki-rin") :
base(name, 132, 0x3EAD, AIType.AI_Mage, FightMode.Evil, 10, 1, 0.2, 0.4)
public Kirin(string name = "a ki-rin") : base(name, 132, 0x3EAD, AIType.AI_Mage, FightMode.Evil, 10, 1, 0.2, 0.4)
{
BaseSoundID = 0x3C5;
@ -72,16 +71,15 @@ namespace Server.Mobiles
public override bool DoMountAbility(int damage, Mobile attacker)
{
if (Rider == null || attacker == null) //sanity
if (Rider == null || attacker == null) // sanity
return false;
if (Rider.Hits - damage < 30 && Rider.Map == attacker.Map && Rider.InRange(attacker, 18)
) //Range and map checked here instead of other base fuction because of abiliites that don't need to check this
if (Rider.Hits - damage < 30 && Rider.Map == attacker.Map && Rider.InRange(attacker, 18)) // Range and map checked here instead of other base fuction because of abiliites that don't need to check this
{
attacker.BoltEffect(0);
// 35~100 damage, unresistable, by the Ki-rin.
attacker.Damage(Utility.RandomMinMax(35, 100), this,
false); //Don't inform mount about this damage, Still unsure wether or not it's flagged as the mount doing damage or the player. If changed to player, without the extra bool it'd be an infinite loop
false); // Don't inform mount about this damage, Still unsure wether or not it's flagged as the mount doing damage or the player. If changed to player, without the extra bool it'd be an infinite loop
Rider.LocalOverheadMessage(MessageType.Regular, 0x3B2,
1042534); // Your mount calls down the forces of nature on your opponent.

View file

@ -7,7 +7,7 @@ namespace Server.Mobiles
{
public class LesserHiryu : BaseMount
{
private static Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
private static readonly Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
[Constructible]
public LesserHiryu()
@ -72,12 +72,12 @@ namespace Server.Mobiles
/*
500 527 No Hue Color 94.88% 0
10 527 Green 1.90% 0x8295
10 527 Green 1.90% 0x8163 (Very Close to Above Green) //this one is an approximation
5 527 Dark Green 0.95% 0x87D4
1 527 Valorite 0.19% 0x88AB
1 527 Midnight Blue 0.19% 0x8258
500 527 No Hue Color 94.88% 0
10 527 Green 1.90% 0x8295
10 527 Green 1.90% 0x8163 (Very Close to Above Green) //this one is an approximation
5 527 Dark Green 0.95% 0x87D4
1 527 Valorite 0.19% 0x88AB
1 527 Midnight Blue 0.19% 0x8258
* */
@ -92,11 +92,9 @@ namespace Server.Mobiles
if (rand <= 26)
return 0x8295;
return 0;
}
public override bool OverrideBondingReqs()
{
if (ControlMaster.Skills.Bushido.Base >= 90.0)
@ -142,7 +140,7 @@ namespace Server.Mobiles
{
base.OnGaveMeleeAttack(defender);
if (0.1 <= Utility.RandomDouble())
if (Utility.RandomDouble() >= 0.1)
return;
/* Grasping Claw
@ -187,10 +185,10 @@ namespace Server.Mobiles
int version = reader.ReadInt();
if (version == 0)
Timer.DelayCall(TimeSpan.Zero, delegate { Hue = GetHue(); });
Timer.DelayCall(TimeSpan.Zero, () => Hue = GetHue());
if (version <= 1)
Timer.DelayCall(TimeSpan.Zero, delegate
Timer.DelayCall(TimeSpan.Zero, () =>
{
if (InternalItem != null) InternalItem.Hue = Hue;
});
@ -206,8 +204,8 @@ namespace Server.Mobiles
private class ExpireTimer : Timer
{
private Mobile m_Mobile;
private ResistanceMod m_Mod;
private readonly Mobile m_Mobile;
private readonly ResistanceMod m_Mod;
public ExpireTimer(Mobile m, ResistanceMod mod, TimeSpan delay)
: base(delay)

View file

@ -5,8 +5,7 @@ namespace Server.Mobiles
public class Nightmare : BaseMount
{
[Constructible]
public Nightmare(string name = "a nightmare") :
base(name, 0x74, 0x3EA7, AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4)
public Nightmare(string name = "a nightmare") : base(name, 0x74, 0x3EA7, AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4)
{
BaseSoundID = Core.AOS ? 0xA8 : 0x16A;
@ -46,23 +45,23 @@ namespace Server.Mobiles
switch (Utility.Random(3))
{
case 0:
{
BodyValue = 116;
ItemID = 16039;
break;
}
{
BodyValue = 116;
ItemID = 16039;
break;
}
case 1:
{
BodyValue = 178;
ItemID = 16041;
break;
}
{
BodyValue = 178;
ItemID = 16041;
break;
}
case 2:
{
BodyValue = 179;
ItemID = 16055;
break;
}
{
BodyValue = 179;
ItemID = 16055;
break;
}
}
PackItem(new SulfurousAsh(Utility.RandomMinMax(3, 5)));

View file

@ -3,8 +3,7 @@ namespace Server.Mobiles
public class RidableLlama : BaseMount
{
[Constructible]
public RidableLlama(string name = "a ridable llama") :
base(name, 0xDC, 0x3EA6, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
public RidableLlama(string name = "a ridable llama") : base(name, 0xDC, 0x3EA6, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
{
BaseSoundID = 0x3F3;

View file

@ -3,8 +3,7 @@ namespace Server.Mobiles
public class Ridgeback : BaseMount
{
[Constructible]
public Ridgeback(string name = "a ridgeback") :
base(name, 187, 0x3EBA, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
public Ridgeback(string name = "a ridgeback") : base(name, 187, 0x3EBA, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
{
BaseSoundID = 0x3F3;

View file

@ -3,8 +3,7 @@ namespace Server.Mobiles
public class SavageRidgeback : BaseMount
{
[Constructible]
public SavageRidgeback(string name = "a savage ridgeback") :
base(name, 188, 0x3EB8, AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4)
public SavageRidgeback(string name = "a savage ridgeback") : base(name, 188, 0x3EB8, AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4)
{
BaseSoundID = 0x3F3;

View file

@ -3,8 +3,7 @@ namespace Server.Mobiles
public class ScaledSwampDragon : BaseMount
{
[Constructible]
public ScaledSwampDragon(string name = "a swamp dragon") :
base(name, 0x31F, 0x3EBE, AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4)
public ScaledSwampDragon(string name = "a swamp dragon") : base(name, 0x31F, 0x3EBE, AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4)
{
SetStr(201, 300);
SetDex(66, 85);

View file

@ -3,8 +3,7 @@ namespace Server.Mobiles
public class SeaHorse : BaseMount
{
[Constructible]
public SeaHorse(string name = "a sea horse") :
base(name, 0x90, 0x3EB3, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
public SeaHorse(string name = "a sea horse") : base(name, 0x90, 0x3EB3, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
{
InitStats(Utility.Random(50, 30), Utility.Random(50, 30), 10);
Skills.MagicResist.Base = 25.0 + Utility.RandomDouble() * 5.0;

View file

@ -3,8 +3,7 @@ namespace Server.Mobiles
public class SilverSteed : BaseMount
{
[Constructible]
public SilverSteed(string name = "a silver steed") :
base(name, 0x75, 0x3EA8, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
public SilverSteed(string name = "a silver steed") : base(name, 0x75, 0x3EA8, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
{
InitStats(Utility.Random(50, 30), Utility.Random(50, 30), 10);
Skills.MagicResist.Base = 25.0 + Utility.RandomDouble() * 5.0;

View file

@ -3,8 +3,7 @@ namespace Server.Mobiles
public class SkeletalMount : BaseMount
{
[Constructible]
public SkeletalMount(string name = null) :
base(name, 793, 0x3EBB, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
public SkeletalMount(string name = null) : base(name, 793, 0x3EBB, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
{
SetStr(91, 100);
SetDex(46, 55);
@ -56,12 +55,12 @@ namespace Server.Mobiles
switch (version)
{
case 0:
{
Tamable = false;
MinTameSkill = 0.0;
ControlSlots = 0;
break;
}
{
Tamable = false;
MinTameSkill = 0.0;
ControlSlots = 0;
break;
}
}
}
}

View file

@ -11,8 +11,7 @@ namespace Server.Mobiles
private bool m_HasBarding;
[Constructible]
public SwampDragon(string name = "a swamp dragon") :
base(name, 0x31A, 0x3EBD, AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4)
public SwampDragon(string name = "a swamp dragon") : base(name, 0x31A, 0x3EBD, AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4)
{
BaseSoundID = 0x16A;
@ -181,14 +180,14 @@ namespace Server.Mobiles
switch (version)
{
case 1:
{
m_BardingExceptional = reader.ReadBool();
m_BardingCrafter = reader.ReadMobile();
m_HasBarding = reader.ReadBool();
m_BardingHP = reader.ReadInt();
m_BardingResource = (CraftResource)reader.ReadInt();
break;
}
{
m_BardingExceptional = reader.ReadBool();
m_BardingCrafter = reader.ReadMobile();
m_HasBarding = reader.ReadBool();
m_BardingHP = reader.ReadInt();
m_BardingResource = (CraftResource)reader.ReadInt();
break;
}
}
if (Hue == 0 && !m_HasBarding)

View file

@ -7,8 +7,7 @@ namespace Server.Mobiles
public class Unicorn : BaseMount
{
[Constructible]
public Unicorn(string name = "a unicorn") :
base(name, 0x7A, 0x3EB4, AIType.AI_Mage, FightMode.Evil, 10, 1, 0.2, 0.4)
public Unicorn(string name = "a unicorn") : base(name, 0x7A, 0x3EB4, AIType.AI_Mage, FightMode.Evil, 10, 1, 0.2, 0.4)
{
BaseSoundID = 0x4BC;
@ -71,7 +70,7 @@ namespace Server.Mobiles
public override bool DoMountAbility(int damage, Mobile attacker)
{
if (Rider == null || attacker == null) //sanity
if (Rider == null || attacker == null) // sanity
return false;
if (Rider.Poisoned && Rider.Hits - damage < 40)
@ -85,7 +84,7 @@ namespace Server.Mobiles
chanceToCure /= 100;
if (chanceToCure > Utility.Random(100))
if (Rider.CurePoison(this)) //TODO: Confirm if mount is the one flagged for curing it or the rider is
if (Rider.CurePoison(this)) // TODO: Confirm if mount is the one flagged for curing it or the rider is
{
Rider.LocalOverheadMessage(MessageType.Regular, 0x3B2, true,
"Your mount senses you are in danger and aids you with magic.");

View file

@ -52,7 +52,7 @@ namespace Server.Mobiles
public override string DefaultName => "a giant snake";
public override Poison PoisonImmune => Poison.Greater;
public override Poison HitPoison => 0.8 >= Utility.RandomDouble() ? Poison.Greater : Poison.Deadly;
public override Poison HitPoison => Utility.RandomDouble() <= 0.8 ? Poison.Greater : Poison.Deadly;
public override bool DeathAdderCharmable => true;

View file

@ -74,7 +74,7 @@ namespace Server.Mobiles
break;
}
if (0.025 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.025)
PackItem(new GlacialStaff());
}

File diff suppressed because it is too large Load diff

View file

@ -155,8 +155,8 @@ namespace Server.Mobiles
private class ReleaseEntry : ContextMenuEntry
{
private BaseFamiliar m_Familiar;
private Mobile m_From;
private readonly BaseFamiliar m_Familiar;
private readonly Mobile m_From;
public ReleaseEntry(Mobile from, BaseFamiliar familiar) : base(6118, 14)
{

View file

@ -37,7 +37,7 @@ namespace Server.Mobiles
public override string CorpseName => "a death adder corpse";
public override string DefaultName => "a death adder";
public override Poison HitPoison => 0.8 >= Utility.RandomDouble() ? Poison.Greater : Poison.Deadly;
public override Poison HitPoison => Utility.RandomDouble() <= 0.8 ? Poison.Greater : Poison.Deadly;
public override void Serialize(IGenericWriter writer)
{

View file

@ -124,8 +124,6 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
#region Pack Animal Methods
public override bool OnBeforeDeath()
{
if (!base.OnBeforeDeath())
@ -175,7 +173,5 @@ namespace Server.Mobiles
PackAnimal.GetContextMenuEntries(this, from, list);
}
#endregion
}
}

View file

@ -159,22 +159,22 @@ namespace Server.Mobiles
switch (version)
{
case 0:
{
m_Focus = reader.ReadMobile();
if (m_Focus != null)
{
m_AttackTimer = new AttackTimer(this);
m_AttackTimer.Start();
}
else
{
m_IdleTimer = new IdleTimer(this);
m_IdleTimer.Start();
}
m_Focus = reader.ReadMobile();
break;
}
if (m_Focus != null)
{
m_AttackTimer = new AttackTimer(this);
m_AttackTimer.Start();
}
else
{
m_IdleTimer = new IdleTimer(this);
m_IdleTimer.Start();
}
break;
}
}
}
@ -197,10 +197,9 @@ namespace Server.Mobiles
private class AvengeTimer : Timer
{
private Mobile m_Focus;
private readonly Mobile m_Focus;
public AvengeTimer(Mobile focus) :
base(TimeSpan.FromSeconds(2.5), TimeSpan.FromSeconds(1.0),
public AvengeTimer(Mobile focus) : base(TimeSpan.FromSeconds(2.5), TimeSpan.FromSeconds(1.0),
3) // After 2.5 seconds, one guard will spawn every 1.0 second, three times
=>
m_Focus = focus;
@ -213,8 +212,8 @@ namespace Server.Mobiles
private class AttackTimer : Timer
{
private ArcherGuard m_Owner;
// private bool m_Shooting;
private readonly ArcherGuard m_Owner;
// private bool m_Shooting;
public AttackTimer(ArcherGuard owner) : base(TimeSpan.FromSeconds(0.25), TimeSpan.FromSeconds(0.1)) => m_Owner = owner;
@ -277,48 +276,48 @@ namespace Server.Mobiles
Stop();
} // </instakill>
/*else if ( !m_Owner.InRange( target, 20 ) )
/*else if (!m_Owner.InRange( target, 20 ))
{
m_Shooting = false;
m_Owner.Focus = null;
}
else if ( !m_Owner.InLOS( target ) )
else if (!m_Owner.InLOS( target ))
{
m_Shooting = false;
TeleportTo( target );
}
else if ( !m_Owner.CanSee( target ) )
else if (!m_Owner.CanSee( target ))
{
m_Shooting = false;
if ( !m_Owner.InRange( target, 2 ) )
if (!m_Owner.InRange( target, 2 ))
{
if ( !m_Owner.Move( m_Owner.GetDirectionTo( target ) | Direction.Running ) && OutOfMaxDistance( target ) )
if (!m_Owner.Move( m_Owner.GetDirectionTo( target ) | Direction.Running ) && OutOfMaxDistance( target ))
TeleportTo( target );
}
else
{
if ( !m_Owner.UseSkill( SkillName.DetectHidden ) && Utility.Random( 50 ) == 0 )
if (!m_Owner.UseSkill( SkillName.DetectHidden ) && Utility.Random( 50 ) == 0)
m_Owner.Say( "Reveal!" );
}
}
else
{
if ( m_Shooting && (TimeToSpare() || OutOfMaxDistance( target )) )
if (m_Shooting && (TimeToSpare() || OutOfMaxDistance( target )))
m_Shooting = false;
else if ( !m_Shooting && InMinDistance( target ) )
else if (!m_Shooting && InMinDistance( target ))
m_Shooting = true;
if ( !m_Shooting )
if (!m_Shooting)
{
if ( m_Owner.InRange( target, 1 ) )
if (m_Owner.InRange( target, 1 ))
{
if ( !m_Owner.Move( (Direction)(m_Owner.GetDirectionTo( target ) - 4) | Direction.Running ) && OutOfMaxDistance( target ) ) // Too close, move away
TeleportTo( target );
if (!m_Owner.Move( (Direction)(m_Owner.GetDirectionTo( target ) - 4) | Direction.Running ) && OutOfMaxDistance( target ))
TeleportTo( target ); // Too close, move away
}
else if ( !m_Owner.InRange( target, 2 ) )
else if (!m_Owner.InRange( target, 2 ))
{
if ( !m_Owner.Move( m_Owner.GetDirectionTo( target ) | Direction.Running ) && OutOfMaxDistance( target ) )
if (!m_Owner.Move( m_Owner.GetDirectionTo( target ) | Direction.Running ) && OutOfMaxDistance( target ))
TeleportTo( target );
}
}
@ -349,7 +348,7 @@ namespace Server.Mobiles
private class IdleTimer : Timer
{
private ArcherGuard m_Owner;
private readonly ArcherGuard m_Owner;
private int m_Stage;
public IdleTimer(ArcherGuard owner) : base(TimeSpan.FromSeconds(2.0), TimeSpan.FromSeconds(2.5)) => m_Owner = owner;

View file

@ -20,7 +20,7 @@ namespace Server.Mobiles
{
}
public abstract Mobile Focus{ get; set; }
public abstract Mobile Focus { get; set; }
public static void Spawn(Mobile caller, Mobile target, int amount = 1, bool onlyAdditional = false)
{

View file

@ -195,22 +195,22 @@ namespace Server.Mobiles
switch (version)
{
case 0:
{
m_Focus = reader.ReadMobile();
if (m_Focus != null)
{
m_AttackTimer = new AttackTimer(this);
m_AttackTimer.Start();
}
else
{
m_IdleTimer = new IdleTimer(this);
m_IdleTimer.Start();
}
m_Focus = reader.ReadMobile();
break;
}
if (m_Focus != null)
{
m_AttackTimer = new AttackTimer(this);
m_AttackTimer.Start();
}
else
{
m_IdleTimer = new IdleTimer(this);
m_IdleTimer.Start();
}
break;
}
}
}
@ -233,7 +233,7 @@ namespace Server.Mobiles
private class AvengeTimer : Timer
{
private Mobile m_Focus;
private readonly Mobile m_Focus;
public AvengeTimer(Mobile focus) : base(TimeSpan.FromSeconds(2.5), TimeSpan.FromSeconds(1.0), 3) => m_Focus = focus;
@ -245,7 +245,7 @@ namespace Server.Mobiles
private class AttackTimer : Timer
{
private WarriorGuard m_Owner;
private readonly WarriorGuard m_Owner;
public AttackTimer(WarriorGuard owner) : base(TimeSpan.FromSeconds(0.25), TimeSpan.FromSeconds(0.1)) => m_Owner = owner;
@ -308,22 +308,22 @@ namespace Server.Mobiles
Stop();
} // </instakill>
/*else if ( !m_Owner.InRange( target, 20 ) )
/*else if (!m_Owner.InRange( target, 20 ))
{
m_Owner.Focus = null;
}
else if ( !m_Owner.InRange( target, 10 ) || !m_Owner.InLOS( target ) )
else if (!m_Owner.InRange( target, 10 ) || !m_Owner.InLOS( target ))
{
TeleportTo( target );
}
else if ( !m_Owner.InRange( target, 1 ) )
else if (!m_Owner.InRange( target, 1 ))
{
if ( !m_Owner.Move( m_Owner.GetDirectionTo( target ) | Direction.Running ) )
if (!m_Owner.Move( m_Owner.GetDirectionTo( target ) | Direction.Running ))
TeleportTo( target );
}
else if ( !m_Owner.CanSee( target ) )
else if (!m_Owner.CanSee( target ))
{
if ( !m_Owner.UseSkill( SkillName.DetectHidden ) && Utility.Random( 50 ) == 0 )
if (!m_Owner.UseSkill( SkillName.DetectHidden ) && Utility.Random( 50 ) == 0)
m_Owner.Say( "Reveal!" );
}*/
}
@ -346,7 +346,7 @@ namespace Server.Mobiles
private class IdleTimer : Timer
{
private WarriorGuard m_Owner;
private readonly WarriorGuard m_Owner;
private int m_Stage;
public IdleTimer(WarriorGuard owner) : base(TimeSpan.FromSeconds(2.0), TimeSpan.FromSeconds(2.5)) => m_Owner = owner;

View file

@ -7,7 +7,7 @@ namespace Server.Mobiles
{
public abstract class BaseHealer : BaseVendor
{
private static TimeSpan ResurrectDelay = TimeSpan.FromSeconds(2.0);
private static readonly TimeSpan ResurrectDelay = TimeSpan.FromSeconds(2.0);
private DateTime m_NextResurrect;
@ -57,7 +57,7 @@ namespace Server.Mobiles
{
}
protected override List<SBInfo> SBInfos{ get; } = new List<SBInfo>();
protected override List<SBInfo> SBInfos { get; } = new List<SBInfo>();
public override bool IsActiveVendor => false;
public override bool IsInvulnerable => false;

View file

@ -18,7 +18,7 @@ namespace Server.Mobiles
}
[CommandProperty(AccessLevel.GameMaster)]
public int Price{ get; set; }
public int Price { get; set; }
public override bool IsInvulnerable => true;
@ -59,10 +59,10 @@ namespace Server.Mobiles
switch (version)
{
case 0:
{
Price = reader.ReadInt();
break;
}
{
Price = reader.ReadInt();
break;
}
}
}
}

View file

@ -61,13 +61,13 @@ namespace Server.Mobiles
public override string CorpseName => "a demon knight corpse";
public override bool IgnoreYoungProtection => Core.ML;
public static Type[] ArtifactRarity10{ get; } =
public static Type[] ArtifactRarity10 { get; } =
{
typeof(LegacyOfTheDreadLord),
typeof(TheTaskmaster)
};
public static Type[] ArtifactRarity11{ get; } =
public static Type[] ArtifactRarity11 { get; } =
{
typeof(TheDragonSlayer),
typeof(ArmorOfFortune),
@ -231,7 +231,7 @@ namespace Server.Mobiles
MovingEffect(from, 0xECA, 10, 0, false, false, 0, 0);
PlaySound(0x491);
if (0.05 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.05)
Timer.DelayCall(TimeSpan.FromSeconds(1.0), CreateBones_Callback, from);
m_InHere = false;

View file

@ -53,7 +53,7 @@ namespace Server.Mobiles
public override bool Unprovokable => Core.SE;
public override bool AreaPeaceImmune => Core.SE;
public override Poison PoisonImmune => Poison.Lethal;
public override Poison HitPoison => 0.8 >= Utility.RandomDouble() ? Poison.Greater : Poison.Deadly;
public override Poison HitPoison => Utility.RandomDouble() <= 0.8 ? Poison.Greater : Poison.Deadly;
public override int TreasureMapLevel => 1;

View file

@ -6,8 +6,8 @@ namespace Server.Mobiles
{
public class Revenant : BaseCreature
{
private DateTime m_ExpireTime;
private Mobile m_Target;
private readonly DateTime m_ExpireTime;
private readonly Mobile m_Target;
public Revenant(Mobile caster, Mobile target, TimeSpan duration) : base(AIType.AI_Melee, FightMode.Closest, 10, 1,
0.18, 0.36)

View file

@ -58,7 +58,6 @@ namespace Server.Mobiles
// TODO: skeleton
}
public AntLion(Serial serial) : base(serial)
{
}

View file

@ -39,7 +39,7 @@ namespace Server.Mobiles
SolenHelper.PackPicnicBasket(this);
PackItem(new ZoogiFungus(0.05 > Utility.RandomDouble() ? 16 : 4));
PackItem(new ZoogiFungus(Utility.RandomDouble() < 0.05 ? 16 : 4));
}
public BlackSolenInfiltratorQueen(Serial serial) : base(serial)

View file

@ -39,7 +39,7 @@ namespace Server.Mobiles
SolenHelper.PackPicnicBasket(this);
PackItem(new ZoogiFungus(0.05 > Utility.RandomDouble() ? 13 : 3));
PackItem(new ZoogiFungus(Utility.RandomDouble() < 0.05 ? 13 : 3));
}
public BlackSolenInfiltratorWarrior(Serial serial) : base(serial)

View file

@ -51,7 +51,7 @@ namespace Server.Mobiles
}
public override string CorpseName => "a solen queen corpse";
public bool BurstSac{ get; private set; }
public bool BurstSac { get; private set; }
public override string DefaultName => "a black solen queen";
@ -122,10 +122,10 @@ namespace Server.Mobiles
switch (version)
{
case 1:
{
BurstSac = reader.ReadBool();
break;
}
{
BurstSac = reader.ReadBool();
break;
}
}
}
}

View file

@ -40,7 +40,7 @@ namespace Server.Mobiles
SolenHelper.PackPicnicBasket(this);
PackItem(new ZoogiFungus(0.05 > Utility.RandomDouble() ? 13 : 3));
PackItem(new ZoogiFungus(Utility.RandomDouble() < 0.05 ? 13 : 3));
if (Utility.RandomDouble() < 0.05)
PackItem(new BraceletOfBinding());
@ -51,7 +51,7 @@ namespace Server.Mobiles
}
public override string CorpseName => "a solen warrior corpse";
public bool BurstSac{ get; private set; }
public bool BurstSac { get; private set; }
public override string DefaultName => "a black solen warrior";
@ -123,10 +123,10 @@ namespace Server.Mobiles
switch (version)
{
case 1:
{
BurstSac = reader.ReadBool();
break;
}
{
BurstSac = reader.ReadBool();
break;
}
}
}
}

View file

@ -38,7 +38,7 @@ namespace Server.Mobiles
SolenHelper.PackPicnicBasket(this);
PackItem(new ZoogiFungus(0.05 < Utility.RandomDouble() ? 4 : 16));
PackItem(new ZoogiFungus(Utility.RandomDouble() > 0.05 ? 4 : 16));
}
public RedSolenInfiltratorQueen(Serial serial) : base(serial)

View file

@ -38,7 +38,7 @@ namespace Server.Mobiles
SolenHelper.PackPicnicBasket(this);
PackItem(new ZoogiFungus(0.05 < Utility.RandomDouble() ? 3 : 13));
PackItem(new ZoogiFungus(Utility.RandomDouble() > 0.05 ? 3 : 13));
}
public RedSolenInfiltratorWarrior(Serial serial) : base(serial)

View file

@ -50,7 +50,7 @@ namespace Server.Mobiles
}
public override string CorpseName => "a solen queen corpse";
public bool BurstSac{ get; private set; }
public bool BurstSac { get; private set; }
public override string DefaultName => "a red solen queen";
@ -69,7 +69,6 @@ namespace Server.Mobiles
AddLoot(LootPack.Rich);
}
public override bool IsEnemy(Mobile m)
{
if (SolenHelper.CheckRedFriendship(m))
@ -122,10 +121,10 @@ namespace Server.Mobiles
switch (version)
{
case 1:
{
BurstSac = reader.ReadBool();
break;
}
{
BurstSac = reader.ReadBool();
break;
}
}
}
}

View file

@ -38,7 +38,7 @@ namespace Server.Mobiles
VirtualArmor = 35;
SolenHelper.PackPicnicBasket(this);
PackItem(new ZoogiFungus(0.05 < Utility.RandomDouble() ? 3 : 13));
PackItem(new ZoogiFungus(Utility.RandomDouble() > 0.05 ? 3 : 13));
if (Utility.RandomDouble() < 0.05)
PackItem(new BraceletOfBinding());
@ -49,7 +49,7 @@ namespace Server.Mobiles
}
public override string CorpseName => "a solen warrior corpse";
public bool BurstSac{ get; private set; }
public bool BurstSac { get; private set; }
public override string DefaultName => "a red solen warrior";
@ -121,10 +121,10 @@ namespace Server.Mobiles
switch (version)
{
case 1:
{
BurstSac = reader.ReadBool();
break;
}
{
BurstSac = reader.ReadBool();
break;
}
}
}
}

View file

@ -7,7 +7,7 @@ namespace Server.Mobiles
{
public static void PackPicnicBasket(BaseCreature solen)
{
if (1 > Utility.Random(100))
if (Utility.Random(100) < 1)
{
PicnicBasket basket = new PicnicBasket();

View file

@ -54,7 +54,7 @@ namespace Server.Mobiles
AddLoot(LootPack.Average);
AddLoot(LootPack.Gems);
if (0.02 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.02)
switch (Utility.Random(5))
{
case 0:

View file

@ -46,7 +46,7 @@ namespace Server.Mobiles
PackItem(new PowerCrystal());
if (0.02 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.02)
PackItem(new BlackthornWelcomeBook());
m_NextAbilityTime = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(5, 30));
@ -71,11 +71,11 @@ namespace Server.Mobiles
{
base.OnDeath(c);
if (0.05 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.05)
{
if (!IsParagon)
{
if (0.75 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.75)
c.DropItem(DawnsMusicGear.RandomCommon);
else
c.DropItem(DawnsMusicGear.RandomUncommon);
@ -104,7 +104,7 @@ namespace Server.Mobiles
{
base.OnGaveMeleeAttack(defender);
if (!m_Stunning && 0.3 > Utility.RandomDouble())
if (!m_Stunning && Utility.RandomDouble() < 0.3)
{
m_Stunning = true;

View file

@ -36,7 +36,7 @@ namespace Server.Mobiles
VirtualArmor = 32;
if (0.025 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.025)
PackItem(new GargoylesPickaxe());
}

View file

@ -40,7 +40,7 @@ namespace Server.Mobiles
VirtualArmor = 50;
if (0.2 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.2)
PackItem(new GargoylesPickaxe());
}
@ -65,7 +65,7 @@ namespace Server.Mobiles
public override void OnDamagedBySpell(Mobile from)
{
if (from?.Alive == true && 0.4 > Utility.RandomDouble())
if (from?.Alive == true && Utility.RandomDouble() < 0.4)
ThrowHatchet(from);
}
@ -73,7 +73,7 @@ namespace Server.Mobiles
{
base.OnGotMeleeAttack(attacker);
if (attacker?.Alive == true && attacker.Weapon is BaseRanged && 0.4 > Utility.RandomDouble())
if (attacker?.Alive == true && attacker.Weapon is BaseRanged && Utility.RandomDouble() < 0.4)
ThrowHatchet(attacker);
}

View file

@ -38,7 +38,7 @@ namespace Server.Mobiles
VirtualArmor = 50;
if (0.2 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.2)
PackItem(new GargoylesPickaxe());
}

View file

@ -46,7 +46,7 @@ namespace Server.Mobiles
VirtualArmor = 16;
if (0.7 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.7)
PackItem(new ArcaneGem());
}

View file

@ -28,7 +28,6 @@ namespace Server.Mobiles
SetResistance(ResistanceType.Poison, 55, 65);
SetResistance(ResistanceType.Energy, 40, 50);
SetSkill(SkillName.Necromancy, 89, 99.1);
SetSkill(SkillName.SpiritSpeak, 90.0, 99.0);

View file

@ -38,10 +38,9 @@ namespace Server.Mobiles
VirtualArmor = 30;
PackReg(6);
if (0.05 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.05)
PackItem(new OrcishKinMask());
}

View file

@ -40,7 +40,7 @@ namespace Server.Mobiles
PackReg(6);
if (0.02 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.02)
PackStatue();
}

View file

@ -47,7 +47,7 @@ namespace Server.Mobiles
PackReg(10, 15);
PackItem(new Bandage(Utility.RandomMinMax(1, 15)));
if (0.1 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.1)
PackItem(new TribalBerry());
AddItem(new BoneArms());
@ -109,7 +109,7 @@ namespace Server.Mobiles
{
base.OnGotMeleeAttack(attacker);
if (0.1 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.1)
BeginSavageDance();
}
@ -151,116 +151,116 @@ namespace Server.Mobiles
return;
IPooledEnumerable<Mobile> eable = GetMobilesInRange(8);
switch (Utility.Random(3))
{
case 0: /* greater heal */
{
foreach (Mobile m in eable)
{
bool isFriendly = m is Savage || m is SavageRider || m is SavageShaman || m is SavageRidgeback;
foreach (Mobile m in eable)
{
bool isFriendly = m is Savage || m is SavageRider || m is SavageShaman || m is SavageRidgeback;
if (!isFriendly)
continue;
if (!isFriendly)
continue;
if (m.Poisoned || MortalStrike.IsWounded(m) || !CanBeBeneficial(m))
continue;
if (m.Poisoned || MortalStrike.IsWounded(m) || !CanBeBeneficial(m))
continue;
DoBeneficial(m);
DoBeneficial(m);
// Algorithm: (40% of magery) + (1-10)
// Algorithm: (40% of magery) + (1-10)
int toHeal = (int)(Skills.Magery.Value * 0.4);
toHeal += Utility.Random(1, 10);
int toHeal = (int)(Skills.Magery.Value * 0.4);
toHeal += Utility.Random(1, 10);
m.Heal(toHeal, this);
m.Heal(toHeal, this);
m.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);
m.PlaySound(0x202);
m.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);
m.PlaySound(0x202);
}
break;
}
break;
}
case 1: /* lightning */
{
foreach (Mobile m in eable)
{
bool isFriendly = m is Savage || m is SavageRider || m is SavageShaman || m is SavageRidgeback;
if (isFriendly)
continue;
if (!CanBeHarmful(m))
continue;
DoHarmful(m);
double damage;
if (Core.AOS)
foreach (Mobile m in eable)
{
int baseDamage = 6 + (int)(Skills.EvalInt.Value / 5.0);
bool isFriendly = m is Savage || m is SavageRider || m is SavageShaman || m is SavageRidgeback;
damage = Utility.RandomMinMax(baseDamage, baseDamage + 3);
}
else
{
damage = Utility.Random(12, 9);
if (isFriendly)
continue;
if (!CanBeHarmful(m))
continue;
DoHarmful(m);
double damage;
if (Core.AOS)
{
int baseDamage = 6 + (int)(Skills.EvalInt.Value / 5.0);
damage = Utility.RandomMinMax(baseDamage, baseDamage + 3);
}
else
{
damage = Utility.Random(12, 9);
}
m.BoltEffect(0);
SpellHelper.Damage(TimeSpan.FromSeconds(0.25), m, this, damage, 0, 0, 0, 0, 100);
}
m.BoltEffect(0);
SpellHelper.Damage(TimeSpan.FromSeconds(0.25), m, this, damage, 0, 0, 0, 0, 100);
break;
}
break;
}
case 2: /* poison */
{
foreach (Mobile m in eable)
{
bool isFriendly = m is Savage || m is SavageRider || m is SavageShaman || m is SavageRidgeback;
foreach (Mobile m in eable)
{
bool isFriendly = m is Savage || m is SavageRider || m is SavageShaman || m is SavageRidgeback;
if (isFriendly)
continue;
if (isFriendly)
continue;
if (!CanBeHarmful(m))
continue;
if (!CanBeHarmful(m))
continue;
DoHarmful(m);
DoHarmful(m);
m.Spell?.OnCasterHurt();
m.Spell?.OnCasterHurt();
m.Paralyzed = false;
m.Paralyzed = false;
double total = Skills.Magery.Value + Skills.Poisoning.Value;
double total = Skills.Magery.Value + Skills.Poisoning.Value;
double dist = GetDistanceToSqrt(m);
double dist = GetDistanceToSqrt(m);
if (dist >= 3.0)
total -= (dist - 3.0) * 10.0;
if (dist >= 3.0)
total -= (dist - 3.0) * 10.0;
int level;
int level;
if (total >= 200.0 && Utility.Random(1, 100) <= 10)
level = 3;
else if (total > 170.0)
level = 2;
else if (total > 130.0)
level = 1;
else
level = 0;
if (total >= 200.0 && Utility.Random(1, 100) <= 10)
level = 3;
else if (total > 170.0)
level = 2;
else if (total > 130.0)
level = 1;
else
level = 0;
m.ApplyPoison(this, Poison.GetPoison(level));
m.ApplyPoison(this, Poison.GetPoison(level));
m.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist);
m.PlaySound(0x474);
m.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist);
m.PlaySound(0x474);
}
break;
}
break;
}
}
eable.Free();
}

View file

@ -61,8 +61,8 @@ namespace Server.Mobiles
foreach (Mobile m in eable)
{
if (m == this || !CanBeHarmful(m) ||
!(m.Player || m is BaseCreature creature &&
(creature.Controlled || creature.Summoned || creature.Team != Team)))
!(m.Player || (m is BaseCreature creature &&
(creature.Controlled || creature.Summoned || creature.Team != Team))))
continue;
DoHarmful(m);
@ -70,7 +70,7 @@ namespace Server.Mobiles
m.FixedParticles(0x374A, 10, 15, 5013, 0x496, 0, EffectLayer.Waist);
m.PlaySound(0x231);
//m.SendMessage( "You feel the life drain out of you!" );
// m.SendMessage( "You feel the life drain out of you!" );
int toDrain = Utility.RandomMinMax(10, 40);
@ -85,7 +85,7 @@ namespace Server.Mobiles
{
base.OnGaveMeleeAttack(defender);
if (0.1 >= Utility.RandomDouble())
if (Utility.RandomDouble() <= 0.1)
DrainLife();
}
@ -93,7 +93,7 @@ namespace Server.Mobiles
{
base.OnGotMeleeAttack(attacker);
if (0.1 >= Utility.RandomDouble())
if (Utility.RandomDouble() <= 0.1)
DrainLife();
}

View file

@ -61,7 +61,7 @@ namespace Server.Mobiles
public override void GenerateLoot()
{
AddLoot(LootPack.Meager);
//AddLoot( LootPack.Miscellaneous );
// AddLoot( LootPack.Miscellaneous );
}
public override void Serialize(IGenericWriter writer)

View file

@ -33,7 +33,7 @@ namespace Server.Mobiles
VirtualArmor = 35;
if (0.2 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.2)
PackItem(new GargoylesPickaxe());
}

View file

@ -46,7 +46,6 @@ namespace Server.Mobiles
helm.Hue = 0x966;
AddItem(helm);
Bow bow = new Bow();
bow.Movable = false;
@ -73,7 +72,7 @@ namespace Server.Mobiles
{
base.Serialize(writer);
writer.Write(0); // version
writer.Write(0); // version
}
public override void Deserialize(IGenericReader reader)

View file

@ -13,7 +13,6 @@ namespace Server.Mobiles
{
Body = 768;
SetStr(301, 400);
SetDex(51, 70);
SetInt(51, 100);
@ -42,10 +41,10 @@ namespace Server.Mobiles
VirtualArmor = 70;
if (0.1 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.1)
PackItem(new PowerCrystal());
if (0.4 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.4)
PackItem(new ClockworkAssembly());
}
@ -68,11 +67,11 @@ namespace Server.Mobiles
{
base.OnDeath(c);
if (0.05 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.05)
{
if (!IsParagon)
{
if (0.75 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.75)
c.DropItem(DawnsMusicGear.RandomCommon);
else
c.DropItem(DawnsMusicGear.RandomUncommon);
@ -100,7 +99,7 @@ namespace Server.Mobiles
{
base.OnGaveMeleeAttack(defender);
if (!m_Stunning && 0.3 > Utility.RandomDouble())
if (!m_Stunning && Utility.RandomDouble() < 0.3)
{
m_Stunning = true;

View file

@ -7,10 +7,10 @@ namespace Server.Mobiles
{
public class KhaldunRevenant : BaseCreature
{
private static HashSet<Mobile> m_Set = new HashSet<Mobile>();
private DateTime m_ExpireTime;
private static readonly HashSet<Mobile> m_Set = new HashSet<Mobile>();
private readonly DateTime m_ExpireTime;
private Mobile m_Target;
private readonly Mobile m_Target;
public KhaldunRevenant(Mobile target) : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.18, 0.36)
{
@ -116,8 +116,8 @@ namespace Server.Mobiles
return;
}
//Combatant = m_Target;
//FocusMob = m_Target;
// Combatant = m_Target;
// FocusMob = m_Target;
if (AIObject != null)
AIObject.Action = ActionType.Combat;

View file

@ -74,7 +74,7 @@ namespace Server.Mobiles
break;
}
if (0.2 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.2)
PackItem(new BolaBall());
}

View file

@ -48,7 +48,7 @@ namespace Server.Mobiles
PackItem(new MortarPestle());
PackItem(new LesserExplosionPotion());
if (0.2 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.2)
PackItem(new BolaBall());
}
@ -108,7 +108,7 @@ namespace Server.Mobiles
m_Thrown++;
if (0.75 >= Utility.RandomDouble() && m_Thrown % 2 == 1) // 75% chance to quickly throw another bomb
if (Utility.RandomDouble() <= 0.75 && m_Thrown % 2 == 1) // 75% chance to quickly throw another bomb
m_NextBomb = DateTime.UtcNow + TimeSpan.FromSeconds(3.0);
else
m_NextBomb = DateTime.UtcNow + TimeSpan.FromSeconds(5.0 + 10.0 * Utility.RandomDouble()); // 5-15 seconds
@ -138,7 +138,8 @@ namespace Server.Mobiles
private class InternalTimer : Timer
{
private Mobile m_Mobile, m_From;
private readonly Mobile m_Mobile;
private readonly Mobile m_From;
public InternalTimer(Mobile m, Mobile from) : base(TimeSpan.FromSeconds(1.0))
{

View file

@ -42,10 +42,10 @@ namespace Server.Mobiles
PackItem(ore);
PackItem(new IronIngot(10));
if (0.05 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.05)
PackItem(new OrcishKinMask());
if (0.2 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.2)
PackItem(new BolaBall());
}
@ -113,7 +113,7 @@ namespace Server.Mobiles
if (eable.Count() < 10)
{
BaseCreature orc = new SpawnedOrcishLord{ Team = Team };
BaseCreature orc = new SpawnedOrcishLord { Team = Team };
orc.MoveToWorld(map.GetRandomNearbyLocation(target.Location), map);
orc.Combatant = target;

View file

@ -56,10 +56,10 @@ namespace Server.Mobiles
PackItem(new RingmailChest());
if (0.3 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.3)
PackItem(Loot.RandomPossibleReagent());
if (0.2 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.2)
PackItem(new BolaBall());
}

View file

@ -76,8 +76,7 @@ namespace Server.Mobiles
public override bool IsEnemy(Mobile m)
{
if (m is PlayerMobile player && Map == Map.Trammel && X >= 5199 && X <= 5271 && Y >= 1812 && Y <= 1865
) // Schmendrick's cave
if (m is PlayerMobile player && Map == Map.Trammel && X >= 5199 && X <= 5271 && Y >= 1812 && Y <= 1865) // Schmendrick's cave
{
QuestSystem qs = player.Quest;

View file

@ -35,18 +35,18 @@ namespace Server.Mobiles
PackItem(new Bandage(Utility.RandomMinMax(1, 15)));
if (Female && 0.1 > Utility.RandomDouble())
if (Female && Utility.RandomDouble() < 0.1)
PackItem(new TribalBerry());
else if (!Female && 0.1 > Utility.RandomDouble())
else if (!Female && Utility.RandomDouble() < 0.1)
PackItem(new BolaBall());
AddItem(new Spear());
AddItem(new BoneArms());
AddItem(new BoneLegs());
if (0.5 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.5)
AddItem(new SavageMask());
else if (0.1 > Utility.RandomDouble())
else if (Utility.RandomDouble() < 0.1)
AddItem(new OrcishKinMask());
}

View file

@ -36,7 +36,7 @@ namespace Server.Mobiles
PackItem(new Bandage(Utility.RandomMinMax(1, 15)));
if (0.1 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.1)
PackItem(new BolaBall());
AddItem(new TribalSpear());

View file

@ -100,7 +100,7 @@ namespace Server.Mobiles
private class UnhideTimer : Timer
{
private ShadowFiend m_Owner;
private readonly ShadowFiend m_Owner;
public UnhideTimer(ShadowFiend owner) : base(TimeSpan.FromSeconds(30.0))
{

View file

@ -37,7 +37,7 @@ namespace Server.Mobiles
PackItem(new IronIngot(12));
if (0.05 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.05)
PackItem(new GargoylesPickaxe());
}

View file

@ -56,7 +56,7 @@ namespace Server.Mobiles
}
public override string CorpseName => "a minion's corpse";
public bool FieldActive{ get; private set; }
public bool FieldActive { get; private set; }
public bool CanUseField // TODO: an OSI bug prevents to verify this
=> Hits >= HitsMax * 9 / 10;
@ -100,7 +100,7 @@ namespace Server.Mobiles
public override void OnDamagedBySpell(Mobile from)
{
if (from?.Alive == true && 0.4 > Utility.RandomDouble()) SendEBolt(from);
if (from?.Alive == true && Utility.RandomDouble() < 0.4) SendEBolt(from);
if (!FieldActive)
{
@ -129,7 +129,7 @@ namespace Server.Mobiles
attacker.SendAsciiMessage("Your weapon cannot penetrate the creature's magical barrier");
}
if (attacker?.Alive == true && attacker.Weapon is BaseRanged && 0.4 > Utility.RandomDouble())
if (attacker?.Alive == true && attacker.Weapon is BaseRanged && Utility.RandomDouble() < 0.4)
SendEBolt(attacker);
}

View file

@ -47,7 +47,7 @@ namespace Server.Mobiles
}
public override string CorpseName => "an overseer's corpse";
public bool FieldActive{ get; private set; }
public bool FieldActive { get; private set; }
public bool CanUseField // TODO: an OSI bug prevents to verify this
=> Hits >= HitsMax * 9 / 10;
@ -90,7 +90,7 @@ namespace Server.Mobiles
public override void OnDamagedBySpell(Mobile from)
{
if (from?.Alive == true && 0.4 > Utility.RandomDouble()) SendEBolt(from);
if (from?.Alive == true && Utility.RandomDouble() < 0.4) SendEBolt(from);
if (!FieldActive)
{
@ -119,7 +119,7 @@ namespace Server.Mobiles
attacker.SendAsciiMessage("Your weapon cannot penetrate the creature's magical barrier");
}
if (attacker?.Alive == true && attacker.Weapon is BaseRanged && 0.4 > Utility.RandomDouble())
if (attacker?.Alive == true && attacker.Weapon is BaseRanged && Utility.RandomDouble() < 0.4)
SendEBolt(attacker);
}

View file

@ -23,11 +23,11 @@ namespace Server.Mobiles
SetDamageType(ResistanceType.Cold, 25);
SetDamageType(ResistanceType.Energy, 25);
//SetResistance( ResistanceType.Physical, 25, 38 );
//SetResistance( ResistanceType.Fire, 25, 38 );
//SetResistance( ResistanceType.Cold, 25, 38 );
//SetResistance( ResistanceType.Poison, 25, 38 );
//SetResistance( ResistanceType.Energy, 25, 38 );
// SetResistance( ResistanceType.Physical, 25, 38 );
// SetResistance( ResistanceType.Fire, 25, 38 );
// SetResistance( ResistanceType.Cold, 25, 38 );
// SetResistance( ResistanceType.Poison, 25, 38 );
// SetResistance( ResistanceType.Energy, 25, 38 );
SetSkill(SkillName.Fencing, 77.6, 92.5);
SetSkill(SkillName.Healing, 60.3, 90.0);
@ -146,7 +146,7 @@ namespace Server.Mobiles
public override void GenerateLoot()
{
AddLoot(LootPack.Rich);
//AddLoot( LootPack.Gems );
// AddLoot( LootPack.Gems );
}
public override bool OnBeforeDeath()

View file

@ -27,7 +27,6 @@ namespace Server.Mobiles
SetResistance(ResistanceType.Poison, 25, 35);
SetResistance(ResistanceType.Energy, 25, 35);*/
SetSkill(SkillName.Tactics, 80.1, 100.0);
SetSkill(SkillName.MagicResist, 100.1, 110.0);
SetSkill(SkillName.Anatomy, 80.1, 100.0);

View file

@ -74,7 +74,7 @@ namespace Server.Mobiles
public override void OnDamage(int amount, Mobile from, bool willKill)
{
if (!willKill && amount > 5 && from?.Player == true && 5 > Utility.Random(100))
if (!willKill && amount > 5 && from?.Player == true && Utility.Random(100) < 5)
{
string[] toSay =
{

View file

@ -73,29 +73,29 @@ namespace Server.Mobiles
{
base.OnGaveMeleeAttack(defender);
if (0.2 < Utility.RandomDouble())
if (Utility.RandomDouble() > 0.2)
return;
switch (Utility.Random(3))
{
case 0:
{
defender.SendLocalizedMessage(1004014); // You have been stunned!
defender.Freeze(TimeSpan.FromSeconds(4.0));
break;
}
{
defender.SendLocalizedMessage(1004014); // You have been stunned!
defender.Freeze(TimeSpan.FromSeconds(4.0));
break;
}
case 1:
{
defender.SendAsciiMessage("You have been hit by a paralyzing blow!");
defender.Freeze(TimeSpan.FromSeconds(3.0));
break;
}
{
defender.SendAsciiMessage("You have been hit by a paralyzing blow!");
defender.Freeze(TimeSpan.FromSeconds(3.0));
break;
}
case 2:
{
AOS.Damage(defender, this, Utility.Random(10, 5), 100, 0, 0, 0, 0);
defender.SendAsciiMessage("You have been hit by a critical strike!");
break;
}
{
AOS.Damage(defender, this, Utility.Random(10, 5), 100, 0, 0, 0, 0);
defender.SendAsciiMessage("You have been hit by a critical strike!");
break;
}
}
}

View file

@ -190,7 +190,6 @@ namespace Server.Mobiles
given "come" command, ie they wander towards their summoner,
but never actually "follow".
*/
else if (!Combat(this))
{
AIObject?.MoveTo(SummonMaster, false, 5);
@ -201,10 +200,9 @@ namespace Server.Mobiles
is a player or controlled/summoned, and the summoner is not already
engaged in combat.
*/
else if (!Combat(SummonMaster))
{
if (Combatant.Player || Combatant is BaseCreature bc && (bc.Controlled || bc.SummonMaster != null))
if (Combatant.Player || (Combatant is BaseCreature bc && (bc.Controlled || bc.SummonMaster != null)))
SummonMaster.Combatant = Combatant;
}
else

View file

@ -133,7 +133,7 @@ namespace Server.Mobiles
if (!(m is MeerWarrior) || !IsFriend(m) || !CanBeBeneficial(m) || m.Hits >= m.HitsMax || m.Poisoned ||
MortalStrike.IsWounded(m))
continue;
DoBeneficial(m);
int toHeal = Utility.RandomMinMax(20, 30);
@ -145,7 +145,7 @@ namespace Server.Mobiles
m.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);
m.PlaySound(0x202);
}
eable.Free();
}

View file

@ -179,7 +179,7 @@ namespace Server.Mobiles
case 3:
DoAreaLeech();
break;
// TODO: Resurrect ability
// TODO: Resurrect ability
}
}
}

View file

@ -7,7 +7,7 @@ namespace Server.Mobiles
{
public class MeerMage : BaseCreature
{
private static Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
private static readonly Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
private DateTime m_NextAbilityTime;
@ -121,7 +121,7 @@ namespace Server.Mobiles
rabid.MoveToWorld(loc, combatant.Map);
}
Say(1071932); //Creatures of the forest, I call to thee! Aid me in the fight against all that is evil!
Say(1071932); // Creatures of the forest, I call to thee! Aid me in the fight against all that is evil!
}
else if (combatant.Player)
{

View file

@ -5,8 +5,7 @@ namespace Server.Mobiles
public class CuSidhe : BaseMount
{
[Constructible]
public CuSidhe(string name = null) :
base(name, 277, 0x3E91, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
public CuSidhe(string name = null) : base(name, 277, 0x3E91, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
{
double chance = Utility.RandomDouble() * 23301;
@ -41,8 +40,8 @@ namespace Server.Mobiles
SetSkill(SkillName.Anatomy, 65.5, 69.4);
SetSkill(SkillName.Healing, 72.2, 98.9);
Fame = 5000; //Guessing here
Karma = 5000; //Guessing here
Fame = 5000; // Guessing here
Karma = 5000; // Guessing here
Tamable = true;
ControlSlots = 4;
@ -51,8 +50,8 @@ namespace Server.Mobiles
if (Utility.RandomDouble() < 0.2)
PackItem(new TreasureMap(5, Map.Trammel));
//if ( Utility.RandomDouble() < 0.1 )
//PackItem( new ParrotItem() );
// if (Utility.RandomDouble() < 0.1)
// PackItem( new ParrotItem() );
PackGold(500, 800);

Some files were not shown because too many files have changed in this diff Show more