[Constants] Change Race Changes to Race Namespace

This commit is contained in:
Kinglykrab
2025-08-28 23:06:41 -04:00
parent a4e47d9180
commit ec121c77d7
23 changed files with 2127 additions and 2396 deletions
+1 -1
View File
@@ -1619,7 +1619,7 @@ bool Mob::CanUseAlternateAdvancementRank(AA::Rank *rank)
auto race = GetPlayerRaceValue(GetBaseRace());
race = race > PLAYER_RACE_COUNT ? Race::Human : race;
race = race > RaceIndex::Drakkin ? Race::Human : race;
if (!(a->races & (1 << (race - 1)))) {
return false;
+4 -4
View File
@@ -896,7 +896,7 @@ int Mob::GetClassRaceACBonus()
ac_bonus = 16;
}
if (GetRace() == IKSAR)
if (GetRace() == Race::Iksar)
ac_bonus += EQ::Clamp(static_cast<int>(level), 10, 35);
return ac_bonus;
@@ -3545,7 +3545,7 @@ int Mob::GetHandToHandDelay(void)
int iksar = 0;
if (IsClient() && CastToClient()->GetItemIDAt(12) == 10652 && GetLevel() > 46)
epic = 280;
else if (GetRace() == IKSAR)
else if (GetRace() == Race::Iksar)
iksar = 1;
// the delay bonus from the monk epic scales up to a skill of 280
if (epic >= skill)
@@ -3586,8 +3586,8 @@ int Mob::GetHandToHandDelay(void)
return 16;
int level = GetLevel();
if (level > 62)
return GetRace() == IKSAR ? 21 : 20;
return GetRace() == IKSAR ? mnk_iks_delay[level] : mnk_hum_delay[level];
return GetRace() == Race::Iksar ? 21 : 20;
return GetRace() == Race::Iksar ? mnk_iks_delay[level] : mnk_hum_delay[level];
}
else if (GetClass() == Class::Beastlord) {
int level = GetLevel();
+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 =
+17 -17
View File
@@ -46,9 +46,9 @@ void bot_command_beard_color(Client *c, const Seperator *sep)
uint8 uvalue = Strings::ToInt(sep->arg[1]);
auto fail_type = AFT_None;
if (my_bot->GetGender() != Gender::Male && my_bot->GetRace() != DWARF)
if (my_bot->GetGender() != Gender::Male && my_bot->GetRace() != Race::Dwarf)
fail_type = AFT_GenderRace;
else if (!PlayerAppearance::IsValidBeardColor(my_bot->GetRace(), my_bot->GetGender(), uvalue))
else if (!RaceAppearance::IsValidBeardColor(my_bot->GetRace(), my_bot->GetGender(), uvalue))
fail_type = AFT_Value;
else
my_bot->SetBeardColor(uvalue);
@@ -83,9 +83,9 @@ void bot_command_beard_style(Client *c, const Seperator *sep)
uint8 uvalue = Strings::ToInt(sep->arg[1]);
auto fail_type = AFT_None;
if (my_bot->GetGender() != Gender::Male && my_bot->GetRace() != DWARF)
if (my_bot->GetGender() != Gender::Male && my_bot->GetRace() != Race::Dwarf)
fail_type = AFT_GenderRace;
else if (!PlayerAppearance::IsValidBeard(my_bot->GetRace(), my_bot->GetGender(), uvalue))
else if (!RaceAppearance::IsValidBeard(my_bot->GetRace(), my_bot->GetGender(), uvalue))
fail_type = AFT_Value;
else
my_bot->SetBeard(uvalue);
@@ -122,9 +122,9 @@ void bot_command_details(Client *c, const Seperator *sep)
uint32 uvalue = Strings::ToInt(sep->arg[1]);
auto fail_type = AFT_None;
if (my_bot->GetRace() != DRAKKIN)
if (my_bot->GetRace() != Race::Drakkin)
fail_type = AFT_Race;
else if (!PlayerAppearance::IsValidDetail(my_bot->GetRace(), my_bot->GetGender(), uvalue))
else if (!RaceAppearance::IsValidDetail(my_bot->GetRace(), my_bot->GetGender(), uvalue))
fail_type = AFT_Value;
else
my_bot->SetDrakkinDetails(uvalue);
@@ -281,7 +281,7 @@ void bot_command_eyes(Client *c, const Seperator *sep)
// eye_bias = 2;
auto fail_type = AFT_None;
if (!PlayerAppearance::IsValidEyeColor(my_bot->GetRace(), my_bot->GetGender(), uvalue)) {
if (!RaceAppearance::IsValidEyeColor(my_bot->GetRace(), my_bot->GetGender(), uvalue)) {
fail_type = AFT_Value;
}
else {
@@ -328,12 +328,12 @@ void bot_command_face(Client *c, const Seperator *sep)
uint8 uvalue = Strings::ToInt(sep->arg[1]);
auto fail_type = AFT_None;
if (!PlayerAppearance::IsValidFace(my_bot->GetRace(), my_bot->GetGender(), uvalue)) {
if (!RaceAppearance::IsValidFace(my_bot->GetRace(), my_bot->GetGender(), uvalue)) {
fail_type = AFT_Value;
}
else {
uint8 old_woad = 0;
if (my_bot->GetRace() == BARBARIAN)
if (my_bot->GetRace() == Race::Barbarian)
old_woad = ((my_bot->GetLuclinFace() / 10) * 10);
my_bot->SetLuclinFace((old_woad + uvalue));
}
@@ -368,7 +368,7 @@ void bot_command_hair_color(Client *c, const Seperator *sep)
uint8 uvalue = Strings::ToInt(sep->arg[1]);
auto fail_type = AFT_None;
if (!PlayerAppearance::IsValidHairColor(my_bot->GetRace(), my_bot->GetGender(), uvalue))
if (!RaceAppearance::IsValidHairColor(my_bot->GetRace(), my_bot->GetGender(), uvalue))
fail_type = AFT_Value;
else
my_bot->SetHairColor(uvalue);
@@ -403,7 +403,7 @@ void bot_command_hairstyle(Client *c, const Seperator *sep)
uint8 uvalue = Strings::ToInt(sep->arg[1]);
auto fail_type = AFT_None;
if (!PlayerAppearance::IsValidHair(my_bot->GetRace(), my_bot->GetGender(), uvalue))
if (!RaceAppearance::IsValidHair(my_bot->GetRace(), my_bot->GetGender(), uvalue))
fail_type = AFT_Value;
else
my_bot->SetHairStyle(uvalue);
@@ -440,9 +440,9 @@ void bot_command_heritage(Client *c, const Seperator *sep)
uint32 uvalue = Strings::ToInt(sep->arg[1]);
auto fail_type = AFT_None;
if (my_bot->GetRace() != DRAKKIN)
if (my_bot->GetRace() != Race::Drakkin)
fail_type = AFT_Race;
else if (!PlayerAppearance::IsValidHeritage(my_bot->GetRace(), my_bot->GetGender(), uvalue))
else if (!RaceAppearance::IsValidHeritage(my_bot->GetRace(), my_bot->GetGender(), uvalue))
fail_type = AFT_Value;
else
my_bot->SetDrakkinHeritage(uvalue);
@@ -479,9 +479,9 @@ void bot_command_tattoo(Client *c, const Seperator *sep)
uint32 uvalue = Strings::ToInt(sep->arg[1]);
auto fail_type = AFT_None;
if (my_bot->GetRace() != DRAKKIN)
if (my_bot->GetRace() != Race::Drakkin)
fail_type = AFT_Race;
else if (!PlayerAppearance::IsValidTattoo(my_bot->GetRace(), my_bot->GetGender(), uvalue))
else if (!RaceAppearance::IsValidTattoo(my_bot->GetRace(), my_bot->GetGender(), uvalue))
fail_type = AFT_Value;
else
my_bot->SetDrakkinTattoo(uvalue);
@@ -516,10 +516,10 @@ void bot_command_woad(Client *c, const Seperator *sep)
uint8 uvalue = Strings::ToInt(sep->arg[1]);
auto fail_type = AFT_None;
if (my_bot->GetRace() != BARBARIAN) {
if (my_bot->GetRace() != Race::Barbarian) {
fail_type = AFT_Race;
}
else if (!PlayerAppearance::IsValidWoad(my_bot->GetRace(), my_bot->GetGender(), uvalue)) {
else if (!RaceAppearance::IsValidWoad(my_bot->GetRace(), my_bot->GetGender(), uvalue)) {
fail_type = AFT_Value;
}
else {
+26 -26
View File
@@ -455,13 +455,13 @@ void bot_command_follow_distance(Client *c, const Seperator *sep)
fmt::format("- You must use a value between 1 and {}.", RuleI(Bots, MaxFollowDistance))
};
p.example_format = { fmt::format("{} [reset]/[set [value]] [actionable]", sep->arg[0]) };
p.examples_one = {
"To set all bots to follow at a distance of 25:",
fmt::format("{} set 25 spawned", sep->arg[0])
p.examples_one = {
"To set all bots to follow at a distance of 25:",
fmt::format("{} set 25 spawned", sep->arg[0])
};
p.examples_two = {
"To check the curret following distance of all bots:",
fmt::format("{} current spawned", sep->arg[0])
p.examples_two = {
"To check the curret following distance of all bots:",
fmt::format("{} current spawned", sep->arg[0])
};
p.examples_three =
{
@@ -470,10 +470,10 @@ void bot_command_follow_distance(Client *c, const Seperator *sep)
"{} reset byclass {}",
sep->arg[0],
Class::Wizard
)
)
};
p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" };
std::string popup_text = c->SendBotCommandHelpWindow(p);
popup_text = DialogueWindow::Table(popup_text);
@@ -483,7 +483,7 @@ void bot_command_follow_distance(Client *c, const Seperator *sep)
}
const int ab_mask = ActionableBots::ABM_Type2;
uint32 bfd = RuleI(Bots, DefaultFollowDistance);
bool set_flag = false;
bool current_check = false;
@@ -862,7 +862,7 @@ void bot_command_report(Client *c, const Seperator *sep)
c->Message(Chat::White, "usage: %s ([actionable: target | byname | ownergroup | ownerraid | targetgroup | namesgroup | healrotationmembers | healrotationtargets | mmr | byclass | byrace | spawned] ([actionable_name]))", sep->arg[0]);
return;
}
const int ab_mask = ActionableBots::ABM_Type1;
std::string arg1 = sep->arg[1];
@@ -1057,7 +1057,7 @@ void bot_command_stance(Client *c, const Seperator *sep)
BotCommandHelpParams p;
p.description = { "Change a bot's stance to control the way it behaves." };
p.notes =
p.notes =
{
"- Changing a stance will reset all settings to match that stance type.",
"- Any changes made will only save to that stance for future use.",
@@ -1122,29 +1122,29 @@ void bot_command_stance(Client *c, const Seperator *sep)
Stance::AEBurn
)
};
p.example_format =
p.example_format =
{ fmt::format( "{} [current | value]", sep->arg[0]) };
p.examples_one =
{
"To set all bots to BurnAE:",
p.examples_one =
{
"To set all bots to BurnAE:",
fmt::format("{} {} spawned {}",
sep->arg[0],
Stance::Aggressive,
Class::ShadowKnight
)
};
p.examples_two =
{
"To set all Shadowknights to Aggressive:",
p.examples_two =
{
"To set all Shadowknights to Aggressive:",
fmt::format("{} {} byclass {}",
sep->arg[0],
Stance::Aggressive,
Class::ShadowKnight
)
};
p.examples_three = {
"To check the current stances of all bots:",
fmt::format("{} current spawned", sep->arg[0])
p.examples_three = {
"To check the current stances of all bots:",
fmt::format("{} current spawned", sep->arg[0])
};
p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" };
@@ -1239,7 +1239,7 @@ void bot_command_stance(Client *c, const Seperator *sep)
database.botdb.LoadBotSettings(bot_iter);
if (
(bot_iter->GetClass() == Class::Warrior || bot_iter->GetClass() == Class::Paladin || bot_iter->GetClass() == Class::ShadowKnight) &&
(bot_iter->GetClass() == Class::Warrior || bot_iter->GetClass() == Class::Paladin || bot_iter->GetClass() == Class::ShadowKnight) &&
(bot_iter->GetBotStance() == Stance::Aggressive)
) {
bot_iter->SetTaunting(true);
@@ -1255,7 +1255,7 @@ void bot_command_stance(Client *c, const Seperator *sep)
bot_iter->GetPet()->CastToNPC()->SetTaunting(false);
}
}
bot_iter->Save();
++success_count;
}
@@ -1431,7 +1431,7 @@ void bot_command_summon(Client *c, const Seperator *sep)
c->Message(Chat::White, "usage: %s ([actionable: target | byname | ownergroup | ownerraid | targetgroup | namesgroup | healrotationtargets | mmr | byclass | byrace | spawned] ([actionable_name]))", sep->arg[0]);
return;
}
const int ab_mask = ActionableBots::ABM_Type1;
std::string arg1 = sep->arg[1];
@@ -1550,7 +1550,7 @@ void bot_command_toggle_ranged(Client *c, const Seperator *sep)
return;
}
std::string arg1 = sep->arg[1];
int ab_arg = 1;
@@ -1712,7 +1712,7 @@ void bot_command_toggle_helm(Client *c, const Seperator *sep)
return;
}
std::string arg1 = sep->arg[1];
int ab_arg = 1;
+1 -1
View File
@@ -8445,7 +8445,7 @@ void Client::MerchantRejectMessage(Mob *merchant, int primaryfaction)
merchant->SayString(zone->random.Int(WONT_SELL_DEEDS1, WONT_SELL_DEEDS6));
} else if (lowestvalue == fmod.race_mod) { // race biggest
// Non-standard race (ex. illusioned to wolf)
if (GetRace() > PLAYER_RACE_COUNT) {
if (!IsPlayerRace(GetRace())) {
messageid = zone->random.Int(1, 3); // these aren't sequential StringIDs :(
switch (messageid) {
case 1:
+80 -80
View File
@@ -1011,52 +1011,52 @@ int32 Client::CalcMR()
{
//racial bases
switch (GetBaseRace()) {
case HUMAN:
case Race::Human:
MR = 25;
break;
case BARBARIAN:
case Race::Barbarian:
MR = 25;
break;
case ERUDITE:
case Race::Erudite:
MR = 30;
break;
case WOOD_ELF:
case Race::WoodElf:
MR = 25;
break;
case HIGH_ELF:
case Race::HighElf:
MR = 25;
break;
case DARK_ELF:
case Race::DarkElf:
MR = 25;
break;
case HALF_ELF:
case Race::HalfElf:
MR = 25;
break;
case DWARF:
case Race::Dwarf:
MR = 30;
break;
case TROLL:
case Race::Troll:
MR = 25;
break;
case OGRE:
case Race::Ogre:
MR = 25;
break;
case HALFLING:
case Race::Halfling:
MR = 25;
break;
case GNOME:
case Race::Gnome:
MR = 25;
break;
case IKSAR:
case Race::Iksar:
MR = 25;
break;
case VAHSHIR:
case Race::VahShir:
MR = 25;
break;
case FROGLOK:
case Race::Froglok2:
MR = 30;
break;
case DRAKKIN:
case Race::Drakkin:
{
MR = 25;
if (GetDrakkinHeritage() == 2)
@@ -1085,52 +1085,52 @@ int32 Client::CalcFR()
{
//racial bases
switch (GetBaseRace()) {
case HUMAN:
case Race::Human:
FR = 25;
break;
case BARBARIAN:
case Race::Barbarian:
FR = 25;
break;
case ERUDITE:
case Race::Erudite:
FR = 25;
break;
case WOOD_ELF:
case Race::WoodElf:
FR = 25;
break;
case HIGH_ELF:
case Race::HighElf:
FR = 25;
break;
case DARK_ELF:
case Race::DarkElf:
FR = 25;
break;
case HALF_ELF:
case Race::HalfElf:
FR = 25;
break;
case DWARF:
case Race::Dwarf:
FR = 25;
break;
case TROLL:
case Race::Troll:
FR = 5;
break;
case OGRE:
case Race::Ogre:
FR = 25;
break;
case HALFLING:
case Race::Halfling:
FR = 25;
break;
case GNOME:
case Race::Gnome:
FR = 25;
break;
case IKSAR:
case Race::Iksar:
FR = 30;
break;
case VAHSHIR:
case Race::VahShir:
FR = 25;
break;
case FROGLOK:
case Race::Froglok2:
FR = 25;
break;
case DRAKKIN:
case Race::Drakkin:
{
FR = 25;
if (GetDrakkinHeritage() == 0)
@@ -1171,52 +1171,52 @@ int32 Client::CalcDR()
{
//racial bases
switch (GetBaseRace()) {
case HUMAN:
case Race::Human:
DR = 15;
break;
case BARBARIAN:
case Race::Barbarian:
DR = 15;
break;
case ERUDITE:
case Race::Erudite:
DR = 10;
break;
case WOOD_ELF:
case Race::WoodElf:
DR = 15;
break;
case HIGH_ELF:
case Race::HighElf:
DR = 15;
break;
case DARK_ELF:
case Race::DarkElf:
DR = 15;
break;
case HALF_ELF:
case Race::HalfElf:
DR = 15;
break;
case DWARF:
case Race::Dwarf:
DR = 15;
break;
case TROLL:
case Race::Troll:
DR = 15;
break;
case OGRE:
case Race::Ogre:
DR = 15;
break;
case HALFLING:
case Race::Halfling:
DR = 20;
break;
case GNOME:
case Race::Gnome:
DR = 15;
break;
case IKSAR:
case Race::Iksar:
DR = 15;
break;
case VAHSHIR:
case Race::VahShir:
DR = 15;
break;
case FROGLOK:
case Race::Froglok2:
DR = 15;
break;
case DRAKKIN:
case Race::Drakkin:
{
DR = 15;
if (GetDrakkinHeritage() == 1)
@@ -1263,52 +1263,52 @@ int32 Client::CalcPR()
{
//racial bases
switch (GetBaseRace()) {
case HUMAN:
case Race::Human:
PR = 15;
break;
case BARBARIAN:
case Race::Barbarian:
PR = 15;
break;
case ERUDITE:
case Race::Erudite:
PR = 15;
break;
case WOOD_ELF:
case Race::WoodElf:
PR = 15;
break;
case HIGH_ELF:
case Race::HighElf:
PR = 15;
break;
case DARK_ELF:
case Race::DarkElf:
PR = 15;
break;
case HALF_ELF:
case Race::HalfElf:
PR = 15;
break;
case DWARF:
case Race::Dwarf:
PR = 20;
break;
case TROLL:
case Race::Troll:
PR = 15;
break;
case OGRE:
case Race::Ogre:
PR = 15;
break;
case HALFLING:
case Race::Halfling:
PR = 20;
break;
case GNOME:
case Race::Gnome:
PR = 15;
break;
case IKSAR:
case Race::Iksar:
PR = 15;
break;
case VAHSHIR:
case Race::VahShir:
PR = 15;
break;
case FROGLOK:
case Race::Froglok2:
PR = 30;
break;
case DRAKKIN:
case Race::Drakkin:
{
PR = 15;
if (GetDrakkinHeritage() == 3)
@@ -1355,52 +1355,52 @@ int32 Client::CalcCR()
{
//racial bases
switch (GetBaseRace()) {
case HUMAN:
case Race::Human:
CR = 25;
break;
case BARBARIAN:
case Race::Barbarian:
CR = 35;
break;
case ERUDITE:
case Race::Erudite:
CR = 25;
break;
case WOOD_ELF:
case Race::WoodElf:
CR = 25;
break;
case HIGH_ELF:
case Race::HighElf:
CR = 25;
break;
case DARK_ELF:
case Race::DarkElf:
CR = 25;
break;
case HALF_ELF:
case Race::HalfElf:
CR = 25;
break;
case DWARF:
case Race::Dwarf:
CR = 25;
break;
case TROLL:
case Race::Troll:
CR = 25;
break;
case OGRE:
case Race::Ogre:
CR = 25;
break;
case HALFLING:
case Race::Halfling:
CR = 25;
break;
case GNOME:
case Race::Gnome:
CR = 25;
break;
case IKSAR:
case Race::Iksar:
CR = 15;
break;
case VAHSHIR:
case Race::VahShir:
CR = 25;
break;
case FROGLOK:
case Race::Froglok2:
CR = 25;
break;
case DRAKKIN:
case Race::Drakkin:
{
CR = 25;
if (GetDrakkinHeritage() == 4)
+9 -9
View File
@@ -1515,23 +1515,23 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
switch (race)
{
case OGRE:
case Race::Ogre:
size = 9; break;
case TROLL:
case Race::Troll:
size = 8; break;
case VAHSHIR: case BARBARIAN:
case Race::VahShir: case Race::Barbarian:
size = 7; break;
case HUMAN: case HIGH_ELF: case ERUDITE: case IKSAR: case DRAKKIN:
case Race::Human: case Race::HighElf: case Race::Erudite: case Race::Iksar: case Race::Drakkin:
size = 6; break;
case HALF_ELF:
case Race::HalfElf:
size = 5.5; break;
case WOOD_ELF: case DARK_ELF: case FROGLOK:
case Race::WoodElf: case Race::DarkElf: case Race::Froglok2:
size = 5; break;
case DWARF:
case Race::Dwarf:
size = 4; break;
case HALFLING:
case Race::Halfling:
size = 3.5; break;
case GNOME:
case Race::Gnome:
size = 3; break;
default:
size = 0;
+1 -1
View File
@@ -1648,7 +1648,7 @@ void Client::OPGMTraining(const EQApplicationPacket *app)
//#pragma GCC push_options
//#pragma GCC optimize ("O0")
for (int sk = EQ::skills::Skill1HBlunt; sk <= EQ::skills::HIGHEST_SKILL; ++sk) {
if (sk == EQ::skills::SkillTinkering && GetRace() != GNOME) {
if (sk == EQ::skills::SkillTinkering && GetRace() != Race::Gnome) {
gmtrain->skills[sk] = 0; //Non gnomes can't tinker!
} else {
gmtrain->skills[sk] = GetMaxSkillAfterSpecializationRules((EQ::skills::SkillType)sk, MaxSkill((EQ::skills::SkillType)sk, GetClass(), RuleI(Character, MaxLevel)));
+2 -2
View File
@@ -1391,7 +1391,7 @@ void EntityList::SendZoneSpawnsBulk(Client *client)
bool is_delayed_packet = (
DistanceSquared(client_position, spawn_position) > distance_max ||
(spawn->IsClient() && (spawn->GetRace() == MINOR_ILL_OBJ || spawn->GetRace() == TREE))
(spawn->IsClient() && (spawn->GetRace() == Race::MinorIllusion || spawn->GetRace() == Race::Tree))
);
if (is_delayed_packet) {
@@ -1415,7 +1415,7 @@ void EntityList::SendZoneSpawnsBulk(Client *client)
*
* Illusion races on PCs don't work as a mass spawn
* But they will work as an add_spawn AFTER CLIENT_CONNECTED.
* if (spawn->IsClient() && (race == MINOR_ILL_OBJ || race == TREE)) {
* if (spawn->IsClient() && (race == Race::MinorIllusion || race == Race::Tree)) {
* app = new EQApplicationPacket;
* spawn->CreateSpawnPacket(app);
* client->QueuePacket(app, true, Client::CLIENT_CONNECTED);
+7 -7
View File
@@ -130,7 +130,7 @@ uint64 Client::CalcEXP(uint8 consider_level, bool ignore_modifiers) {
if (
GetClass() == Class::Warrior ||
GetClass() == Class::Rogue ||
GetBaseRace() == HALFLING
GetBaseRace() == Race::Halfling
) {
total_modifier *= 1.05;
}
@@ -291,7 +291,7 @@ void Client::CalculateStandardAAExp(uint64 &add_aaxp, uint8 conlevel, bool resex
// Shouldn't race not affect AA XP?
if (RuleB(Character, UseRaceClassExpBonuses))
{
if (GetBaseRace() == HALFLING) {
if (GetBaseRace() == Race::Halfling) {
aatotalmod *= 1.05;
}
@@ -439,7 +439,7 @@ void Client::CalculateExp(uint64 in_add_exp, uint64 &add_exp, uint64 &add_aaxp,
if (RuleB(Character, UseRaceClassExpBonuses))
{
if (GetBaseRace() == HALFLING) {
if (GetBaseRace() == Race::Halfling) {
totalmod *= 1.05;
}
@@ -1057,13 +1057,13 @@ uint32 Client::GetEXPForLevel(uint16 check_level)
if(RuleB(Character,UseOldRaceExpPenalties))
{
float racemod = 1.0;
if(GetBaseRace() == TROLL || GetBaseRace() == IKSAR) {
if(GetBaseRace() == Race::Troll || GetBaseRace() == Race::Iksar) {
racemod = 1.2;
} else if(GetBaseRace() == OGRE) {
} else if(GetBaseRace() == Race::Ogre) {
racemod = 1.15;
} else if(GetBaseRace() == BARBARIAN) {
} else if(GetBaseRace() == Race::Barbarian) {
racemod = 1.05;
} else if(GetBaseRace() == HALFLING) {
} else if(GetBaseRace() == Race::Halfling) {
racemod = 0.95;
}
+3 -3
View File
@@ -83,7 +83,7 @@ void command_feature(Client *c, const Seperator *sep)
feature_changed = "Beard Color";
value_changed = f.beardcolor;
} else if (is_details) {
if (t->GetRace() != DRAKKIN) {
if (t->GetRace() != Race::Drakkin) {
c->Message(Chat::White, "You must target a Drakkin to use this command.");
return;
}
@@ -116,7 +116,7 @@ void command_feature(Client *c, const Seperator *sep)
feature_changed = "Helmet Texture";
value_changed = helm_texture;
} else if (is_heritage) {
if (t->GetRace() != DRAKKIN) {
if (t->GetRace() != Race::Drakkin) {
c->Message(Chat::White, "You must target a Drakkin to use this command.");
return;
}
@@ -148,7 +148,7 @@ void command_feature(Client *c, const Seperator *sep)
feature_changed = "Size";
value_changed = size;
} else if (is_tattoo) {
if (t->GetRace() != DRAKKIN) {
if (t->GetRace() != Race::Drakkin) {
c->Message(Chat::White, "You must target a Drakkin to use this command.");
return;
}
+1 -1
View File
@@ -8,7 +8,7 @@ void command_randomfeatures(Client *c, const Seperator *sep)
}
auto target = c->GetTarget();
if (target->RandomizeFeatures()) {
c->Message(
Chat::White,
+19 -19
View File
@@ -3819,7 +3819,7 @@ bool Mob::RandomizeFeatures(bool send_illusion, bool set_variables)
// Adjust all settings based on the min and max for each feature of each race and gender
switch (GetRace()) {
case HUMAN:
case Race::Human:
new_hair_color = zone->random.Int(0, 19);
if (current_gender == Gender::Male) {
@@ -3831,7 +3831,7 @@ bool Mob::RandomizeFeatures(bool send_illusion, bool set_variables)
}
break;
case BARBARIAN:
case Race::Barbarian:
new_hair_color = zone->random.Int(0, 19);
new_luclin_face = zone->random.Int(0, 87);
@@ -3844,7 +3844,7 @@ bool Mob::RandomizeFeatures(bool send_illusion, bool set_variables)
}
break;
case ERUDITE:
case Race::Erudite:
if (current_gender == Gender::Male) {
new_beard_color = zone->random.Int(0, 19);
new_beard = zone->random.Int(0, 5);
@@ -3854,7 +3854,7 @@ bool Mob::RandomizeFeatures(bool send_illusion, bool set_variables)
}
break;
case WOOD_ELF:
case Race::WoodElf:
new_hair_color = zone->random.Int(0, 19);
if (current_gender == Gender::Male) {
@@ -3864,7 +3864,7 @@ bool Mob::RandomizeFeatures(bool send_illusion, bool set_variables)
}
break;
case HIGH_ELF:
case Race::HighElf:
new_hair_color = zone->random.Int(0, 14);
if (current_gender == Gender::Male) {
@@ -3876,7 +3876,7 @@ bool Mob::RandomizeFeatures(bool send_illusion, bool set_variables)
}
break;
case DARK_ELF:
case Race::DarkElf:
new_hair_color = zone->random.Int(13, 18);
if (current_gender == Gender::Male) {
@@ -3888,7 +3888,7 @@ bool Mob::RandomizeFeatures(bool send_illusion, bool set_variables)
}
break;
case HALF_ELF:
case Race::HalfElf:
new_hair_color = zone->random.Int(0, 19);
if (current_gender == Gender::Male) {
@@ -3900,7 +3900,7 @@ bool Mob::RandomizeFeatures(bool send_illusion, bool set_variables)
}
break;
case DWARF:
case Race::Dwarf:
new_hair_color = zone->random.Int(0, 19);
new_beard_color = new_hair_color;
@@ -3913,7 +3913,7 @@ bool Mob::RandomizeFeatures(bool send_illusion, bool set_variables)
}
break;
case TROLL:
case Race::Troll:
new_eye_color_one = zone->random.Int(0, 10);
new_eye_color_two = zone->random.Int(0, 10);
@@ -3923,14 +3923,14 @@ bool Mob::RandomizeFeatures(bool send_illusion, bool set_variables)
}
break;
case OGRE:
case Race::Ogre:
if (current_gender == Gender::Female) {
new_hair_style = zone->random.Int(0, 3);
new_hair_color = zone->random.Int(0, 23);
}
break;
case HALFLING:
case Race::Halfling:
new_hair_color = zone->random.Int(0, 19);
if (current_gender == Gender::Male) {
@@ -3942,7 +3942,7 @@ bool Mob::RandomizeFeatures(bool send_illusion, bool set_variables)
}
break;
case GNOME:
case Race::Gnome:
new_hair_color = zone->random.Int(0, 24);
if (current_gender == Gender::Male) {
@@ -3954,14 +3954,14 @@ bool Mob::RandomizeFeatures(bool send_illusion, bool set_variables)
}
break;
case IKSAR:
case VAHSHIR:
case Race::Iksar:
case Race::VahShir:
new_luclin_face = zone->random.Int(0, 7);
break;
case FROGLOK:
case Race::Froglok2:
new_luclin_face = zone->random.Int(0, 9);
break;
case DRAKKIN:
case Race::Drakkin:
new_hair_color = zone->random.Int(0, 3);
new_beard_color = new_hair_color;
new_eye_color_one = zone->random.Int(0, 11);
@@ -4023,8 +4023,8 @@ bool Mob::RandomizeFeatures(bool send_illusion, bool set_variables)
uint16 Mob::GetFactionRace() {
uint16 current_race = GetRace();
if (IsPlayerRace(current_race) || current_race == TREE ||
current_race == MINOR_ILL_OBJ) {
if (IsPlayerRace(current_race) || current_race == Race::Tree ||
current_race == Race::MinorIllusion) {
return current_race;
}
else {
@@ -7704,7 +7704,7 @@ bool Mob::CanRaceEquipItem(uint32 item_id)
}
auto item_races = itm->Races;
if(item_races == PLAYER_RACE_ALL_MASK) {
if(item_races == RaceBitmask::All) {
return true;
}
+3 -3
View File
@@ -2901,7 +2901,7 @@ void NPC::DoNPCEmote(uint8 event_, uint32 emote_id, Mob* t)
// Mob Variables
Strings::FindReplace(processed, "$mname", GetCleanName());
Strings::FindReplace(processed, "$mracep", GetRacePlural());
Strings::FindReplace(processed, "$mrace", GetPlayerRaceName(GetRace()));
Strings::FindReplace(processed, "$mrace", GetRaceIDName(GetRace()));
Strings::FindReplace(processed, "$mclass", GetClassIDName(GetClass()));
Strings::FindReplace(processed, "$mclassp", GetClassPlural());
@@ -2909,7 +2909,7 @@ void NPC::DoNPCEmote(uint8 event_, uint32 emote_id, Mob* t)
Strings::FindReplace(processed, "$name", t ? t->GetCleanName() : "foe");
Strings::FindReplace(processed, "$class", t ? GetClassIDName(t->GetClass()) : "class");
Strings::FindReplace(processed, "$classp", t ? t->GetClassPlural() : "classes");
Strings::FindReplace(processed, "$race", t ? GetPlayerRaceName(t->GetRace()) : "race");
Strings::FindReplace(processed, "$race", t ? GetRaceIDName(t->GetRace()) : "race");
Strings::FindReplace(processed, "$racep", t ? t->GetRacePlural() : "races");
if (emoteid == e->emoteid) {
@@ -3792,7 +3792,7 @@ bool NPC::IsGuard()
case Race::HalasCitizen:
case Race::NeriakCitizen:
case Race::GrobbCitizen:
case OGGOK_CITIZEN:
case Race::OggokCitizen:
case Race::KaladimCitizen:
return true;
default:
+3 -3
View File
@@ -352,9 +352,9 @@ void Client::OPCombatAbility(const CombatAbility_Struct *ca_atk)
if (ca_atk->m_skill == EQ::skills::SkillBash) { // SLAM - Bash without a shield equipped
switch (GetRace()) {
case OGRE:
case TROLL:
case BARBARIAN:
case Race::Ogre:
case Race::Troll:
case Race::Barbarian:
bypass_skill_check = true;
default:
break;
+2 -2
View File
@@ -466,7 +466,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
}
}
else if (spec.tradeskill == EQ::skills::SkillTinkering) {
if (user_pp.race != GNOME) {
if (user_pp.race != Race::Gnome) {
user->Message(Chat::Red, "Only gnomes can tinker.");
auto outapp = new EQApplicationPacket(OP_TradeSkillCombine, 0);
user->QueuePacket(outapp);
@@ -643,7 +643,7 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac
}
}
else if (spec.tradeskill == EQ::skills::SkillTinkering) {
if (user->GetRace() != GNOME) {
if (user->GetRace() != Race::Gnome) {
user->Message(Chat::Red, "Only gnomes can tinker.");
auto outapp = new EQApplicationPacket(OP_TradeSkillCombine, 0);
user->QueuePacket(outapp);
+1 -1
View File
@@ -4276,7 +4276,7 @@ bool WorldServer::SendVoiceMacro(Client* From, uint32 Type, char* Target, uint32
uint16 player_race = GetPlayerRaceValue(From->GetRace());
if (player_race == PLAYER_RACE_UNKNOWN) {
if (player_race == Race::Doug) {
player_race = From->GetBaseRace();
}