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:
parent
bf20800382
commit
8ffd5a5bd0
58 changed files with 147 additions and 125 deletions
|
|
@ -713,11 +713,16 @@ namespace Server.Items
|
|||
list.Add(1060636); // exceptional
|
||||
}
|
||||
|
||||
if (RequiredRace == Race.Elf)
|
||||
if (RequiredRaces == Race.AllowElvesOnly)
|
||||
{
|
||||
list.Add(1075086); // Elves Only
|
||||
}
|
||||
|
||||
if (RequiredRaces == Race.AllowGargoylesOnly)
|
||||
{
|
||||
list.Add(1111709); // Gargoyles Only
|
||||
}
|
||||
|
||||
SkillBonuses?.GetProperties(list);
|
||||
|
||||
int prop;
|
||||
|
|
|
|||
|
|
@ -479,7 +479,7 @@ namespace Server.Items
|
|||
[Constructible]
|
||||
public FemaleElvenRobe(int hue = 0) : base(0x2FBA, hue) => Weight = 2.0;
|
||||
|
||||
public override Race RequiredRace => Race.Elf;
|
||||
public override int RequiredRaces => Race.AllowElvesOnly;
|
||||
|
||||
public override bool AllowMaleWearer => false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,6 @@ namespace Server.Items
|
|||
[Constructible]
|
||||
public ElvenPants(int hue = 0) : base(0x2FC3, hue) => Weight = 2.0;
|
||||
|
||||
public override Race RequiredRace => Race.Elf;
|
||||
public override int RequiredRaces => Race.AllowElvesOnly;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ namespace Server.Items
|
|||
[Constructible]
|
||||
public ElvenShirt(int hue = 0) : base(0x3175, hue) => Weight = 2.0;
|
||||
|
||||
public override Race RequiredRace => Race.Elf;
|
||||
public override int RequiredRaces => Race.AllowElvesOnly;
|
||||
}
|
||||
|
||||
[Serializable(0)]
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ namespace Server.Items
|
|||
|
||||
public override CraftResource DefaultResource => CraftResource.RegularLeather;
|
||||
|
||||
public override Race RequiredRace => Race.Elf;
|
||||
public override int RequiredRaces => Race.AllowElvesOnly;
|
||||
|
||||
public override bool Dye(Mobile from, DyeTub sender) => false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ namespace Server.Items
|
|||
[Constructible]
|
||||
public WoodlandBelt(int hue = 0) : base(0x2B68, hue) => Weight = 4.0;
|
||||
|
||||
public override Race RequiredRace => Race.Elf;
|
||||
public override int RequiredRaces => Race.AllowElvesOnly;
|
||||
|
||||
public override bool Dye(Mobile from, DyeTub sender)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue