fix: Fixes NPC slowness. (#955)

* Adds the following configurations:
  * `movement.delay.npcMinDelay` - 0.1 - Pets or Non-monster NPCs
  * `movement.delay.npcMaxDelay` - 0.4 - Pets or Non-monster NPCs
  * `movement.delay.monsterMinDelay` - 0.4 - Non-pet Monsters or NPC vs Player Combat
  * `movement.delay.monsterMaxDelay` - 0.8 - Non-pet Monsters or NPC vs Player Combat
  * `movement.delay.monsterMinDex` - 150 - Dex maximum for delay by dex
  * `movement.delay.MinDex` - 190 - Dex maximum for delay by dex
This commit is contained in:
Kamron Batman 2022-03-10 22:55:06 -08:00 • committed by GitHub
parent 44bd129734
commit bdee7bc671
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
357 changed files with 767 additions and 962 deletions

View file

@ -11,9 +11,6 @@
<ProjectReference Include="..\Server\Server.csproj" /> <ProjectReference Include="..\Server\Server.csproj" />
<ProjectReference Include="..\UOContent\UOContent.csproj" /> <ProjectReference Include="..\UOContent\UOContent.csproj" />
<DataFiles Include="$(SolutionDir)\Distribution\Data\**" /> <DataFiles Include="$(SolutionDir)\Distribution\Data\**" />
<DataFiles Update="..\..\Distribution\Data\Professions\LBR\prof.txt">
<Link>Data\Professions\LBR\prof.txt</Link>
</DataFiles>
</ItemGroup> </ItemGroup>
<Target Name="CopyData" AfterTargets="AfterBuild"> <Target Name="CopyData" AfterTargets="AfterBuild">
<Copy SourceFiles="@(DataFiles)" DestinationFolder="$(OutDir)\Data\%(RecursiveDir)" /> <Copy SourceFiles="@(DataFiles)" DestinationFolder="$(OutDir)\Data\%(RecursiveDir)" />

View file

@ -67,6 +67,12 @@ public static class ServerConfiguration
return Enum.TryParse(strValue, out T value) ? value : defaultValue; return Enum.TryParse(strValue, out T value) ? value : defaultValue;
} }
public static double GetSetting(string key, double defaultValue)
{
m_Settings.Settings.TryGetValue(key, out var strValue);
return double.TryParse(strValue, out var value) ? value : defaultValue;
}
public static T? GetSetting<T>(string key) where T : struct, Enum public static T? GetSetting<T>(string key) where T : struct, Enum
{ {
if (!m_Settings.Settings.TryGetValue(key, out var strValue)) if (!m_Settings.Settings.TryGetValue(key, out var strValue))
@ -168,6 +174,24 @@ public static class ServerConfiguration
return value; return value;
} }
public static double GetOrUpdateSetting(string key, double defaultValue)
{
double value;
if (m_Settings.Settings.TryGetValue(key, out var strValue))
{
value = double.TryParse(strValue, out value) ? value : defaultValue;
}
else
{
SetSetting(key, (value = defaultValue).ToString());
}
return value;
}
public static void SetSetting(string key, double value) => SetSetting(key, value.ToString());
public static void SetSetting(string key, TimeSpan value) => SetSetting(key, value.ToString()); public static void SetSetting(string key, TimeSpan value) => SetSetting(key, value.ToString());
public static void SetSetting(string key, int value) => SetSetting(key, value.ToString()); public static void SetSetting(string key, int value) => SetSetting(key, value.ToString());

View file

@ -6,7 +6,7 @@ namespace Server.Mobiles
{ {
[Constructible] [Constructible]
public UnholyFamiliar() public UnholyFamiliar()
: base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) : base(AIType.AI_Melee)
{ {
Body = 99; Body = 99;
BaseSoundID = 0xE5; BaseSoundID = 0xE5;

View file

@ -6,7 +6,7 @@ namespace Server.Mobiles
{ {
[Constructible] [Constructible]
public UnholySteed() public UnholySteed()
: base("a dark steed", 0x74, 0x3EA7, AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4) : base("a dark steed", 0x74, 0x3EA7, AIType.AI_Melee, FightMode.Aggressor, 10, 1)
{ {
SetStr(496, 525); SetStr(496, 525);
SetDex(86, 105); SetDex(86, 105);

View file

@ -6,7 +6,7 @@ namespace Server.Mobiles
{ {
[Constructible] [Constructible]
public HolyFamiliar() public HolyFamiliar()
: base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) : base(AIType.AI_Melee)
{ {
Body = 100; Body = 100;
BaseSoundID = 0xE5; BaseSoundID = 0xE5;

View file

@ -6,7 +6,7 @@ namespace Server.Mobiles
{ {
[Constructible] [Constructible]
public HolySteed() public HolySteed()
: base("a silver steed", 0x75, 0x3EA8, AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4) : base("a silver steed", 0x75, 0x3EA8, AIType.AI_Melee, FightMode.Aggressor, 10, 1)
{ {
SetStr(496, 525); SetStr(496, 525);
SetDex(86, 105); SetDex(86, 105);

View file

@ -10,7 +10,7 @@ namespace Server.Factions
[Constructible] [Constructible]
public FactionWarHorse(Faction faction = null) public FactionWarHorse(Faction faction = null)
: base("a war horse", 0xE2, 0x3EA0, AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4) : base("a war horse", 0xE2, 0x3EA0, AIType.AI_Melee, FightMode.Aggressor, 10, 1)
{ {
BaseSoundID = 0xA8; BaseSoundID = 0xA8;

View file

@ -35,7 +35,7 @@ namespace Server.Factions
private DateTime m_OrdersEnd; private DateTime m_OrdersEnd;
private Town m_Town; private Town m_Town;
public BaseFactionGuard(string title) : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) public BaseFactionGuard(string title) : base(AIType.AI_Melee)
{ {
Orders = new Orders(this); Orders = new Orders(this);
Title = title; Title = title;

View file

@ -5,7 +5,7 @@ namespace Server.Mobiles
public class GrimmochDrummel : BaseCreature public class GrimmochDrummel : BaseCreature
{ {
[Constructible] [Constructible]
public GrimmochDrummel() : base(AIType.AI_Archer, FightMode.Closest, 10, 1, 0.2, 0.4) public GrimmochDrummel() : base(AIType.AI_Archer)
{ {
Title = "the Cursed"; Title = "the Cursed";

View file

@ -5,7 +5,7 @@ namespace Server.Mobiles
public class LysanderGathenwale : BaseCreature public class LysanderGathenwale : BaseCreature
{ {
[Constructible] [Constructible]
public LysanderGathenwale() : base(AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4) public LysanderGathenwale() : base(AIType.AI_Mage)
{ {
Title = "the Cursed"; Title = "the Cursed";

View file

@ -5,7 +5,7 @@ namespace Server.Mobiles
public class MorgBergen : BaseCreature public class MorgBergen : BaseCreature
{ {
[Constructible] [Constructible]
public MorgBergen() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) public MorgBergen() : base(AIType.AI_Melee)
{ {
Title = "the Cursed"; Title = "the Cursed";

View file

@ -5,7 +5,7 @@ namespace Server.Mobiles
public class TavaraSewel : BaseCreature public class TavaraSewel : BaseCreature
{ {
[Constructible] [Constructible]
public TavaraSewel() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) public TavaraSewel() : base(AIType.AI_Melee)
{ {
Title = "the Cursed"; Title = "the Cursed";

View file

@ -180,7 +180,7 @@ namespace Server.Engines.MLQuests.Definitions
{ {
[Constructible] [Constructible]
public Jamal() public Jamal()
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.2, 0.4) : base(AIType.AI_Vendor, FightMode.None, 2)
{ {
Title = "the Fisherman"; Title = "the Fisherman";
Body = 400; Body = 400;
@ -224,7 +224,7 @@ namespace Server.Engines.MLQuests.Definitions
{ {
[Constructible] [Constructible]
public Iosep() public Iosep()
: base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.2, 0.4) : base(AIType.AI_Vendor, FightMode.None, 2)
{ {
Title = "the Exporter"; Title = "the Exporter";
Body = 400; Body = 400;

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class GiantIceWorm : BaseCreature public class GiantIceWorm : BaseCreature
{ {
[Constructible] [Constructible]
public GiantIceWorm() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) public GiantIceWorm() : base(AIType.AI_Melee)
{ {
Body = 89; Body = 89;
BaseSoundID = 0xDC; BaseSoundID = 0xDC;

View file

@ -9,7 +9,7 @@ namespace Server.Engines.Quests.Necro
private PlayerMobile m_Necromancer; private PlayerMobile m_Necromancer;
private bool m_ToDelete; private bool m_ToDelete;
public SummonedPaladin(PlayerMobile necromancer) : base(AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4) public SummonedPaladin(PlayerMobile necromancer) : base(AIType.AI_Melee, FightMode.Aggressor)
{ {
m_Necromancer = necromancer; m_Necromancer = necromancer;

View file

@ -6,7 +6,7 @@ namespace Server.Engines.Quests.Ninja
public class Henchman : BaseCreature public class Henchman : BaseCreature
{ {
[Constructible] [Constructible]
public Henchman() : base(AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4) public Henchman() : base(AIType.AI_Melee, FightMode.Aggressor)
{ {
InitStats(45, 30, 5); InitStats(45, 30, 5);

View file

@ -6,7 +6,7 @@ namespace Server.Engines.Quests.Samurai
public class CursedSoul : BaseCreature public class CursedSoul : BaseCreature
{ {
[Constructible] [Constructible]
public CursedSoul() : base(AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4) public CursedSoul() : base(AIType.AI_Melee, FightMode.Aggressor)
{ {
Body = 3; Body = 3;
BaseSoundID = 471; BaseSoundID = 471;

View file

@ -5,7 +5,7 @@ namespace Server.Engines.Quests.Samurai
public class DeadlyImp : BaseCreature public class DeadlyImp : BaseCreature
{ {
[Constructible] [Constructible]
public DeadlyImp() : base(AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4) public DeadlyImp() : base(AIType.AI_Melee, FightMode.Aggressor)
{ {
Body = 74; Body = 74;
BaseSoundID = 422; BaseSoundID = 422;

View file

@ -5,7 +5,7 @@ namespace Server.Engines.Quests.Samurai
public class DiseasedCat : BaseCreature public class DiseasedCat : BaseCreature
{ {
[Constructible] [Constructible]
public DiseasedCat() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public DiseasedCat() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 0xC9; Body = 0xC9;
Hue = Utility.RandomAnimalHue(); Hue = Utility.RandomAnimalHue();

View file

@ -5,7 +5,7 @@ namespace Server.Engines.Quests.Samurai
public class FierceDragon : BaseCreature public class FierceDragon : BaseCreature
{ {
[Constructible] [Constructible]
public FierceDragon() : base(AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4) public FierceDragon() : base(AIType.AI_Melee, FightMode.Aggressor)
{ {
Body = 103; Body = 103;
BaseSoundID = 362; BaseSoundID = 362;

View file

@ -5,7 +5,7 @@ namespace Server.Engines.Quests.Samurai
public class InjuredWolf : BaseCreature public class InjuredWolf : BaseCreature
{ {
[Constructible] [Constructible]
public InjuredWolf() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public InjuredWolf() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 0xE1; Body = 0xE1;
BaseSoundID = 0xE5; BaseSoundID = 0xE5;

View file

@ -6,7 +6,7 @@ namespace Server.Engines.Quests.Samurai
public class YoungNinja : BaseCreature public class YoungNinja : BaseCreature
{ {
[Constructible] [Constructible]
public YoungNinja() : base(AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4) public YoungNinja() : base(AIType.AI_Melee, FightMode.Aggressor)
{ {
InitStats(45, 30, 5); InitStats(45, 30, 5);
SetHits(20, 30); SetHits(20, 30);

View file

@ -6,7 +6,7 @@ namespace Server.Engines.Quests.Samurai
public class YoungRonin : BaseCreature public class YoungRonin : BaseCreature
{ {
[Constructible] [Constructible]
public YoungRonin() : base(AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4) public YoungRonin() : base(AIType.AI_Melee, FightMode.Aggressor)
{ {
InitStats(45, 30, 5); InitStats(45, 30, 5);
SetHits(10, 20); SetHits(10, 20);

View file

@ -9,7 +9,7 @@ namespace Server.Engines.Quests.Haven
public class MilitiaFighter : BaseCreature public class MilitiaFighter : BaseCreature
{ {
[Constructible] [Constructible]
public MilitiaFighter() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) public MilitiaFighter() : base(AIType.AI_Melee)
{ {
InitStats(40, 30, 5); InitStats(40, 30, 5);
Title = "the Militia Fighter"; Title = "the Militia Fighter";

View file

@ -276,7 +276,7 @@ namespace Server.Engines.Events
private readonly Mobile m_From; private readonly Mobile m_From;
public NaughtyTwin(Mobile from) public NaughtyTwin(Mobile from)
: base(AIType.AI_Melee, FightMode.None, 10, 1, 0.2, 0.4) : base(AIType.AI_Melee, FightMode.None)
{ {
if (TrickOrTreat.CheckMobile(from)) if (TrickOrTreat.CheckMobile(from))
{ {

View file

@ -8,7 +8,7 @@
public partial class CreepyCake : Food public partial class CreepyCake : Food
{ {
[Constructible] [Constructible]
public CreepyCake() : base(0x9e9, 1) => Hue = 0x3E4; public CreepyCake() : base(0x9e9) => Hue = 0x3E4;
public override string DefaultName => "Creepy Cake"; public override string DefaultName => "Creepy Cake";
} }

View file

@ -4,7 +4,7 @@
public partial class MrPlainsCookies : Food public partial class MrPlainsCookies : Food
{ {
[Constructible] [Constructible]
public MrPlainsCookies() : base(0x160C, 1) public MrPlainsCookies() : base(0x160C)
{ {
Weight = 1.0; Weight = 1.0;
FillFactor = 4; FillFactor = 4;

View file

@ -9,7 +9,7 @@ namespace Server.Mobiles
{ {
[Constructible] [Constructible]
public PumpkinHead() public PumpkinHead()
: base(Utility.RandomBool() ? AIType.AI_Melee : AIType.AI_Mage, FightMode.Closest, 10, 1, 0.05, 0.1) : base(Utility.RandomBool() ? AIType.AI_Melee : AIType.AI_Mage)
{ {
Body = 1246 + Utility.Random(2); Body = 1246 + Utility.Random(2);

View file

@ -169,7 +169,7 @@ namespace Server.Engines.Events
public override string DefaultName => _deadPlayer != null ? $"{_deadPlayer.Name}'s Zombie Skeleton" : "Zombie Skeleton"; public override string DefaultName => _deadPlayer != null ? $"{_deadPlayer.Name}'s Zombie Skeleton" : "Zombie Skeleton";
public ZombieSkeleton(PlayerMobile player = null) public ZombieSkeleton(PlayerMobile player = null)
: base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) : base(AIType.AI_Melee)
{ {
_deadPlayer = player; _deadPlayer = player;

View file

@ -27,7 +27,7 @@ namespace Server.Items
public class WasabiClumps : Food public class WasabiClumps : Food
{ {
[Constructible] [Constructible]
public WasabiClumps() : base(0x24EB, 1) public WasabiClumps() : base(0x24EB)
{ {
Stackable = false; Stackable = false;
Weight = 1.0; Weight = 1.0;
@ -80,7 +80,7 @@ namespace Server.Items
public class BentoBox : Food public class BentoBox : Food
{ {
[Constructible] [Constructible]
public BentoBox() : base(0x2836, 1) public BentoBox() : base(0x2836)
{ {
Stackable = false; Stackable = false;
Weight = 5.0; Weight = 5.0;
@ -120,7 +120,7 @@ namespace Server.Items
public class SushiRolls : Food public class SushiRolls : Food
{ {
[Constructible] [Constructible]
public SushiRolls() : base(0x283E, 1) public SushiRolls() : base(0x283E)
{ {
Stackable = false; Stackable = false;
Weight = 3.0; Weight = 3.0;
@ -149,7 +149,7 @@ namespace Server.Items
public class SushiPlatter : Food public class SushiPlatter : Food
{ {
[Constructible] [Constructible]
public SushiPlatter() : base(0x2840, 1) public SushiPlatter() : base(0x2840)
{ {
Stackable = Core.ML; Stackable = Core.ML;
Weight = 3.0; Weight = 3.0;
@ -202,7 +202,7 @@ namespace Server.Items
public class GreenTea : Food public class GreenTea : Food
{ {
[Constructible] [Constructible]
public GreenTea() : base(0x284C, 1) public GreenTea() : base(0x284C)
{ {
Stackable = false; Stackable = false;
Weight = 4.0; Weight = 4.0;
@ -231,7 +231,7 @@ namespace Server.Items
public class MisoSoup : Food public class MisoSoup : Food
{ {
[Constructible] [Constructible]
public MisoSoup() : base(0x284D, 1) public MisoSoup() : base(0x284D)
{ {
Stackable = false; Stackable = false;
Weight = 4.0; Weight = 4.0;
@ -260,7 +260,7 @@ namespace Server.Items
public class WhiteMisoSoup : Food public class WhiteMisoSoup : Food
{ {
[Constructible] [Constructible]
public WhiteMisoSoup() : base(0x284E, 1) public WhiteMisoSoup() : base(0x284E)
{ {
Stackable = false; Stackable = false;
Weight = 4.0; Weight = 4.0;
@ -289,7 +289,7 @@ namespace Server.Items
public class RedMisoSoup : Food public class RedMisoSoup : Food
{ {
[Constructible] [Constructible]
public RedMisoSoup() : base(0x284F, 1) public RedMisoSoup() : base(0x284F)
{ {
Stackable = false; Stackable = false;
Weight = 4.0; Weight = 4.0;
@ -318,7 +318,7 @@ namespace Server.Items
public class AwaseMisoSoup : Food public class AwaseMisoSoup : Food
{ {
[Constructible] [Constructible]
public AwaseMisoSoup() : base(0x2850, 1) public AwaseMisoSoup() : base(0x2850)
{ {
Stackable = false; Stackable = false;
Weight = 4.0; Weight = 4.0;

View file

@ -51,7 +51,7 @@ namespace Server.Items
public class WoodenBowlOfCarrots : Food public class WoodenBowlOfCarrots : Food
{ {
[Constructible] [Constructible]
public WoodenBowlOfCarrots() : base(0x15F9, 1) public WoodenBowlOfCarrots() : base(0x15F9)
{ {
Stackable = false; Stackable = false;
Weight = 1.0; Weight = 1.0;
@ -91,7 +91,7 @@ namespace Server.Items
public class WoodenBowlOfCorn : Food public class WoodenBowlOfCorn : Food
{ {
[Constructible] [Constructible]
public WoodenBowlOfCorn() : base(0x15FA, 1) public WoodenBowlOfCorn() : base(0x15FA)
{ {
Stackable = false; Stackable = false;
Weight = 1.0; Weight = 1.0;
@ -131,7 +131,7 @@ namespace Server.Items
public class WoodenBowlOfLettuce : Food public class WoodenBowlOfLettuce : Food
{ {
[Constructible] [Constructible]
public WoodenBowlOfLettuce() : base(0x15FB, 1) public WoodenBowlOfLettuce() : base(0x15FB)
{ {
Stackable = false; Stackable = false;
Weight = 1.0; Weight = 1.0;
@ -171,7 +171,7 @@ namespace Server.Items
public class WoodenBowlOfPeas : Food public class WoodenBowlOfPeas : Food
{ {
[Constructible] [Constructible]
public WoodenBowlOfPeas() : base(0x15FC, 1) public WoodenBowlOfPeas() : base(0x15FC)
{ {
Stackable = false; Stackable = false;
Weight = 1.0; Weight = 1.0;
@ -211,7 +211,7 @@ namespace Server.Items
public class PewterBowlOfCarrots : Food public class PewterBowlOfCarrots : Food
{ {
[Constructible] [Constructible]
public PewterBowlOfCarrots() : base(0x15FE, 1) public PewterBowlOfCarrots() : base(0x15FE)
{ {
Stackable = false; Stackable = false;
Weight = 1.0; Weight = 1.0;
@ -251,7 +251,7 @@ namespace Server.Items
public class PewterBowlOfCorn : Food public class PewterBowlOfCorn : Food
{ {
[Constructible] [Constructible]
public PewterBowlOfCorn() : base(0x15FF, 1) public PewterBowlOfCorn() : base(0x15FF)
{ {
Stackable = false; Stackable = false;
Weight = 1.0; Weight = 1.0;
@ -291,7 +291,7 @@ namespace Server.Items
public class PewterBowlOfLettuce : Food public class PewterBowlOfLettuce : Food
{ {
[Constructible] [Constructible]
public PewterBowlOfLettuce() : base(0x1600, 1) public PewterBowlOfLettuce() : base(0x1600)
{ {
Stackable = false; Stackable = false;
Weight = 1.0; Weight = 1.0;
@ -331,7 +331,7 @@ namespace Server.Items
public class PewterBowlOfPeas : Food public class PewterBowlOfPeas : Food
{ {
[Constructible] [Constructible]
public PewterBowlOfPeas() : base(0x1601, 1) public PewterBowlOfPeas() : base(0x1601)
{ {
Stackable = false; Stackable = false;
Weight = 1.0; Weight = 1.0;
@ -371,7 +371,7 @@ namespace Server.Items
public class PewterBowlOfPotatos : Food public class PewterBowlOfPotatos : Food
{ {
[Constructible] [Constructible]
public PewterBowlOfPotatos() : base(0x1602, 1) public PewterBowlOfPotatos() : base(0x1602)
{ {
Stackable = false; Stackable = false;
Weight = 1.0; Weight = 1.0;
@ -461,7 +461,7 @@ namespace Server.Items
public class WoodenBowlOfStew : Food public class WoodenBowlOfStew : Food
{ {
[Constructible] [Constructible]
public WoodenBowlOfStew() : base(0x1604, 1) public WoodenBowlOfStew() : base(0x1604)
{ {
Stackable = false; Stackable = false;
Weight = 2.0; Weight = 2.0;
@ -501,7 +501,7 @@ namespace Server.Items
public class WoodenBowlOfTomatoSoup : Food public class WoodenBowlOfTomatoSoup : Food
{ {
[Constructible] [Constructible]
public WoodenBowlOfTomatoSoup() : base(0x1606, 1) public WoodenBowlOfTomatoSoup() : base(0x1606)
{ {
Stackable = false; Stackable = false;
Weight = 2.0; Weight = 2.0;

View file

@ -534,7 +534,7 @@ namespace Server.Items
public class Cake : Food public class Cake : Food
{ {
[Constructible] [Constructible]
public Cake() : base(0x9E9, 1) public Cake() : base(0x9E9)
{ {
Stackable = false; Stackable = false;
Weight = 1.0; Weight = 1.0;
@ -591,7 +591,7 @@ namespace Server.Items
public class Cookies : Food public class Cookies : Food
{ {
[Constructible] [Constructible]
public Cookies() : base(0x160b, 1) public Cookies() : base(0x160b)
{ {
Stackable = Core.ML; Stackable = Core.ML;
Weight = 1.0; Weight = 1.0;
@ -620,7 +620,7 @@ namespace Server.Items
public class Muffins : Food public class Muffins : Food
{ {
[Constructible] [Constructible]
public Muffins() : base(0x9eb, 1) public Muffins() : base(0x9eb)
{ {
Stackable = false; Stackable = false;
Weight = 1.0; Weight = 1.0;
@ -650,7 +650,7 @@ namespace Server.Items
public class CheesePizza : Food public class CheesePizza : Food
{ {
[Constructible] [Constructible]
public CheesePizza() : base(0x1040, 1) public CheesePizza() : base(0x1040)
{ {
Stackable = false; Stackable = false;
Weight = 1.0; Weight = 1.0;
@ -681,7 +681,7 @@ namespace Server.Items
public class SausagePizza : Food public class SausagePizza : Food
{ {
[Constructible] [Constructible]
public SausagePizza() : base(0x1040, 1) public SausagePizza() : base(0x1040)
{ {
Stackable = false; Stackable = false;
Weight = 1.0; Weight = 1.0;
@ -712,7 +712,7 @@ namespace Server.Items
public class FruitPie : Food public class FruitPie : Food
{ {
[Constructible] [Constructible]
public FruitPie() : base(0x1041, 1) public FruitPie() : base(0x1041)
{ {
Stackable = false; Stackable = false;
Weight = 1.0; Weight = 1.0;
@ -743,7 +743,7 @@ namespace Server.Items
public class MeatPie : Food public class MeatPie : Food
{ {
[Constructible] [Constructible]
public MeatPie() : base(0x1041, 1) public MeatPie() : base(0x1041)
{ {
Stackable = false; Stackable = false;
Weight = 1.0; Weight = 1.0;
@ -774,7 +774,7 @@ namespace Server.Items
public class PumpkinPie : Food public class PumpkinPie : Food
{ {
[Constructible] [Constructible]
public PumpkinPie() : base(0x1041, 1) public PumpkinPie() : base(0x1041)
{ {
Stackable = false; Stackable = false;
Weight = 1.0; Weight = 1.0;
@ -805,7 +805,7 @@ namespace Server.Items
public class ApplePie : Food public class ApplePie : Food
{ {
[Constructible] [Constructible]
public ApplePie() : base(0x1041, 1) public ApplePie() : base(0x1041)
{ {
Stackable = false; Stackable = false;
Weight = 1.0; Weight = 1.0;
@ -836,7 +836,7 @@ namespace Server.Items
public class PeachCobbler : Food public class PeachCobbler : Food
{ {
[Constructible] [Constructible]
public PeachCobbler() : base(0x1041, 1) public PeachCobbler() : base(0x1041)
{ {
Stackable = false; Stackable = false;
Weight = 1.0; Weight = 1.0;
@ -867,7 +867,7 @@ namespace Server.Items
public class Quiche : Food public class Quiche : Food
{ {
[Constructible] [Constructible]
public Quiche() : base(0x1041, 1) public Quiche() : base(0x1041)
{ {
Stackable = Core.ML; Stackable = Core.ML;
Weight = 1.0; Weight = 1.0;

View file

@ -3,7 +3,7 @@ namespace Server.Items
public class FruitBasket : Food public class FruitBasket : Food
{ {
[Constructible] [Constructible]
public FruitBasket() : base(0x993, 1) public FruitBasket() : base(0x993)
{ {
Weight = 2.0; Weight = 2.0;
FillFactor = 5; FillFactor = 5;

View file

@ -13,7 +13,7 @@ namespace Server.Items
{ {
} }
public CandyCane(int itemID) : base(itemID, 1) public CandyCane(int itemID) : base(itemID)
{ {
Stackable = false; Stackable = false;
LootType = LootType.Blessed; LootType = LootType.Blessed;
@ -126,7 +126,7 @@ namespace Server.Items
[Constructible] [Constructible]
public GingerBreadCookie() public GingerBreadCookie()
: base(Utility.RandomBool() ? 0x2be1 : 0x2be2, 1) : base(Utility.RandomBool() ? 0x2be1 : 0x2be2)
{ {
Stackable = false; Stackable = false;
LootType = LootType.Blessed; LootType = LootType.Blessed;

View file

@ -65,7 +65,7 @@ namespace Server.Items
public class Spam : Food public class Spam : Food
{ {
[Constructible] [Constructible]
public Spam() : base(0x1044, 1) public Spam() : base(0x1044)
{ {
Stackable = false; Stackable = false;
LootType = LootType.Blessed; LootType = LootType.Blessed;

View file

@ -9,7 +9,7 @@ namespace Server.Mobiles
{ {
// public override bool IsInvulnerable => true; // TODO: Wailing banshees are NOT invulnerable, are any of the others? // public override bool IsInvulnerable => true; // TODO: Wailing banshees are NOT invulnerable, are any of the others?
public BaseTalismanSummon() : base(AIType.AI_Melee, FightMode.None, 10, 1, 0.2, 0.4) public BaseTalismanSummon() : base(AIType.AI_Melee, FightMode.None)
{ {
// TODO: Stats/skills // TODO: Stats/skills
} }

View file

@ -103,7 +103,7 @@ namespace Server.Items
{ {
int damage = Utility.RandomMinMax(15, 35); int damage = Utility.RandomMinMax(15, 35);
AOS.Damage(From, From, damage, false, 0, 0, 0, 0, 0, 0, 100, false, false, false); AOS.Damage(From, From, damage, false, 0, 0, 0, 0, 0, 0, 100);
} }
} }
} }

View file

@ -1,6 +1,5 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using Server.ContextMenus; using Server.ContextMenus;
using Server.Engines.Quests; using Server.Engines.Quests;
using Server.Engines.Quests.Necro; using Server.Engines.Quests.Necro;
@ -810,31 +809,45 @@ namespace Server.Mobiles
switch (Action) switch (Action)
{ {
case ActionType.Wander: case ActionType.Wander:
m_Mobile.OnActionWander(); {
return DoActionWander(); m_Mobile.OnActionWander();
return DoActionWander();
}
case ActionType.Combat: case ActionType.Combat:
m_Mobile.OnActionCombat(); {
return DoActionCombat(); m_Mobile.OnActionCombat();
return DoActionCombat();
}
case ActionType.Guard: case ActionType.Guard:
m_Mobile.OnActionGuard(); {
return DoActionGuard(); m_Mobile.OnActionGuard();
return DoActionGuard();
}
case ActionType.Flee: case ActionType.Flee:
m_Mobile.OnActionFlee(); {
return DoActionFlee(); m_Mobile.OnActionFlee();
return DoActionFlee();
}
case ActionType.Interact: case ActionType.Interact:
m_Mobile.OnActionInteract(); {
return DoActionInteract(); m_Mobile.OnActionInteract();
return DoActionInteract();
}
case ActionType.Backoff: case ActionType.Backoff:
m_Mobile.OnActionBackoff(); {
return DoActionBackoff(); m_Mobile.OnActionBackoff();
return DoActionBackoff();
}
default: default:
return false; {
return false;
}
} }
} }
@ -843,42 +856,54 @@ namespace Server.Mobiles
switch (Action) switch (Action)
{ {
case ActionType.Wander: case ActionType.Wander:
m_Mobile.Warmode = false; {
m_Mobile.Combatant = null; m_Mobile.Warmode = false;
m_Mobile.FocusMob = null; m_Mobile.Combatant = null;
m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed; m_Mobile.FocusMob = null;
break; m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed;
break;
}
case ActionType.Combat: case ActionType.Combat:
m_Mobile.Warmode = true; {
m_Mobile.FocusMob = null; m_Mobile.Warmode = true;
m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed; m_Mobile.FocusMob = null;
break; m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed;
break;
}
case ActionType.Guard: case ActionType.Guard:
m_Mobile.Warmode = true; {
m_Mobile.FocusMob = null; m_Mobile.Warmode = true;
m_Mobile.Combatant = null; m_Mobile.FocusMob = null;
m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed; m_Mobile.Combatant = null;
m_NextStopGuard = Core.TickCount + (int)TimeSpan.FromSeconds(10).TotalMilliseconds; m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed;
m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed; m_NextStopGuard = Core.TickCount + (int)TimeSpan.FromSeconds(10).TotalMilliseconds;
break; m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed;
break;
}
case ActionType.Flee: case ActionType.Flee:
m_Mobile.Warmode = true; {
m_Mobile.FocusMob = null; m_Mobile.Warmode = true;
m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed; m_Mobile.FocusMob = null;
break; m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed;
break;
}
case ActionType.Interact: case ActionType.Interact:
m_Mobile.Warmode = false; {
m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed; m_Mobile.Warmode = false;
break; m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed;
break;
}
case ActionType.Backoff: case ActionType.Backoff:
m_Mobile.Warmode = false; {
m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed; m_Mobile.Warmode = false;
break; m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed;
break;
}
} }
} }
@ -1012,12 +1037,7 @@ namespace Server.Mobiles
public virtual bool Obey() public virtual bool Obey()
{ {
if (m_Mobile.Deleted) var shouldObey = !m_Mobile.Deleted && m_Mobile.ControlOrder switch
{
return false;
}
return m_Mobile.ControlOrder switch
{ {
OrderType.None => DoOrderNone(), OrderType.None => DoOrderNone(),
OrderType.Come => DoOrderCome(), OrderType.Come => DoOrderCome(),
@ -1034,6 +1054,15 @@ namespace Server.Mobiles
OrderType.Transfer => DoOrderTransfer(), OrderType.Transfer => DoOrderTransfer(),
_ => false _ => false
}; };
if (shouldObey)
{
// TODO: This might cause the movement timer to reset too often if someone is spamming commands.
// Test this thoroughly.
m_Mobile.ResetSpeeds();
}
return shouldObey;
} }
public virtual void OnCurrentOrderChanged() public virtual void OnCurrentOrderChanged()
@ -1046,104 +1075,128 @@ namespace Server.Mobiles
switch (m_Mobile.ControlOrder) switch (m_Mobile.ControlOrder)
{ {
case OrderType.None: case OrderType.None:
m_Mobile.ControlMaster.RevealingAction(); {
m_Mobile.Home = m_Mobile.Location; m_Mobile.ControlMaster.RevealingAction();
m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed; m_Mobile.Home = m_Mobile.Location;
m_Mobile.PlaySound(m_Mobile.GetIdleSound()); m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed;
m_Mobile.Warmode = false; m_Mobile.PlaySound(m_Mobile.GetIdleSound());
m_Mobile.Combatant = null; m_Mobile.Warmode = false;
break; m_Mobile.Combatant = null;
break;
}
case OrderType.Come: case OrderType.Come:
m_Mobile.ControlMaster.RevealingAction(); {
m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed; m_Mobile.ControlMaster.RevealingAction();
m_Mobile.PlaySound(m_Mobile.GetIdleSound()); m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed;
m_Mobile.Warmode = false; m_Mobile.PlaySound(m_Mobile.GetIdleSound());
m_Mobile.Combatant = null; m_Mobile.Warmode = false;
break; m_Mobile.Combatant = null;
break;
}
case OrderType.Drop: case OrderType.Drop:
m_Mobile.ControlMaster.RevealingAction(); {
m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed; m_Mobile.ControlMaster.RevealingAction();
m_Mobile.PlaySound(m_Mobile.GetIdleSound()); m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed;
m_Mobile.Warmode = true; m_Mobile.PlaySound(m_Mobile.GetIdleSound());
m_Mobile.Combatant = null; m_Mobile.Warmode = true;
break; m_Mobile.Combatant = null;
break;
}
case OrderType.Friend: case OrderType.Friend:
case OrderType.Unfriend: case OrderType.Unfriend:
m_Mobile.ControlMaster.RevealingAction(); {
break; m_Mobile.ControlMaster.RevealingAction();
break;
}
case OrderType.Guard: case OrderType.Guard:
m_Mobile.ControlMaster.RevealingAction(); {
m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed; m_Mobile.ControlMaster.RevealingAction();
m_Mobile.PlaySound(m_Mobile.GetIdleSound()); m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed;
m_Mobile.Warmode = true; m_Mobile.PlaySound(m_Mobile.GetIdleSound());
m_Mobile.Combatant = null; m_Mobile.Warmode = true;
var petname = $"{m_Mobile.Name}"; m_Mobile.Combatant = null;
m_Mobile.ControlMaster.SendLocalizedMessage(1049671, petname); // ~1_PETNAME~ is now guarding you. var petname = $"{m_Mobile.Name}";
break; m_Mobile.ControlMaster.SendLocalizedMessage(1049671, petname); // ~1_PETNAME~ is now guarding you.
break;
}
case OrderType.Attack: case OrderType.Attack:
m_Mobile.ControlMaster.RevealingAction(); {
m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed; m_Mobile.ControlMaster.RevealingAction();
m_Mobile.PlaySound(m_Mobile.GetIdleSound()); m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed;
m_Mobile.PlaySound(m_Mobile.GetIdleSound());
m_Mobile.Warmode = true; m_Mobile.Warmode = true;
m_Mobile.Combatant = null; m_Mobile.Combatant = null;
break; break;
}
case OrderType.Patrol: case OrderType.Patrol:
m_Mobile.ControlMaster.RevealingAction(); {
m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed; m_Mobile.ControlMaster.RevealingAction();
m_Mobile.PlaySound(m_Mobile.GetIdleSound()); m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed;
m_Mobile.Warmode = false; m_Mobile.PlaySound(m_Mobile.GetIdleSound());
m_Mobile.Combatant = null; m_Mobile.Warmode = false;
break; m_Mobile.Combatant = null;
break;
}
case OrderType.Release: case OrderType.Release:
m_Mobile.ControlMaster.RevealingAction(); {
m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed; m_Mobile.ControlMaster.RevealingAction();
m_Mobile.PlaySound(m_Mobile.GetIdleSound()); m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed;
m_Mobile.Warmode = false; m_Mobile.PlaySound(m_Mobile.GetIdleSound());
m_Mobile.Combatant = null; m_Mobile.Warmode = false;
break; m_Mobile.Combatant = null;
break;
}
case OrderType.Stay: case OrderType.Stay:
m_Mobile.ControlMaster.RevealingAction(); {
m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed; m_Mobile.ControlMaster.RevealingAction();
m_Mobile.PlaySound(m_Mobile.GetIdleSound()); m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed;
m_Mobile.Warmode = false; m_Mobile.PlaySound(m_Mobile.GetIdleSound());
m_Mobile.Combatant = null; m_Mobile.Warmode = false;
break; m_Mobile.Combatant = null;
break;
}
case OrderType.Stop: case OrderType.Stop:
m_Mobile.ControlMaster.RevealingAction(); {
m_Mobile.Home = m_Mobile.Location; m_Mobile.ControlMaster.RevealingAction();
m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed; m_Mobile.Home = m_Mobile.Location;
m_Mobile.PlaySound(m_Mobile.GetIdleSound()); m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed;
m_Mobile.Warmode = false; m_Mobile.PlaySound(m_Mobile.GetIdleSound());
m_Mobile.Combatant = null; m_Mobile.Warmode = false;
break; m_Mobile.Combatant = null;
break;
}
case OrderType.Follow: case OrderType.Follow:
m_Mobile.ControlMaster.RevealingAction(); {
m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed; m_Mobile.ControlMaster.RevealingAction();
m_Mobile.PlaySound(m_Mobile.GetIdleSound()); m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed;
m_Mobile.PlaySound(m_Mobile.GetIdleSound());
m_Mobile.Warmode = false; m_Mobile.Warmode = false;
m_Mobile.Combatant = null; m_Mobile.Combatant = null;
break; break;
}
case OrderType.Transfer: case OrderType.Transfer:
m_Mobile.ControlMaster.RevealingAction(); {
m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed; m_Mobile.ControlMaster.RevealingAction();
m_Mobile.PlaySound(m_Mobile.GetIdleSound()); m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed;
m_Mobile.PlaySound(m_Mobile.GetIdleSound());
m_Mobile.Warmode = false; m_Mobile.Warmode = false;
m_Mobile.Combatant = null; m_Mobile.Combatant = null;
break; break;
}
} }
} }
@ -1824,32 +1877,50 @@ namespace Server.Mobiles
switch (iRndMove) switch (iRndMove)
{ {
case 0: case 0:
DoMove(Direction.Up); {
break; DoMove(Direction.Up);
break;
}
case 1: case 1:
DoMove(Direction.North); {
break; DoMove(Direction.North);
break;
}
case 2: case 2:
DoMove(Direction.Left); {
break; DoMove(Direction.Left);
break;
}
case 3: case 3:
DoMove(Direction.West); {
break; DoMove(Direction.West);
break;
}
case 5: case 5:
DoMove(Direction.Down); {
break; DoMove(Direction.Down);
break;
}
case 6: case 6:
DoMove(Direction.South); {
break; DoMove(Direction.South);
break;
}
case 7: case 7:
DoMove(Direction.Right); {
break; DoMove(Direction.Right);
break;
}
case 8: case 8:
DoMove(Direction.East); {
break; DoMove(Direction.East);
break;
}
default: default:
DoMove(m_Mobile.Direction); {
break; DoMove(m_Mobile.Direction);
break;
}
} }
} }
} }
@ -1857,100 +1928,24 @@ namespace Server.Mobiles
public double TransformMoveDelay(double delay) public double TransformMoveDelay(double delay)
{ {
var isPassive = delay == m_Mobile.PassiveSpeed; double max = m_Mobile.IsMonster ? SpeedInfo.MaxMonsterDelay : SpeedInfo.MaxDelay;
var isControlled = m_Mobile.Controlled || m_Mobile.Summoned;
if (delay == 0.2) if (!m_Mobile.IsDeadPet && (m_Mobile.ReduceSpeedWithDamage || m_Mobile.IsSubdued))
{ {
delay = 0.3; double offset = m_Mobile.StamMax <= 0 ? 1.0 : m_Mobile.Stam / (double)m_Mobile.StamMax;
}
else if (delay == 0.25)
{
delay = 0.45;
}
else if (delay == 0.3)
{
delay = 0.6;
}
else if (delay == 0.4)
{
delay = 0.9;
}
else if (delay == 0.5)
{
delay = 1.05;
}
else if (delay == 0.6)
{
delay = 1.2;
}
else if (delay == 0.8)
{
delay = 1.5;
}
if (isPassive) if (offset < 1.0)
{
delay += 0.2;
}
if (!isControlled)
{
delay += 0.1;
}
else if (m_Mobile.Controlled)
{
if (m_Mobile.ControlOrder == OrderType.Follow && m_Mobile.ControlTarget == m_Mobile.ControlMaster)
{ {
delay *= 0.5; delay += (max - delay) * (1.0 - offset);
} }
delay -= 0.075;
} }
if (m_Mobile.ReduceSpeedWithDamage || m_Mobile.IsSubdued) return Math.Min(delay, max);
{
var offset = (double)m_Mobile.Hits / m_Mobile.HitsMax;
if (offset < 0.0)
{
offset = 0.0;
}
else if (offset > 1.0)
{
offset = 1.0;
}
offset = 1.0 - offset;
delay += offset * 0.8;
}
if (delay < 0.0)
{
delay = 0.0;
}
if (double.IsNaN(delay))
{
using (var op = new StreamWriter("nan_transform.txt", true))
{
op.WriteLine(
$"NaN in TransformMoveDelay: {Core.Now}, {GetType()}, {m_Mobile?.GetType()}, {m_Mobile.HitsMax}"
);
}
return 1.0;
}
return delay;
} }
public virtual bool CheckMove() => Core.TickCount - NextMove >= 0; public virtual bool CheckMove() => Core.TickCount - NextMove >= 0;
public virtual bool DoMove(Direction d) => DoMove(d, false); public virtual bool DoMove(Direction d, bool badStateOk = false)
public virtual bool DoMove(Direction d, bool badStateOk)
{ {
var res = DoMoveImpl(d); var res = DoMoveImpl(d);
@ -2712,7 +2707,7 @@ namespace Server.Mobiles
public virtual void OnCurrentSpeedChanged() public virtual void OnCurrentSpeedChanged()
{ {
m_Timer.Stop(); m_Timer.Stop();
m_Timer.Delay = TimeSpan.FromSeconds(Utility.RandomDouble()); m_Timer.Delay = TimeSpan.FromMilliseconds(Utility.Random(128) * 8);
m_Timer.Interval = TimeSpan.FromSeconds(Math.Max(0.0, m_Mobile.CurrentSpeed)); m_Timer.Interval = TimeSpan.FromSeconds(Math.Max(0.0, m_Mobile.CurrentSpeed));
m_Timer.Start(); m_Timer.Start();
} }
@ -2740,70 +2735,72 @@ namespace Server.Mobiles
public override void OnClick() public override void OnClick()
{ {
if (!m_Mobile.Deleted && m_Mobile.Controlled && m_From.CheckAlive()) if (m_Mobile.Deleted || !m_Mobile.Controlled || !m_From.CheckAlive())
{ {
if (m_Mobile.IsDeadPet && m_Order is OrderType.Guard or OrderType.Attack or OrderType.Transfer or OrderType.Drop) return;
{ }
return;
}
var isOwner = m_From == m_Mobile.ControlMaster; if (m_Mobile.IsDeadPet && m_Order is OrderType.Guard or OrderType.Attack or OrderType.Transfer or OrderType.Drop)
var isFriend = !isOwner && m_Mobile.IsPetFriend(m_From); {
return;
}
if (!isOwner && !isFriend) var isOwner = m_From == m_Mobile.ControlMaster;
{ var isFriend = !isOwner && m_Mobile.IsPetFriend(m_From);
return;
}
if (isFriend && m_Order != OrderType.Follow && m_Order != OrderType.Stay && m_Order != OrderType.Stop) if (!isOwner && !isFriend)
{ {
return; return;
} }
switch (m_Order) if (isFriend && m_Order != OrderType.Follow && m_Order != OrderType.Stay && m_Order != OrderType.Stop)
{ {
case OrderType.Follow: return;
case OrderType.Attack: }
case OrderType.Transfer:
case OrderType.Friend: switch (m_Order)
case OrderType.Unfriend: {
case OrderType.Follow:
case OrderType.Attack:
case OrderType.Transfer:
case OrderType.Friend:
case OrderType.Unfriend:
{
if (m_Order == OrderType.Transfer && m_From.HasTrade)
{ {
if (m_Order == OrderType.Transfer && m_From.HasTrade) m_From.SendLocalizedMessage(1010507); // You cannot transfer a pet with a trade pending
{
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;
} }
case OrderType.Release: else if (m_Order == OrderType.Friend && m_From.HasTrade)
{ {
if (m_Mobile.Summoned) m_From.SendLocalizedMessage(1070947); // You cannot friend a pet with a trade pending
{
goto default;
}
m_From.SendGump(new ConfirmReleaseGump(m_From, m_Mobile));
break;
} }
default: else
{ {
if (m_Mobile.CheckControlChance(m_From)) m_AI.BeginPickTarget(m_From, m_Order);
{
m_Mobile.ControlOrder = m_Order;
}
break;
} }
}
break;
}
case OrderType.Release:
{
if (m_Mobile.Summoned)
{
goto default;
}
m_From.SendGump(new ConfirmReleaseGump(m_From, m_Mobile));
break;
}
default:
{
if (m_Mobile.CheckControlChance(m_From))
{
m_Mobile.ControlOrder = m_Order;
}
break;
}
} }
} }
} }
@ -2904,14 +2901,10 @@ namespace Server.Mobiles
{ {
var args = $"{to.Name}\t{from.Name}\t "; var args = $"{to.Name}\t{from.Name}\t ";
from.SendLocalizedMessage( // The pet refuses to be transferred because it will not obey ~1_NAME~.~3_BLANK~
1043248, from.SendLocalizedMessage(1043248, args);
args // The pet will not accept you as a master because it does not trust you.~3_BLANK~
); // The pet refuses to be transferred because it will not obey ~1_NAME~.~3_BLANK~ to.SendLocalizedMessage(1043249, args);
to.SendLocalizedMessage(
1043249,
args
); // The pet will not accept you as a master because it does not trust you.~3_BLANK~
return false; return false;
} }
@ -2919,14 +2912,10 @@ namespace Server.Mobiles
{ {
var args = $"{to.Name}\t{from.Name}\t "; var args = $"{to.Name}\t{from.Name}\t ";
from.SendLocalizedMessage( // The pet refuses to be transferred because it will not obey you sufficiently.~3_BLANK~
1043250, from.SendLocalizedMessage(1043250, args);
args // The pet will not accept you as a master because it does not trust ~2_NAME~.~3_BLANK~
); // The pet refuses to be transferred because it will not obey you sufficiently.~3_BLANK~ to.SendLocalizedMessage(1043251, args);
to.SendLocalizedMessage(
1043251,
args
); // The pet will not accept you as a master because it does not trust ~2_NAME~.~3_BLANK~
} }
else if (accepted && to.Followers + m_Creature.ControlSlots > to.FollowersMax) else if (accepted && to.Followers + m_Creature.ControlSlots > to.FollowersMax)
{ {
@ -2986,10 +2975,8 @@ namespace Server.Mobiles
var args = $"{from.Name}\t{m_Creature.Name}\t{to.Name}"; var args = $"{from.Name}\t{m_Creature.Name}\t{to.Name}";
from.SendLocalizedMessage(1043253, args); // You have transferred your pet to ~3_GETTER~. from.SendLocalizedMessage(1043253, args); // You have transferred your pet to ~3_GETTER~.
to.SendLocalizedMessage( // ~1_NAME~ has transferred the allegiance of ~2_PET_NAME~ to you.
1043252, to.SendLocalizedMessage(1043252, args);
args
); // ~1_NAME~ has transferred the allegiance of ~2_PET_NAME~ to you.
} }
} }
} }
@ -3004,7 +2991,7 @@ namespace Server.Mobiles
public AITimer(BaseAI owner) public AITimer(BaseAI owner)
: base( : base(
TimeSpan.FromSeconds(Utility.RandomDouble()), TimeSpan.FromSeconds(Utility.Random(128) * 8),
TimeSpan.FromSeconds(Math.Max(0.0, owner.m_Mobile.CurrentSpeed)) TimeSpan.FromSeconds(Math.Max(0.0, owner.m_Mobile.CurrentSpeed))
) )
{ {

View file

@ -1,228 +1,50 @@
using System; using System;
using System.Collections.Generic;
using Server.Factions;
using Server.Mobiles; using Server.Mobiles;
namespace Server namespace Server;
public static class SpeedInfo
{ {
public class SpeedInfo public static double MinDelay { get; private set; }
public static double MaxDelay { get; private set; }
public static double MinMonsterDelay { get; private set; }
public static double MaxMonsterDelay { get; private set; }
// Determines the maximum dex for delay by dex
public static int MaxDex { get; private set; }
public static int MaxMonsterDex { get; private set; }
public static void Configure()
{ {
// Should we use the new method of speeds? // Default speed determined by dex (0 -> 190) for non-monster NPCs including pets
private static readonly bool Enabled = true; MinDelay = ServerConfiguration.GetOrUpdateSetting("movement.delay.npcMinDelay", 0.1);
MaxDelay = ServerConfiguration.GetOrUpdateSetting("movement.delay.npcMaxDelay", 0.5);
MaxDex = ServerConfiguration.GetOrUpdateSetting("movement.delay.maxDex", 190);
private static Dictionary<Type, SpeedInfo> m_Table; // Default speed determined by dex (0 -> 150) for monsters
MinMonsterDelay = ServerConfiguration.GetOrUpdateSetting("movement.delay.monsterMinDelay", 0.4);
MaxMonsterDelay = ServerConfiguration.GetOrUpdateSetting("movement.delay.monsterMaxDelay", 0.8);
MaxMonsterDex = ServerConfiguration.GetOrUpdateSetting("movement.delay.monsterMaxDex", 150);
}
private static readonly SpeedInfo[] m_Speeds = public static void GetSpeeds(BaseCreature bc, out double activeSpeed, out double passiveSpeed)
{
var isMonster = bc.IsMonster;
var monsterDelay = isMonster || bc.InActivePVPCombat();
var maxDex = isMonster ? MaxMonsterDex : MaxDex;
var dex = Math.Clamp(bc.Dex, 25, maxDex);
double min = monsterDelay ? MinMonsterDelay : MinDelay;
double max = monsterDelay ? MaxMonsterDelay : MaxDelay;
if (bc.IsParagon)
{ {
/* Slow */ min /= 2;
new( max = min + 0.5;
0.3,
0.6,
new[]
{
typeof(AntLion), typeof(ArcticOgreLord), typeof(BogThing),
typeof(Bogle), typeof(BoneKnight), typeof(EarthElemental),
typeof(Ettin), typeof(FrostOoze), typeof(FrostTroll),
typeof(GazerLarva), typeof(Ghoul), typeof(Golem),
typeof(HeadlessOne), typeof(Jwilson), typeof(Mummy),
typeof(Ogre), typeof(OgreLord), typeof(PlagueBeast),
typeof(Quagmire), typeof(Rat), typeof(RottingCorpse),
typeof(SewerRat), typeof(Skeleton), typeof(Slime),
typeof(Zombie), typeof(Walrus), typeof(RestlessSoul),
typeof(CrystalElemental), typeof(DarknightCreeper), typeof(MoundOfMaggots),
typeof(Juggernaut), typeof(Yamandon), typeof(Serado)
}
),
/* Fast */
new(
0.2,
0.4,
new[]
{
typeof(LordOaks), typeof(Silvani), typeof(AirElemental),
typeof(AncientWyrm), typeof(Balron), typeof(BladeSpirits),
typeof(DreadSpider), typeof(Efreet), typeof(EtherealWarrior),
typeof(Lich), typeof(Nightmare), typeof(OphidianArchmage),
typeof(OphidianMage), typeof(OphidianWarrior), typeof(OphidianMatriarch),
typeof(OphidianKnight), typeof(PoisonElemental), typeof(Revenant),
typeof(SandVortex), typeof(SavageRider), typeof(SavageShaman),
typeof(SnowElemental), typeof(WhiteWyrm), typeof(Wisp),
typeof(DemonKnight), typeof(GiantBlackWidow), typeof(SummonedAirElemental),
typeof(LesserHiryu), typeof(Hiryu), typeof(LadyOfTheSnow),
typeof(RaiJu), typeof(Ronin), typeof(RuneBeetle),
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),
typeof(Irk), typeof(Spite), typeof(LadyLissith),
typeof(LadySabrix), typeof(Malefic), typeof(Silk),
typeof(Virulent)
// TODO: Where to put Lurg, Putrefier, Swoop and Pyre? They seem slower.
}
),
/* Very Fast */
new(
0.175,
0.350,
new[]
{
typeof(Barracoon), typeof(Mephitis), typeof(Neira),
typeof(Rikktor), typeof(Semidar), typeof(EnergyVortex),
typeof(EliteNinja), typeof(Pixie), typeof(SilverSerpent),
typeof(VorpalBunny), typeof(FleshRenderer), typeof(KhaldunRevenant),
typeof(FactionDragoon), typeof(FactionKnight), typeof(FactionPaladin),
typeof(FactionHenchman), typeof(FactionMercenary), typeof(FactionNecromancer),
typeof(FactionSorceress), typeof(FactionWizard), typeof(FactionBerserker),
typeof(FactionPaladin), typeof(Leviathan), typeof(FireBeetle),
typeof(FanDancer), typeof(FactionDeathKnight)
}
),
/* Medium */
new(
0.25,
0.5,
new[]
{
typeof(AcidElemental), typeof(AgapiteElemental), typeof(Alligator),
typeof(AncientLich), typeof(Betrayer), typeof(Bird),
typeof(BlackBear), typeof(BlackSolenInfiltratorQueen), typeof(BlackSolenInfiltratorWarrior),
typeof(BlackSolenQueen), typeof(BlackSolenWarrior), typeof(BlackSolenWorker),
typeof(BloodElemental), typeof(Boar), typeof(Bogling),
typeof(BoneMagi), typeof(Brigand), typeof(BronzeElemental),
typeof(BrownBear), typeof(Bull), typeof(BullFrog),
typeof(Cat), typeof(Centaur), typeof(ChaosDaemon),
typeof(Chicken), typeof(GolemController), typeof(CopperElemental),
typeof(CopperElemental), typeof(Cougar), typeof(Cow),
typeof(Cyclops), typeof(Daemon), typeof(DeepSeaSerpent),
typeof(DesertOstard), typeof(DireWolf), typeof(Dog),
typeof(Dolphin), typeof(Dragon), typeof(Drake),
typeof(DullCopperElemental), typeof(Eagle), typeof(ElderGazer),
typeof(EvilMage), typeof(EvilMageLord), typeof(Executioner),
typeof(Savage), typeof(FireElemental), typeof(FireGargoyle),
typeof(FireSteed), typeof(ForestOstard), typeof(FrenziedOstard),
typeof(FrostSpider), typeof(Gargoyle), typeof(Gazer),
typeof(IceSerpent), typeof(GiantRat), typeof(GiantSerpent),
typeof(GiantSpider), typeof(GiantToad), typeof(Goat),
typeof(GoldenElemental), typeof(Gorilla), typeof(GreatHart),
typeof(GreyWolf), typeof(GrizzlyBear), typeof(Guardian),
typeof(Harpy), typeof(Harrower), typeof(HellHound),
typeof(Hind), typeof(HordeMinion), typeof(Horse),
typeof(Horse), typeof(IceElemental), typeof(IceFiend),
typeof(IceSnake), typeof(Imp), typeof(JackRabbit),
typeof(Kirin), typeof(Kraken), typeof(PredatorHellCat),
typeof(LavaLizard), typeof(LavaSerpent), typeof(LavaSnake),
typeof(Lizardman), typeof(Llama), typeof(Mongbat),
typeof(StrongMongbat), typeof(MountainGoat), typeof(Orc),
typeof(OrcBomber), typeof(OrcBrute), typeof(OrcCaptain),
typeof(OrcishLord), typeof(OrcishMage), typeof(PackHorse),
typeof(PackLlama), typeof(Panther), typeof(Pig),
typeof(PlagueSpawn), typeof(PolarBear), typeof(Rabbit),
typeof(Ratman), typeof(RatmanArcher), typeof(RatmanMage),
typeof(RedSolenInfiltratorQueen), typeof(RedSolenInfiltratorWarrior), typeof(RedSolenQueen),
typeof(RedSolenWarrior), typeof(RedSolenWorker), typeof(RidableLlama),
typeof(Ridgeback), typeof(Scorpion), typeof(SeaSerpent),
typeof(SerpentineDragon), typeof(Shade), typeof(ShadowIronElemental),
typeof(ShadowWisp), typeof(ShadowWyrm), typeof(Sheep),
typeof(SilverSteed), typeof(SkeletalDragon), typeof(SkeletalMage),
typeof(SkeletalMount), typeof(HellCat), typeof(Snake),
typeof(SnowLeopard), typeof(SpectralArmour), typeof(Spectre),
typeof(StoneGargoyle), typeof(StoneHarpy), typeof(SwampDragon),
typeof(ScaledSwampDragon), typeof(SwampTentacle), typeof(TerathanAvenger),
typeof(TerathanDrone), typeof(TerathanMatriarch), typeof(TerathanWarrior),
typeof(TimberWolf), typeof(Titan), typeof(Troll),
typeof(Unicorn), typeof(ValoriteElemental), typeof(VeriteElemental),
typeof(CoMWarHorse), typeof(MinaxWarHorse), typeof(SLWarHorse),
typeof(TBWarHorse), typeof(WaterElemental), typeof(WhippingVine),
typeof(WhiteWolf), typeof(Wraith), typeof(Wyvern),
typeof(KhaldunZealot), typeof(KhaldunSummoner), typeof(SavageRidgeback),
typeof(LichLord), typeof(SkeletalKnight), typeof(SummonedDaemon),
typeof(SummonedEarthElemental), typeof(SummonedWaterElemental), typeof(SummonedFireElemental),
typeof(MeerWarrior), typeof(MeerEternal), typeof(MeerMage),
typeof(MeerCaptain), typeof(JukaLord), typeof(JukaMage),
typeof(JukaWarrior), typeof(AbysmalHorror), typeof(BoneDemon),
typeof(Devourer), typeof(FleshGolem), typeof(Gibberling),
typeof(GoreFiend), typeof(Impaler), typeof(PatchworkSkeleton),
typeof(Ravager), typeof(ShadowKnight), typeof(SkitteringHopper),
typeof(Treefellow), typeof(VampireBat), typeof(WailingBanshee),
typeof(WandererOfTheVoid), typeof(Cursed), typeof(GrimmochDrummel),
typeof(LysanderGathenwale), typeof(MorgBergen), typeof(ShadowFiend),
typeof(SpectralArmour), typeof(TavaraSewel), typeof(ArcaneDaemon),
typeof(Doppleganger), typeof(EnslavedGargoyle), typeof(ExodusMinion),
typeof(ExodusOverseer), typeof(GargoyleDestroyer), typeof(GargoyleEnforcer),
typeof(Moloch), typeof(BakeKitsune), typeof(DeathwatchBeetleHatchling),
typeof(Kappa), typeof(KazeKemono), typeof(DeathwatchBeetle),
typeof(TsukiWolf), typeof(YomotsuElder), typeof(YomotsuPriest),
typeof(YomotsuWarrior), typeof(RevenantLion), typeof(Oni),
typeof(Gaman), typeof(Crane), typeof(Beetle)
}
)
};
public SpeedInfo(double activeSpeed, double passiveSpeed, Type[] types)
{
ActiveSpeed = activeSpeed;
PassiveSpeed = passiveSpeed;
Types = types;
} }
public double ActiveSpeed { get; set; } activeSpeed = Math.Max(max - (max - min) * ((double)dex / maxDex), min);
passiveSpeed = activeSpeed * 2;
public double PassiveSpeed { get; set; }
public Type[] Types { get; set; }
public static bool Contains(object obj)
{
if (!Enabled)
{
return false;
}
if (m_Table == null)
{
LoadTable();
}
return m_Table!.ContainsKey(obj.GetType());
}
public static bool GetSpeeds(object obj, ref double activeSpeed, ref double passiveSpeed)
{
if (!Enabled)
{
return false;
}
if (m_Table == null)
{
LoadTable();
}
if (!m_Table!.TryGetValue(obj.GetType(), out var sp))
{
return false;
}
activeSpeed = sp.ActiveSpeed;
passiveSpeed = sp.PassiveSpeed;
return true;
}
private static void LoadTable()
{
m_Table = new Dictionary<Type, SpeedInfo>();
for (var i = 0; i < m_Speeds.Length; ++i)
{
var info = m_Speeds[i];
var types = info.Types;
for (var j = 0; j < types.Length; ++j)
{
m_Table[types[j]] = info;
}
}
}
} }
} }

View file

@ -4,7 +4,7 @@ namespace Server.Mobiles
public class BlackBear : BaseCreature public class BlackBear : BaseCreature
{ {
[Constructible] [Constructible]
public BlackBear() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public BlackBear() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 211; Body = 211;
BaseSoundID = 0xA3; BaseSoundID = 0xA3;

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class BrownBear : BaseCreature public class BrownBear : BaseCreature
{ {
[Constructible] [Constructible]
public BrownBear() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public BrownBear() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 167; Body = 167;
BaseSoundID = 0xA3; BaseSoundID = 0xA3;

View file

@ -4,7 +4,7 @@ namespace Server.Mobiles
public class GrizzlyBear : BaseCreature public class GrizzlyBear : BaseCreature
{ {
[Constructible] [Constructible]
public GrizzlyBear() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public GrizzlyBear() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 212; Body = 212;
BaseSoundID = 0xA3; BaseSoundID = 0xA3;

View file

@ -4,7 +4,7 @@ namespace Server.Mobiles
public class PolarBear : BaseCreature public class PolarBear : BaseCreature
{ {
[Constructible] [Constructible]
public PolarBear() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public PolarBear() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 213; Body = 213;
BaseSoundID = 0xA3; BaseSoundID = 0xA3;

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class Chicken : BaseCreature public class Chicken : BaseCreature
{ {
[Constructible] [Constructible]
public Chicken() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public Chicken() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 0xD0; Body = 0xD0;
BaseSoundID = 0x6E; BaseSoundID = 0x6E;

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class Crane : BaseCreature public class Crane : BaseCreature
{ {
[Constructible] [Constructible]
public Crane() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public Crane() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 254; Body = 254;
BaseSoundID = 0x4D7; BaseSoundID = 0x4D7;

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class Eagle : BaseCreature public class Eagle : BaseCreature
{ {
[Constructible] [Constructible]
public Eagle() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public Eagle() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 5; Body = 5;
BaseSoundID = 0x2EE; BaseSoundID = 0x2EE;

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class Phoenix : BaseCreature public class Phoenix : BaseCreature
{ {
[Constructible] [Constructible]
public Phoenix() : base(AIType.AI_Mage, FightMode.Aggressor, 10, 1, 0.2, 0.4) public Phoenix() : base(AIType.AI_Mage, FightMode.Aggressor)
{ {
Body = 5; Body = 5;
Hue = 0x674; Hue = 0x674;

View file

@ -4,7 +4,7 @@ namespace Server.Mobiles
public class DireWolf : BaseCreature public class DireWolf : BaseCreature
{ {
[Constructible] [Constructible]
public DireWolf() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) public DireWolf() : base(AIType.AI_Melee)
{ {
Body = 23; Body = 23;
BaseSoundID = 0xE5; BaseSoundID = 0xE5;

View file

@ -4,7 +4,7 @@ namespace Server.Mobiles
public class GreyWolf : BaseCreature public class GreyWolf : BaseCreature
{ {
[Constructible] [Constructible]
public GreyWolf() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public GreyWolf() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = Utility.RandomList(25, 27); Body = Utility.RandomList(25, 27);
BaseSoundID = 0xE5; BaseSoundID = 0xE5;

View file

@ -4,7 +4,7 @@ namespace Server.Mobiles
public class TimberWolf : BaseCreature public class TimberWolf : BaseCreature
{ {
[Constructible] [Constructible]
public TimberWolf() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public TimberWolf() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 225; Body = 225;
BaseSoundID = 0xE5; BaseSoundID = 0xE5;

View file

@ -4,7 +4,7 @@ namespace Server.Mobiles
public class WhiteWolf : BaseCreature public class WhiteWolf : BaseCreature
{ {
[Constructible] [Constructible]
public WhiteWolf() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public WhiteWolf() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = Utility.RandomList(34, 37); Body = Utility.RandomList(34, 37);
BaseSoundID = 0xE5; BaseSoundID = 0xE5;

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class Bull : BaseCreature public class Bull : BaseCreature
{ {
[Constructible] [Constructible]
public Bull() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public Bull() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = Utility.RandomList(0xE8, 0xE9); Body = Utility.RandomList(0xE8, 0xE9);
BaseSoundID = 0x64; BaseSoundID = 0x64;

View file

@ -5,7 +5,7 @@ namespace Server.Mobiles
public class Cow : BaseCreature public class Cow : BaseCreature
{ {
[Constructible] [Constructible]
public Cow() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public Cow() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = Utility.RandomList(0xD8, 0xE7); Body = Utility.RandomList(0xD8, 0xE7);
BaseSoundID = 0x78; BaseSoundID = 0x78;

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class Cougar : BaseCreature public class Cougar : BaseCreature
{ {
[Constructible] [Constructible]
public Cougar() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public Cougar() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 63; Body = 63;
BaseSoundID = 0x73; BaseSoundID = 0x73;

View file

@ -4,7 +4,7 @@ namespace Server.Mobiles
public class HellCat : BaseCreature public class HellCat : BaseCreature
{ {
[Constructible] [Constructible]
public HellCat() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) public HellCat() : base(AIType.AI_Melee)
{ {
Body = 0xC9; Body = 0xC9;
Hue = Utility.RandomList(0x647, 0x650, 0x659, 0x662, 0x66B, 0x674); Hue = Utility.RandomList(0x647, 0x650, 0x659, 0x662, 0x66B, 0x674);

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class Panther : BaseCreature public class Panther : BaseCreature
{ {
[Constructible] [Constructible]
public Panther() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public Panther() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 0xD6; Body = 0xD6;
Hue = 0x901; Hue = 0x901;

View file

@ -4,7 +4,7 @@ namespace Server.Mobiles
public class PredatorHellCat : BaseCreature public class PredatorHellCat : BaseCreature
{ {
[Constructible] [Constructible]
public PredatorHellCat() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) public PredatorHellCat() : base(AIType.AI_Melee)
{ {
Body = 127; Body = 127;
BaseSoundID = 0xBA; BaseSoundID = 0xBA;

View file

@ -4,7 +4,7 @@ namespace Server.Mobiles
public class SnowLeopard : BaseCreature public class SnowLeopard : BaseCreature
{ {
[Constructible] [Constructible]
public SnowLeopard() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public SnowLeopard() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = Utility.RandomList(64, 65); Body = Utility.RandomList(64, 65);
BaseSoundID = 0x73; BaseSoundID = 0x73;

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class Boar : BaseCreature public class Boar : BaseCreature
{ {
[Constructible] [Constructible]
public Boar() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public Boar() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 0x122; Body = 0x122;
BaseSoundID = 0xC4; BaseSoundID = 0xC4;

View file

@ -4,7 +4,7 @@ namespace Server.Mobiles
public class BullFrog : BaseCreature public class BullFrog : BaseCreature
{ {
[Constructible] [Constructible]
public BullFrog() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public BullFrog() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 81; Body = 81;
Hue = Utility.RandomList(0x5AC, 0x5A3, 0x59A, 0x591, 0x588, 0x57F); Hue = Utility.RandomList(0x5AC, 0x5A3, 0x59A, 0x591, 0x588, 0x57F);

View file

@ -4,7 +4,7 @@ namespace Server.Mobiles
{ {
[Constructible] [Constructible]
public Dolphin() public Dolphin()
: base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 0x97; Body = 0x97;
BaseSoundID = 0x8A; BaseSoundID = 0x8A;

View file

@ -5,7 +5,7 @@ namespace Server.Mobiles
public class Gaman : BaseCreature public class Gaman : BaseCreature
{ {
[Constructible] [Constructible]
public Gaman() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public Gaman() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 248; Body = 248;

View file

@ -4,7 +4,7 @@ namespace Server.Mobiles
public class GiantToad : BaseCreature public class GiantToad : BaseCreature
{ {
[Constructible] [Constructible]
public GiantToad() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) public GiantToad() : base(AIType.AI_Melee)
{ {
Body = 80; Body = 80;
BaseSoundID = 0x26B; BaseSoundID = 0x26B;

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class Goat : BaseCreature public class Goat : BaseCreature
{ {
[Constructible] [Constructible]
public Goat() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public Goat() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 0xD1; Body = 0xD1;
BaseSoundID = 0x99; BaseSoundID = 0x99;

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class Gorilla : BaseCreature public class Gorilla : BaseCreature
{ {
[Constructible] [Constructible]
public Gorilla() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public Gorilla() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 0x1D; Body = 0x1D;
BaseSoundID = 0x9E; BaseSoundID = 0x9E;

View file

@ -4,7 +4,7 @@ namespace Server.Mobiles
public class GreatHart : BaseCreature public class GreatHart : BaseCreature
{ {
[Constructible] [Constructible]
public GreatHart() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public GreatHart() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 0xEA; Body = 0xEA;

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class Hind : BaseCreature public class Hind : BaseCreature
{ {
[Constructible] [Constructible]
public Hind() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public Hind() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 0xED; Body = 0xED;

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class Llama : BaseCreature public class Llama : BaseCreature
{ {
[Constructible] [Constructible]
public Llama() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public Llama() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 0xDC; Body = 0xDC;
BaseSoundID = 0x3F3; BaseSoundID = 0x3F3;

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class MountainGoat : BaseCreature public class MountainGoat : BaseCreature
{ {
[Constructible] [Constructible]
public MountainGoat() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public MountainGoat() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 88; Body = 88;
BaseSoundID = 0x99; BaseSoundID = 0x99;

View file

@ -7,7 +7,7 @@ namespace Server.Mobiles
public class PackHorse : BaseCreature public class PackHorse : BaseCreature
{ {
[Constructible] [Constructible]
public PackHorse() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public PackHorse() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 291; Body = 291;
BaseSoundID = 0xA8; BaseSoundID = 0xA8;

View file

@ -7,7 +7,7 @@ namespace Server.Mobiles
public class PackLlama : BaseCreature public class PackLlama : BaseCreature
{ {
[Constructible] [Constructible]
public PackLlama() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public PackLlama() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 292; Body = 292;
BaseSoundID = 0x3F3; BaseSoundID = 0x3F3;

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class Pig : BaseCreature public class Pig : BaseCreature
{ {
[Constructible] [Constructible]
public Pig() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public Pig() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 0xCB; Body = 0xCB;
BaseSoundID = 0xC4; BaseSoundID = 0xC4;

View file

@ -9,7 +9,7 @@ namespace Server.Mobiles
private DateTime m_NextWoolTime; private DateTime m_NextWoolTime;
[Constructible] [Constructible]
public Sheep() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public Sheep() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 0xCF; Body = 0xCF;
BaseSoundID = 0xD6; BaseSoundID = 0xD6;

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class Walrus : BaseCreature public class Walrus : BaseCreature
{ {
[Constructible] [Constructible]
public Walrus() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public Walrus() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 0xDD; Body = 0xDD;
BaseSoundID = 0xE0; BaseSoundID = 0xE0;

View file

@ -12,7 +12,7 @@ namespace Server.Mobiles
public BaseMount( public BaseMount(
string name, int bodyID, int itemID, AIType aiType, FightMode fightMode, int rangePerception, string name, int bodyID, int itemID, AIType aiType, FightMode fightMode, int rangePerception,
int rangeFight, double activeSpeed, double passiveSpeed int rangeFight, double activeSpeed = -1, double passiveSpeed = -1
) : base( ) : base(
aiType, aiType,
fightMode, fightMode,

View file

@ -11,7 +11,7 @@ namespace Server.Mobiles
[Constructible] [Constructible]
public Hiryu() public Hiryu()
: base("a hiryu", 243, 0x3E94, AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) : base("a hiryu", 243, 0x3E94, AIType.AI_Melee, FightMode.Closest, 10, 1)
{ {
Hue = GetHue(); Hue = GetHue();

View file

@ -7,7 +7,7 @@ namespace Server.Mobiles
public class Kirin : BaseMount public class Kirin : BaseMount
{ {
[Constructible] [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)
{ {
BaseSoundID = 0x3C5; BaseSoundID = 0x3C5;

View file

@ -11,7 +11,7 @@ namespace Server.Mobiles
[Constructible] [Constructible]
public LesserHiryu() public LesserHiryu()
: base("a lesser hiryu", 243, 0x3E94, AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) : base("a lesser hiryu", 243, 0x3E94, AIType.AI_Melee, FightMode.Closest, 10, 1)
{ {
Hue = GetHue(); Hue = GetHue();

View file

@ -7,7 +7,7 @@ namespace Server.Mobiles
public class Unicorn : BaseMount public class Unicorn : BaseMount
{ {
[Constructible] [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)
{ {
BaseSoundID = 0x4BC; BaseSoundID = 0x4BC;

View file

@ -4,7 +4,7 @@ namespace Server.Mobiles
{ {
public BaseWarHorse( public BaseWarHorse(
int bodyID, int itemID, AIType aiType, FightMode fightMode, int rangePerception, int rangeFight, int bodyID, int itemID, AIType aiType, FightMode fightMode, int rangePerception, int rangeFight,
double activeSpeed, double passiveSpeed double activeSpeed = -1, double passiveSpeed = -1
) : base( ) : base(
"a war horse", "a war horse",
bodyID, bodyID,

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class CoMWarHorse : BaseWarHorse public class CoMWarHorse : BaseWarHorse
{ {
[Constructible] [Constructible]
public CoMWarHorse() : base(0x77, 0x3EB1, AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4) public CoMWarHorse() : base(0x77, 0x3EB1, AIType.AI_Melee, FightMode.Aggressor, 10, 1)
{ {
} }

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class MinaxWarHorse : BaseWarHorse public class MinaxWarHorse : BaseWarHorse
{ {
[Constructible] [Constructible]
public MinaxWarHorse() : base(0x78, 0x3EAF, AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4) public MinaxWarHorse() : base(0x78, 0x3EAF, AIType.AI_Melee, FightMode.Aggressor, 10, 1)
{ {
} }

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class SLWarHorse : BaseWarHorse public class SLWarHorse : BaseWarHorse
{ {
[Constructible] [Constructible]
public SLWarHorse() : base(0x79, 0x3EB0, AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4) public SLWarHorse() : base(0x79, 0x3EB0, AIType.AI_Melee, FightMode.Aggressor, 10, 1)
{ {
} }

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class TBWarHorse : BaseWarHorse public class TBWarHorse : BaseWarHorse
{ {
[Constructible] [Constructible]
public TBWarHorse() : base(0x76, 0x3EB2, AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4) public TBWarHorse() : base(0x76, 0x3EB2, AIType.AI_Melee, FightMode.Aggressor, 10, 1)
{ {
} }

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class Alligator : BaseCreature public class Alligator : BaseCreature
{ {
[Constructible] [Constructible]
public Alligator() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) public Alligator() : base(AIType.AI_Melee)
{ {
Body = 0xCA; Body = 0xCA;
BaseSoundID = 660; BaseSoundID = 660;

View file

@ -6,7 +6,7 @@ namespace Server.Mobiles
public class GiantSerpent : BaseCreature public class GiantSerpent : BaseCreature
{ {
[Constructible] [Constructible]
public GiantSerpent() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) public GiantSerpent() : base(AIType.AI_Melee)
{ {
Body = 0x15; Body = 0x15;
Hue = Utility.RandomSnakeHue(); Hue = Utility.RandomSnakeHue();

View file

@ -6,7 +6,7 @@ namespace Server.Mobiles
public class IceSerpent : BaseCreature public class IceSerpent : BaseCreature
{ {
[Constructible] [Constructible]
public IceSerpent() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) public IceSerpent() : base(AIType.AI_Melee)
{ {
Body = 89; Body = 89;
BaseSoundID = 219; BaseSoundID = 219;

View file

@ -4,7 +4,7 @@ namespace Server.Mobiles
public class IceSnake : BaseCreature public class IceSnake : BaseCreature
{ {
[Constructible] [Constructible]
public IceSnake() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) public IceSnake() : base(AIType.AI_Melee)
{ {
Body = 52; Body = 52;
Hue = 0x480; Hue = 0x480;

View file

@ -6,7 +6,7 @@ namespace Server.Mobiles
public class LavaLizard : BaseCreature public class LavaLizard : BaseCreature
{ {
[Constructible] [Constructible]
public LavaLizard() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) public LavaLizard() : base(AIType.AI_Melee)
{ {
Body = 0xCE; Body = 0xCE;
Hue = Utility.RandomList(0x647, 0x650, 0x659, 0x662, 0x66B, 0x674); Hue = Utility.RandomList(0x647, 0x650, 0x659, 0x662, 0x66B, 0x674);

View file

@ -6,7 +6,7 @@ namespace Server.Mobiles
public class LavaSerpent : BaseCreature public class LavaSerpent : BaseCreature
{ {
[Constructible] [Constructible]
public LavaSerpent() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) public LavaSerpent() : base(AIType.AI_Melee)
{ {
Body = 90; Body = 90;
BaseSoundID = 219; BaseSoundID = 219;

View file

@ -6,7 +6,7 @@ namespace Server.Mobiles
public class LavaSnake : BaseCreature public class LavaSnake : BaseCreature
{ {
[Constructible] [Constructible]
public LavaSnake() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) public LavaSnake() : base(AIType.AI_Melee)
{ {
Body = 52; Body = 52;
Hue = Utility.RandomList(0x647, 0x650, 0x659, 0x662, 0x66B, 0x674); Hue = Utility.RandomList(0x647, 0x650, 0x659, 0x662, 0x66B, 0x674);

View file

@ -7,7 +7,7 @@ namespace Server.Mobiles
public class SilverSerpent : BaseCreature public class SilverSerpent : BaseCreature
{ {
[Constructible] [Constructible]
public SilverSerpent() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) public SilverSerpent() : base(AIType.AI_Melee)
{ {
Body = 92; Body = 92;
BaseSoundID = 219; BaseSoundID = 219;

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class Snake : BaseCreature public class Snake : BaseCreature
{ {
[Constructible] [Constructible]
public Snake() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) public Snake() : base(AIType.AI_Melee)
{ {
Body = 52; Body = 52;
Hue = Utility.RandomSnakeHue(); Hue = Utility.RandomSnakeHue();

View file

@ -4,7 +4,7 @@ namespace Server.Mobiles
public class GiantRat : BaseCreature public class GiantRat : BaseCreature
{ {
[Constructible] [Constructible]
public GiantRat() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) public GiantRat() : base(AIType.AI_Melee)
{ {
Body = 0xD7; Body = 0xD7;
BaseSoundID = 0x188; BaseSoundID = 0x188;

View file

@ -4,7 +4,7 @@ namespace Server.Mobiles
public class JackRabbit : BaseCreature public class JackRabbit : BaseCreature
{ {
[Constructible] [Constructible]
public JackRabbit() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public JackRabbit() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 0xCD; Body = 0xCD;
Hue = 0x1BB; Hue = 0x1BB;

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class Rabbit : BaseCreature public class Rabbit : BaseCreature
{ {
[Constructible] [Constructible]
public Rabbit() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public Rabbit() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 205; Body = 205;

View file

@ -4,7 +4,7 @@ namespace Server.Mobiles
public class SewerRat : BaseCreature public class SewerRat : BaseCreature
{ {
[Constructible] [Constructible]
public SewerRat() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) public SewerRat() : base(AIType.AI_Melee)
{ {
Body = 238; Body = 238;
BaseSoundID = 0xCC; BaseSoundID = 0xCC;

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class Jwilson : BaseCreature public class Jwilson : BaseCreature
{ {
[Constructible] [Constructible]
public Jwilson() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) public Jwilson() : base(AIType.AI_Melee)
{ {
Hue = Utility.RandomList(0x89C, 0x8A2, 0x8A8, 0x8AE); Hue = Utility.RandomList(0x89C, 0x8A2, 0x8A8, 0x8AE);
Body = 0x33; Body = 0x33;

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class Parrot : BaseCreature public class Parrot : BaseCreature
{ {
[Constructible] [Constructible]
public Parrot() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public Parrot() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Body = 831; Body = 831;
VirtualArmor = Utility.Random(0, 6); VirtualArmor = Utility.Random(0, 6);

View file

@ -3,7 +3,7 @@ namespace Server.Mobiles
public class Bird : BaseCreature public class Bird : BaseCreature
{ {
[Constructible] [Constructible]
public Bird() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public Bird() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
if (Utility.RandomBool()) if (Utility.RandomBool())
{ {
@ -82,7 +82,7 @@ namespace Server.Mobiles
public class TropicalBird : BaseCreature public class TropicalBird : BaseCreature
{ {
[Constructible] [Constructible]
public TropicalBird() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4) public TropicalBird() : base(AIType.AI_Animal, FightMode.Aggressor)
{ {
Hue = Utility.RandomBirdHue(); Hue = Utility.RandomBirdHue();

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