[Constants] Change Race Changes to Race Namespace (#5000)

This commit is contained in:
Alex King
2025-08-30 15:33:11 -04:00
committed by GitHub
parent 33df8ea665
commit 92c8b0e585
23 changed files with 2127 additions and 2396 deletions
+41 -41
View File
@@ -317,7 +317,7 @@ Bot::Bot(
);
} else if (spell.base_value[x1] == -2) // WTF IS THIS
{
if (GetRace() == IKSAR || GetRace() == VAHSHIR || GetRace() <= GNOME) {
if (GetRace() == Race::Iksar || GetRace() == Race::VahShir || GetRace() <= Race::Gnome) {
SendIllusionPacket(
AppearanceStruct{
.gender_id = GetGender(),
@@ -346,27 +346,27 @@ Bot::Bot(
}
switch (spell.base_value[x1]) {
case OGRE:
case Race::Ogre:
SendAppearancePacket(AppearanceType::Size, 9);
break;
case TROLL:
case Race::Troll:
SendAppearancePacket(AppearanceType::Size, 8);
break;
case VAHSHIR:
case BARBARIAN:
case Race::VahShir:
case Race::Barbarian:
SendAppearancePacket(AppearanceType::Size, 7);
break;
case HALF_ELF:
case WOOD_ELF:
case DARK_ELF:
case FROGLOK:
case Race::HalfElf:
case Race::WoodElf:
case Race::DarkElf:
case Race::Froglok2:
SendAppearancePacket(AppearanceType::Size, 5);
break;
case DWARF:
case Race::Dwarf:
SendAppearancePacket(AppearanceType::Size, 4);
break;
case HALFLING:
case GNOME:
case Race::Halfling:
case Race::Gnome:
SendAppearancePacket(AppearanceType::Size, 3);
break;
default:
@@ -457,10 +457,10 @@ Bot::Bot(
int resurrection_sickness_spell_id = (
RuleB(Bots, OldRaceRezEffects) &&
(
GetRace() == BARBARIAN ||
GetRace() == DWARF ||
GetRace() == TROLL ||
GetRace() == OGRE
GetRace() == Race::Barbarian ||
GetRace() == Race::Dwarf ||
GetRace() == Race::Troll ||
GetRace() == Race::Ogre
) ?
RuleI(Bots, OldResurrectionSicknessSpell) :
RuleI(Bots, ResurrectionSicknessSpell)
@@ -955,9 +955,9 @@ void Bot::GenerateBaseStats()
float BotSize = GetSize();
switch(GetRace()) {
case HUMAN: // Humans have no race bonus
case Race::Human: // Humans have no race bonus
break;
case BARBARIAN:
case Race::Barbarian:
Strength += 28;
Stamina += 20;
Agility += 7;
@@ -968,7 +968,7 @@ void Bot::GenerateBaseStats()
BotSize = 7.0;
ColdResist += 10;
break;
case ERUDITE:
case Race::Erudite:
Strength -= 15;
Stamina -= 5;
Agility -= 5;
@@ -979,7 +979,7 @@ void Bot::GenerateBaseStats()
MagicResist += 5;
DiseaseResist -= 5;
break;
case WOOD_ELF:
case Race::WoodElf:
Strength -= 10;
Stamina -= 10;
Agility += 20;
@@ -987,7 +987,7 @@ void Bot::GenerateBaseStats()
Wisdom += 5;
BotSize = 5.0;
break;
case HIGH_ELF:
case Race::HighElf:
Strength -= 20;
Stamina -= 10;
Agility += 10;
@@ -996,7 +996,7 @@ void Bot::GenerateBaseStats()
Intelligence += 12;
Charisma += 5;
break;
case DARK_ELF:
case Race::DarkElf:
Strength -= 15;
Stamina -= 10;
Agility += 15;
@@ -1005,7 +1005,7 @@ void Bot::GenerateBaseStats()
Charisma -= 15;
BotSize = 5.0;
break;
case HALF_ELF:
case Race::HalfElf:
Strength -= 5;
Stamina -= 5;
Agility += 15;
@@ -1013,7 +1013,7 @@ void Bot::GenerateBaseStats()
Wisdom -= 15;
BotSize = 5.5;
break;
case DWARF:
case Race::Dwarf:
Strength += 15;
Stamina += 15;
Agility -= 5;
@@ -1025,7 +1025,7 @@ void Bot::GenerateBaseStats()
MagicResist -= 5;
PoisonResist += 5;
break;
case TROLL:
case Race::Troll:
Strength += 33;
Stamina += 34;
Agility += 8;
@@ -1035,7 +1035,7 @@ void Bot::GenerateBaseStats()
BotSize = 8.0;
FireResist -= 20;
break;
case OGRE:
case Race::Ogre:
Strength += 55;
Stamina += 77;
Agility -= 5;
@@ -1045,7 +1045,7 @@ void Bot::GenerateBaseStats()
Charisma -= 38;
BotSize = 9.0;
break;
case HALFLING:
case Race::Halfling:
Strength -= 5;
Agility += 20;
Dexterity += 15;
@@ -1056,7 +1056,7 @@ void Bot::GenerateBaseStats()
PoisonResist += 5;
DiseaseResist += 5;
break;
case GNOME:
case Race::Gnome:
Strength -= 15;
Stamina -= 5;
Agility += 10;
@@ -1066,7 +1066,7 @@ void Bot::GenerateBaseStats()
Charisma -= 15;
BotSize = 3.0;
break;
case IKSAR:
case Race::Iksar:
Strength -= 5;
Stamina -= 5;
Agility += 15;
@@ -1076,7 +1076,7 @@ void Bot::GenerateBaseStats()
MagicResist -= 5;
FireResist -= 5;
break;
case VAHSHIR:
case Race::VahShir:
Strength += 15;
Agility += 15;
Dexterity -= 5;
@@ -1087,7 +1087,7 @@ void Bot::GenerateBaseStats()
MagicResist -= 5;
FireResist -= 5;
break;
case FROGLOK:
case Race::Froglok2:
Strength -= 5;
Stamina += 5;
Agility += 25;
@@ -1097,7 +1097,7 @@ void Bot::GenerateBaseStats()
MagicResist -= 5;
FireResist -= 5;
break;
case DRAKKIN:
case Race::Drakkin:
Strength -= 5;
Stamina += 5;
Agility += 10;
@@ -1140,7 +1140,7 @@ void Bot::GenerateBaseStats()
void Bot::GenerateAppearance() {
// Randomize facial appearance
int iFace = 0;
if (GetRace() == BARBARIAN) // Barbarian w/Tatoo
if (GetRace() == Race::Barbarian) // Barbarian w/Tatoo
{
iFace = zone->random.Int(0, 79);
}
@@ -1152,13 +1152,13 @@ void Bot::GenerateAppearance() {
int iHair = 0;
int iBeard = 0;
int iBeardColor = 1;
if (GetRace() == DRAKKIN) {
if (GetRace() == Race::Drakkin) {
iHair = zone->random.Int(0, 8);
iBeard = zone->random.Int(0, 11);
iBeardColor = zone->random.Int(0, 3);
} else if (GetGender()) {
iHair = zone->random.Int(0, 2);
if (GetRace() == DWARF && zone->random.Int(1, 100) < 50) {
if (GetRace() == Race::Dwarf && zone->random.Int(1, 100) < 50) {
iFace += 10;
}
} else {
@@ -1168,7 +1168,7 @@ void Bot::GenerateAppearance() {
}
int iHairColor = 0;
if (GetRace() == DRAKKIN) {
if (GetRace() == Race::Drakkin) {
iHairColor = zone->random.Int(0, 3);
} else {
iHairColor = zone->random.Int(0, 19);
@@ -1176,7 +1176,7 @@ void Bot::GenerateAppearance() {
auto iEyeColor1 = (uint8)zone->random.Int(0, 9);
uint8 iEyeColor2 = 0;
if (GetRace() == DRAKKIN) {
if (GetRace() == Race::Drakkin) {
iEyeColor1 = iEyeColor2 = (uint8)zone->random.Int(0, 11);
} else if (zone->random.Int(1, 100) > 96) {
iEyeColor2 = zone->random.Int(0, 9);
@@ -1187,7 +1187,7 @@ void Bot::GenerateAppearance() {
int iHeritage = 0;
int iTattoo = 0;
int iDetails = 0;
if (GetRace() == DRAKKIN) {
if (GetRace() == Race::Drakkin) {
iHeritage = zone->random.Int(0, 6);
iTattoo = zone->random.Int(0, 7);
iDetails = zone->random.Int(0, 7);
@@ -5404,9 +5404,9 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
case Class::Paladin:
{
bool is_large_race = (
GetBaseRace() == OGRE ||
GetBaseRace() == TROLL ||
GetBaseRace() == BARBARIAN
GetBaseRace() == Race::Ogre ||
GetBaseRace() == Race::Troll ||
GetBaseRace() == Race::Barbarian
);
bool has_bash_skill = GetSkill(EQ::skills::SkillBash) > 0;
bool has_shield_in_secondary =