ModernUO/Projects/UOContent/Items/Armor/Helmets/Circlet.cs
Kamron Batman 8ffd5a5bd0
fix: Updates races to properly support gargoyle equipment. (#744)
* Adds `RaceFlag` to the `Race` object. This is `1 << RaceIndex`
* Replaces `RequiredRace`  with `RequiredRaces` for items.
* Adds convenience flags for `RequiredRaces`
  ```cs
  
  public const int AllowAllRaces = 0x7;      // Race.Human.RaceFlag | Race.Elf.RaceFlag | Race.Gargoyle.RaceFlag
  public const int AllowHumanOrElves = 0x3;  // Race.Human.RaceFlag | Race.Elf.RaceFlag
  public const int AllowElvesOnly = 0x2;     // Race.Elf.RaceFlag
  public const int AllowGargoylesOnly = 0x4; // Race.Gargoyle.RaceFlag
  ```
* Example usage on an item:
  ```cs
  public override int RequiredRaces => Race.AllowHumanOrElves;
  ```
* Adds Wood and Stone armor material types
* Updates Woodland armor to Wood
* Adds proper messaging for race restrictions
* Adds gargoyle only for object properties
* Adds `CheckRace` functions for validating if a race or mobile can use the item:
  ```cs
  bool CheckRace(Race race);
  bool CheckRace(Mobile from, bool message = true);
  ```
2021-08-29 00:43:55 -07:00

30 lines
975 B
C#

namespace Server.Items
{
[Serializable(0)]
[Flippable(0x2B6E, 0x3165)]
public partial class Circlet : BaseArmor
{
[Constructible]
public Circlet() : base(0x2B6E) => Weight = 2.0;
public override int BasePhysicalResistance => 1;
public override int BaseFireResistance => 5;
public override int BaseColdResistance => 2;
public override int BasePoisonResistance => 2;
public override int BaseEnergyResistance => 5;
public override int InitMinHits => 50;
public override int InitMaxHits => 65;
public override int AosStrReq => 10;
public override int OldStrReq => 10;
public override int ArmorBase => 30;
public override ArmorMaterialType MaterialType => ArmorMaterialType.Plate;
public override ArmorMeditationAllowance DefMedAllowance => ArmorMeditationAllowance.All;
public override int RequiredRaces => Race.AllowElvesOnly;
}
}