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);
  ```
This commit is contained in:
Kamron Batman 2021-08-29 00:43:55 -07:00 • committed by GitHub
parent bf20800382
commit 8ffd5a5bd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
58 changed files with 147 additions and 125 deletions

View file

@ -25,7 +25,9 @@ namespace Server.SkillHandlers
/* Ring */ { 0, 5, 0, 10, 15, 25, 0 },
/* Chain */ { 0, 0, 10, 0, 15, 25, 0 },
/* Plate */ { 5, 5, 10, 10, 15, 25, 0 },
/* Dragon */ { 0, 5, 10, 10, 15, 25, 0 }
/* Dragon */ { 5, 5, 10, 10, 15, 25, 0 },
/* Wood */ { 5, 5, 10, 10, 15, 25, 0 },
/* Stone */ { 5, 5, 10, 10, 15, 25, 0 }
};
public static void Initialize()
@ -44,7 +46,7 @@ namespace Server.SkillHandlers
for (var i = 0; i < m.Items.Count; i++)
{
if (!(m.Items[i] is BaseArmor armor))
if (m.Items[i] is not BaseArmor armor)
{
continue;
}