[Code Cleanup] Race constants refactor (#3782)

* [Code Cleanup] Race constants refactor

* Update races.h
This commit is contained in:
Chris Miles
2023-12-22 21:34:55 -06:00
committed by GitHub
parent 556af8c5e9
commit 4fa9e1d66f
28 changed files with 2084 additions and 2491 deletions
+4 -4
View File
@@ -983,14 +983,14 @@ bool Mob::CombatRange(Mob* other, float fixed_size_mod, bool aeRampage, ExtraAtt
float size_mod = GetSize();
float other_size_mod = other->GetSize();
if (GetRace() == RACE_LAVA_DRAGON_49 || GetRace() == RACE_WURM_158 || GetRace() == RACE_GHOST_DRAGON_196) { //For races with a fixed size
if (GetRace() == Race::LavaDragon || GetRace() == Race::Wurm || GetRace() == Race::GhostDragon) { //For races with a fixed size
size_mod = 60.0f;
}
else if (size_mod < 6.0) {
size_mod = 8.0f;
}
if (other->GetRace() == RACE_LAVA_DRAGON_49 || other->GetRace() == RACE_WURM_158 || other->GetRace() == RACE_GHOST_DRAGON_196) { //For races with a fixed size
if (other->GetRace() == Race::LavaDragon || other->GetRace() == Race::Wurm || other->GetRace() == Race::GhostDragon) { //For races with a fixed size
other_size_mod = 60.0f;
}
else if (other_size_mod < 6.0) {
@@ -1011,11 +1011,11 @@ bool Mob::CombatRange(Mob* other, float fixed_size_mod, bool aeRampage, ExtraAtt
size_mod *= size_mod * 4;
}
if (other->GetRace() == RACE_VELIOUS_DRAGON_184) // Lord Vyemm and other velious dragons
if (other->GetRace() == Race::VeliousDragon) // Lord Vyemm and other velious dragons
{
size_mod *= 1.75;
}
if (other->GetRace() == RACE_DRAGON_SKELETON_122) // Dracoliche in Fear. Skeletal Dragon
if (other->GetRace() == Race::DragonSkeleton) // Dracoliche in Fear. Skeletal Dragon
{
size_mod *= 2.25;
}
+2 -2
View File
@@ -4087,7 +4087,7 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
IsPlayerRace(GetBaseRace()) &&
RuleI(Combat, FrontalStunImmunityRaces) & GetPlayerRaceBit(GetBaseRace())
) ||
GetBaseRace() == RACE_OGGOK_CITIZEN_93
GetBaseRace() == Race::OggokCitizen
) {
is_immune_to_frontal_stun = true;
}
@@ -4107,7 +4107,7 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
IsPlayerRace(GetBaseRace()) &&
RuleI(Combat, FrontalStunImmunityRaces) & GetPlayerRaceBit(GetBaseRace())
) ||
GetBaseRace() == RACE_OGGOK_CITIZEN_93
GetBaseRace() == Race::OggokCitizen
)
) {
is_immune_to_frontal_stun = true;
+2 -2
View File
@@ -2681,7 +2681,7 @@ void Bot::CalcMeleeDistances(const Mob* tar, const EQ::ItemInstance* const& p_it
float other_size_mod = tar->GetSize();
// For races with a fixed size
if (GetRace() == RT_DRAGON || GetRace() == RT_WURM || GetRace() == RT_DRAGON_7) {
if (GetRace() == Race::LavaDragon || GetRace() == Race::Wurm || GetRace() == Race::GhostDragon) {
// size_mod = 60.0f;
}
@@ -2690,7 +2690,7 @@ void Bot::CalcMeleeDistances(const Mob* tar, const EQ::ItemInstance* const& p_it
}
// For races with a fixed size
if (tar->GetRace() == RT_DRAGON || tar->GetRace() == RT_WURM || tar->GetRace() == RT_DRAGON_7) {
if (tar->GetRace() == Race::LavaDragon || tar->GetRace() == Race::Wurm || tar->GetRace() == Race::GhostDragon) {
other_size_mod = 60.0f;
}
+10 -10
View File
@@ -5913,11 +5913,11 @@ void bot_command_view_combos(Client *c, const Seperator *sep)
};
const uint16 race_values[17] = {
RACE_DOUG_0,
RACE_HUMAN_1, RACE_BARBARIAN_2, RACE_ERUDITE_3, RACE_WOOD_ELF_4,
RACE_HIGH_ELF_5, RACE_DARK_ELF_6, RACE_HALF_ELF_7, RACE_DWARF_8,
RACE_TROLL_9, RACE_OGRE_10, RACE_HALFLING_11, RACE_GNOME_12,
RACE_IKSAR_128, RACE_VAH_SHIR_130, RACE_FROGLOK_330, RACE_DRAKKIN_522
Race::Doug,
Race::Human, Race::Barbarian, Race::Erudite, Race::WoodElf,
Race::HighElf, Race::DarkElf, Race::HalfElf, Race::Dwarf,
Race::Troll, Race::Ogre, Race::Halfling, Race::Gnome,
Race::Iksar, Race::VahShir, Race::Froglok2, Race::Drakkin
};
if (helper_command_alias_fail(c, "bot_command_view_combos", sep->arg[0], "viewcombos")) {
@@ -6028,11 +6028,11 @@ void bot_subcommand_bot_create(Client *c, const Seperator *sep)
};
const uint16 race_values[17] = {
RACE_DOUG_0,
RACE_HUMAN_1, RACE_BARBARIAN_2, RACE_ERUDITE_3, RACE_WOOD_ELF_4,
RACE_HIGH_ELF_5, RACE_DARK_ELF_6, RACE_HALF_ELF_7, RACE_DWARF_8,
RACE_TROLL_9, RACE_OGRE_10, RACE_HALFLING_11, RACE_GNOME_12,
RACE_IKSAR_128, RACE_VAH_SHIR_130, RACE_FROGLOK_330, RACE_DRAKKIN_522
Race::Doug,
Race::Human, Race::Barbarian, Race::Erudite, Race::WoodElf,
Race::HighElf, Race::DarkElf, Race::HalfElf, Race::Dwarf,
Race::Troll, Race::Ogre, Race::Halfling, Race::Gnome,
Race::Iksar, Race::VahShir, Race::Froglok2, Race::Drakkin
};
const std::string gender_substrs[2] = {
+42 -42
View File
@@ -8632,8 +8632,8 @@ void Client::InitInnates()
m_pp.InnateSkills[InnateInspect] = InnateEnabled;
m_pp.InnateSkills[InnateOpen] = InnateEnabled;
if (race >= RT_FROGLOK_3) {
if (race == RT_SKELETON_2 || race == RT_FROGLOK_3) {
if (race >= Race::Froglok2) {
if (race == Race::Skeleton2 || race == Race::Froglok2) {
m_pp.InnateSkills[InnateUltraVision] = InnateEnabled;
} else {
m_pp.InnateSkills[InnateInfravision] = InnateEnabled;
@@ -8641,75 +8641,75 @@ void Client::InitInnates()
}
switch (race) {
case RT_BARBARIAN:
case RT_BARBARIAN_2:
case Race::Barbarian:
case Race::HalasCitizen:
m_pp.InnateSkills[InnateSlam] = InnateEnabled;
break;
case RT_ERUDITE:
case RT_ERUDITE_2:
case Race::Erudite:
case Race::EruditeCitizen:
m_pp.InnateSkills[InnateLore] = InnateEnabled;
break;
case RT_WOOD_ELF:
case RT_GUARD_3:
case Race::WoodElf:
case Race::Fayguard:
m_pp.InnateSkills[InnateInfravision] = InnateEnabled;
break;
case RT_GNOME:
case RT_HIGH_ELF:
case RT_GUARD_2:
case Race::Gnome:
case Race::HighElf:
case Race::Felguard:
m_pp.InnateSkills[InnateInfravision] = InnateEnabled;
m_pp.InnateSkills[InnateLore] = InnateEnabled;
break;
case RT_TROLL:
case RT_TROLL_2:
case Race::Troll:
case Race::GrobbCitizen:
m_pp.InnateSkills[InnateRegen] = InnateEnabled;
m_pp.InnateSkills[InnateSlam] = InnateEnabled;
m_pp.InnateSkills[InnateInfravision] = InnateEnabled;
break;
case RT_DWARF:
case RT_DWARF_2:
case Race::Dwarf:
case Race::KaladimCitizen:
m_pp.InnateSkills[InnateInfravision] = InnateEnabled;
break;
case RT_OGRE:
case RT_OGRE_2:
case Race::Ogre:
case Race::OggokCitizen:
m_pp.InnateSkills[InnateInfravision] = InnateEnabled;
m_pp.InnateSkills[InnateSlam] = InnateEnabled;
m_pp.InnateSkills[InnateNoBash] = InnateEnabled;
m_pp.InnateSkills[InnateBashDoor] = InnateEnabled;
break;
case RT_HALFLING:
case RT_HALFLING_2:
case Race::Halfling:
case Race::RivervaleCitizen:
m_pp.InnateSkills[InnateInfravision] = InnateEnabled;
break;
case RT_IKSAR:
case Race::Iksar:
m_pp.InnateSkills[InnateRegen] = InnateEnabled;
m_pp.InnateSkills[InnateInfravision] = InnateEnabled;
break;
case RT_VAH_SHIR:
case Race::VahShir:
m_pp.InnateSkills[InnateInfravision] = InnateEnabled;
break;
case RT_DARK_ELF:
case RT_DARK_ELF_2:
case RT_VAMPIRE_2:
case RT_FROGLOK_2:
case RT_GHOST:
case RT_GHOUL:
case RT_SKELETON:
case RT_VAMPIRE:
case RT_WILL_O_WISP:
case RT_ZOMBIE:
case RT_SPECTRE:
case RT_GHOST_2:
case RT_GHOST_3:
case RT_DRAGON_2:
case RT_INNORUUK:
case Race::DarkElf:
case Race::NeriakCitizen:
case Race::ElfVampire:
case Race::FroglokGhoul:
case Race::Ghost:
case Race::Ghoul:
case Race::Skeleton:
case Race::Vampire:
case Race::Wisp:
case Race::Zombie:
case Race::Spectre:
case Race::DwarfGhost:
case Race::EruditeGhost:
case Race::DragonSkeleton:
case Race::Innoruuk:
m_pp.InnateSkills[InnateUltraVision] = InnateEnabled;
break;
case RT_HUMAN:
case RT_GUARD:
case RT_BEGGAR:
case RT_HUMAN_2:
case RT_HUMAN_3:
case RT_FROGLOK_3: // client does froglok weird, but this should work out fine
case Race::Human:
case Race::FreeportGuard:
case Race::HumanBeggar:
case Race::HighpassCitizen:
case Race::QeynosCitizen:
case Race::Froglok2: // client does froglok weird, but this should work out fine
break;
default:
m_pp.InnateSkills[InnateInfravision] = InnateEnabled;
+2 -2
View File
@@ -4920,7 +4920,7 @@ void EntityList::ZoneWho(Client *c, Who_All_Struct *Who)
FormatMSGID = 5023; // 5023 %T1[ANONYMOUS] %2 %3 %4
uint32 PlayerClass = Class::None;
uint32 PlayerLevel = 0;
uint32 PlayerRace = RACE_DOUG_0;
uint32 PlayerRace = Race::Doug;
uint32 ZoneMSGID = 0xFFFFFFFF;
if (ClientEntry->GetAnon()==0) {
@@ -5750,7 +5750,7 @@ void EntityList::DespawnGridNodes(int32 grid_id) {
Mob *mob = m.second;
if (
mob->IsNPC() &&
mob->GetRace() == RACE_NODE_2254 &&
mob->GetRace() == Race::Node &&
mob->EntityVariableExists("grid_id") &&
Strings::ToInt(mob->GetEntityVariable("grid_id")) == grid_id)
{
+2 -2
View File
@@ -5,7 +5,7 @@ void FindRace(Client *c, const Seperator *sep)
if (sep->IsNumber(2)) {
const auto race_id = static_cast<uint16>(Strings::ToUnsignedInt(sep->arg[2]));
const std::string& race_name = GetRaceIDName(race_id);
if (EQ::ValueWithin(race_id, RACE_HUMAN_1, RACE_PEGASUS_732)) {
if (EQ::ValueWithin(race_id, Race::Human, Race::Pegasus3)) {
c->Message(
Chat::White,
fmt::format(
@@ -41,7 +41,7 @@ void FindRace(Client *c, const Seperator *sep)
auto found_count = 0;
for (uint16 race_id = RACE_HUMAN_1; race_id <= RACE_PEGASUS_732; race_id++) {
for (uint16 race_id = Race::Human; race_id <= Race::Pegasus3; race_id++) {
std::string race_name = GetRaceIDName(race_id);
auto race_name_lower = Strings::ToLower(race_name);
if (!Strings::Contains(race_name_lower, search_criteria)) {
+1 -1
View File
@@ -23,7 +23,7 @@ void SetRace(Client *c, const Seperator *sep)
const uint16 race_id = Strings::ToUnsignedInt(sep->arg[2]);
if (
!EQ::ValueWithin(race_id, RACE_DOUG_0, RuleI(NPC, MaxRaceID)) &&
!EQ::ValueWithin(race_id, Race::Doug, RuleI(NPC, MaxRaceID)) &&
!EQ::ValueWithin(race_id, 2253, 2259)
) {
c->Message(
+1 -1
View File
@@ -4,7 +4,7 @@ void ShowZonePoints(Client *c, const Seperator *sep)
{
for (const auto& m : entity_list.GetMobList()) {
Mob* mob = m.second;
if (mob->IsNPC() && mob->GetRace() == RACE_NODE_2254) {
if (mob->IsNPC() && mob->GetRace() == Race::Node) {
mob->Depop();
}
}
+2 -2
View File
@@ -3933,14 +3933,14 @@ float Merc::GetMaxMeleeRangeToTarget(Mob* target) {
float size_mod = GetSize();
float other_size_mod = target->GetSize();
if (GetRace() == RACE_LAVA_DRAGON_49 || GetRace() == RACE_WURM_158 || GetRace() == RACE_GHOST_DRAGON_196) //For races with a fixed size
if (GetRace() == Race::LavaDragon || GetRace() == Race::Wurm || GetRace() == Race::GhostDragon) //For races with a fixed size
{
size_mod = 60.0f;
} else if (size_mod < 6.0) {
size_mod = 8.0f;
}
if (target->GetRace() == RACE_LAVA_DRAGON_49 || target->GetRace() == RACE_WURM_158 || target->GetRace() == RACE_GHOST_DRAGON_196) //For races with a fixed size
if (target->GetRace() == Race::LavaDragon || target->GetRace() == Race::Wurm || target->GetRace() == Race::GhostDragon) //For races with a fixed size
{
other_size_mod = 60.0f;
} else if (other_size_mod < 6.0) {
+95 -95
View File
@@ -2867,7 +2867,7 @@ void Mob::ShowStats(Client* c)
);
// Drakkin Features
if (t->GetRace() == RACE_DRAKKIN_522) {
if (t->GetRace() == Race::Drakkin) {
c->Message(
Chat::White,
fmt::format(
@@ -3526,7 +3526,7 @@ void Mob::GMMove(const glm::vec4 &position, bool save_guard_spot) {
void Mob::SendIllusionPacket(const AppearanceStruct& a)
{
uint16 new_race = (
a.race_id != RACE_DOUG_0 ?
a.race_id != Race::Doug ?
a.race_id :
(use_model ? use_model : GetBaseRace())
);
@@ -3558,7 +3558,7 @@ void Mob::SendIllusionPacket(const AppearanceStruct& a)
uint32 new_drakkin_tattoo = a.drakkin_tattoo == UINT32_MAX ? GetDrakkinTattoo() : a.drakkin_tattoo;
// Reset features to Base from the Player Profile
if (IsClient() && a.race_id == RACE_DOUG_0) {
if (IsClient() && a.race_id == Race::Doug) {
new_beard = CastToClient()->GetBaseBeard();
new_beard_color = CastToClient()->GetBaseBeardColor();
new_drakkin_details = CastToClient()->GetBaseDetails();
@@ -3918,48 +3918,48 @@ uint16 Mob::GetFactionRace() {
uint8 Mob::GetDefaultGender(uint16 in_race, uint8 in_gender) {
if (
IsPlayerRace(in_race) ||
in_race == RACE_BROWNIE_15 ||
in_race == RACE_KERRAN_23 ||
in_race == RACE_LION_50 ||
in_race == RACE_DRACNID_57 ||
in_race == RACE_ZOMBIE_70 ||
in_race == RACE_QEYNOS_CITIZEN_71 ||
in_race == RACE_RIVERVALE_CITIZEN_81 ||
in_race == RACE_HALAS_CITIZEN_90 ||
in_race == RACE_GROBB_CITIZEN_92 ||
in_race == RACE_OGGOK_CITIZEN_93 ||
in_race == RACE_KALADIM_CITIZEN_94 ||
in_race == RACE_ELF_VAMPIRE_98 ||
in_race == RACE_FELGUARD_106 ||
in_race == RACE_FAYGUARD_112 ||
in_race == RACE_ERUDITE_GHOST_118 ||
in_race == RACE_IKSAR_CITIZEN_139 ||
in_race == RACE_SHADE_224 ||
in_race == RACE_TROLL_CREW_MEMBER_331 ||
in_race == RACE_PIRATE_DECKHAND_332 ||
in_race == RACE_GNOME_PIRATE_338 ||
in_race == RACE_DARK_ELF_PIRATE_339 ||
in_race == RACE_OGRE_PIRATE_340 ||
in_race == RACE_HUMAN_PIRATE_341 ||
in_race == RACE_ERUDITE_PIRATE_342 ||
in_race == RACE_UNDEAD_PIRATE_344 ||
in_race == RACE_KNIGHT_OF_HATE_351 ||
in_race == RACE_WARLOCK_OF_HATE_352 ||
in_race == RACE_UNDEAD_VAMPIRE_359 ||
in_race == RACE_VAMPIRE_360 ||
in_race == RACE_SAND_ELF_364 ||
in_race == RACE_TAELOSIAN_NATIVE_385 ||
in_race == RACE_TAELOSIAN_EVOKER_386 ||
in_race == RACE_DRACHNID_461 ||
in_race == RACE_ZOMBIE_471 ||
in_race == RACE_ELDDAR_489 ||
in_race == RACE_VAMPIRE_497 ||
in_race == RACE_KERRAN_562 ||
in_race == RACE_BROWNIE_568 ||
in_race == RACE_HUMAN_566 ||
in_race == RACE_ELVEN_GHOST_587 ||
in_race == RACE_HUMAN_GHOST_588 ||
in_race == RACE_COLDAIN_645
in_race == Race::Brownie ||
in_race == Race::Kerran ||
in_race == Race::Lion ||
in_race == Race::Drachnid ||
in_race == Race::Zombie ||
in_race == Race::QeynosCitizen ||
in_race == Race::RivervaleCitizen ||
in_race == Race::HalasCitizen ||
in_race == Race::GrobbCitizen ||
in_race == Race::OggokCitizen ||
in_race == Race::KaladimCitizen ||
in_race == Race::ElfVampire ||
in_race == Race::Felguard ||
in_race == Race::Fayguard ||
in_race == Race::EruditeGhost ||
in_race == Race::IksarCitizen ||
in_race == Race::Shade ||
in_race == Race::TrollCrewMember ||
in_race == Race::PirateDeckhand ||
in_race == Race::GnomePirate ||
in_race == Race::DarkElfPirate ||
in_race == Race::OgrePirate ||
in_race == Race::HumanPirate ||
in_race == Race::EruditePirate ||
in_race == Race::TrollZombie ||
in_race == Race::KnightOfHate ||
in_race == Race::ArcanistOfHate ||
in_race == Race::UndeadVampire ||
in_race == Race::Vampire3 ||
in_race == Race::SandElf ||
in_race == Race::Nihil ||
in_race == Race::Trusik ||
in_race == Race::Drachnid2 ||
in_race == Race::Zombie2 ||
in_race == Race::Elddar ||
in_race == Race::Vampire4 ||
in_race == Race::Kerran2 ||
in_race == Race::Brownie2 ||
in_race == Race::Human2 ||
in_race == Race::ElvenGhost ||
in_race == Race::HumanGhost ||
in_race == Race::Coldain2
) {
if (in_gender >= 2) { // Male default for PC Races
return 0;
@@ -3967,33 +3967,33 @@ uint8 Mob::GetDefaultGender(uint16 in_race, uint8 in_gender) {
return in_gender;
}
} else if (
in_race == RACE_FREEPORT_GUARD_44 ||
in_race == RACE_MIMIC_52 ||
in_race == RACE_HUMAN_BEGGAR_55 ||
in_race == RACE_VAMPIRE_65 ||
in_race == RACE_HIGHPASS_CITIZEN_67 ||
in_race == RACE_NERIAK_CITIZEN_77 ||
in_race == RACE_ERUDITE_CITIZEN_78 ||
in_race == RACE_CLOCKWORK_GNOME_88 ||
in_race == RACE_DWARF_GHOST_117 ||
in_race == RACE_SPECTRAL_IKSAR_147 ||
in_race == RACE_INVISIBLE_MAN_127 ||
in_race == RACE_VAMPYRE_208 ||
in_race == RACE_RECUSO_237 ||
in_race == RACE_BROKEN_SKULL_PIRATE_333 ||
in_race == RACE_INVISIBLE_MAN_OF_ZOMM_600 ||
in_race == RACE_OGRE_NPC_MALE_624 ||
in_race == RACE_BEEFEATER_667 ||
in_race == RACE_ERUDITE_678
in_race == Race::FreeportGuard ||
in_race == Race::Mimic ||
in_race == Race::HumanBeggar ||
in_race == Race::Vampire ||
in_race == Race::HighpassCitizen ||
in_race == Race::NeriakCitizen ||
in_race == Race::EruditeCitizen ||
in_race == Race::ClockworkGnome ||
in_race == Race::DwarfGhost ||
in_race == Race::IksarSpirit ||
in_race == Race::InvisibleMan ||
in_race == Race::Vampire2 ||
in_race == Race::Recuso ||
in_race == Race::BrokenSkullPirate ||
in_race == Race::InvisibleManOfZomm ||
in_race == Race::Ogre2 ||
in_race == Race::RoyalGuard ||
in_race == Race::Erudite2
) { // Male only races
return 0;
} else if (
in_race == RACE_FAIRY_25 ||
in_race == RACE_PIXIE_56 ||
in_race == RACE_BANSHEE_487 ||
in_race == RACE_BANSHEE_488 ||
in_race == RACE_AYONAE_RO_498 ||
in_race == RACE_SULLON_ZEK_499
in_race == Race::Fairy ||
in_race == Race::Pixie ||
in_race == Race::Banshee2 ||
in_race == Race::Banshee3 ||
in_race == Race::AyonaeRo ||
in_race == Race::SullonZek
) { // Female only races
return 1;
} else { // Neutral default for NPC Races
@@ -6867,22 +6867,22 @@ void Mob::RemoveAllNimbusEffects()
bool Mob::IsBoat() const {
return (
race == RACE_SHIP_72 ||
race == RACE_LAUNCH_73 ||
race == RACE_GHOST_SHIP_114 ||
race == RACE_SHIP_404 ||
race == RACE_MERCHANT_SHIP_550 ||
race == RACE_PIRATE_SHIP_551 ||
race == RACE_GHOST_SHIP_552 ||
race == RACE_BOAT_533
race == Race::Ship ||
race == Race::Launch ||
race == Race::GhostShip ||
race == Race::DiscordShip ||
race == Race::MerchantShip ||
race == Race::PirateShip ||
race == Race::GhostShip2 ||
race == Race::Boat2
);
}
bool Mob::IsControllableBoat() const {
return (
race == RACE_BOAT_141 ||
race == RACE_ROWBOAT_502
race == Race::Boat ||
race == Race::Rowboat
);
}
@@ -8218,37 +8218,37 @@ int Mob::DispatchZoneControllerEvent(
std::string Mob::GetRacePlural()
{
switch (GetBaseRace()) {
case RACE_HUMAN_1:
case Race::Human:
return "Humans";
case RACE_BARBARIAN_2:
case Race::Barbarian:
return "Barbarians";
case RACE_ERUDITE_3:
case Race::Erudite:
return "Erudites";
case RACE_WOOD_ELF_4:
case Race::WoodElf:
return "Wood Elves";
case RACE_HIGH_ELF_5:
case Race::HighElf:
return "High Elves";
case RACE_DARK_ELF_6:
case Race::DarkElf:
return "Dark Elves";
case RACE_HALF_ELF_7:
case Race::HalfElf:
return "Half Elves";
case RACE_DWARF_8:
case Race::Dwarf:
return "Dwarves";
case RACE_TROLL_9:
case Race::Troll:
return "Trolls";
case RACE_OGRE_10:
case Race::Ogre:
return "Ogres";
case RACE_HALFLING_11:
case Race::Halfling:
return "Halflings";
case RACE_GNOME_12:
case Race::Gnome:
return "Gnomes";
case RACE_IKSAR_128:
case Race::Iksar:
return "Iksar";
case RACE_VAH_SHIR_130:
case Race::VahShir:
return "Vah Shir";
case RACE_FROGLOK_330:
case Race::Froglok2:
return "Frogloks";
case RACE_DRAKKIN_522:
case Race::Drakkin:
return "Drakkin";
default:
return "Races";
+1 -1
View File
@@ -83,7 +83,7 @@ struct AppearanceStruct {
uint8 hair = UINT8_MAX;
uint8 hair_color = UINT8_MAX;
uint8 helmet_texture = UINT8_MAX;
uint16 race_id = RACE_DOUG_0;
uint16 race_id = Race::Doug;
bool send_effects = true;
float size = -1.0f;
Client *target = nullptr;
+14 -14
View File
@@ -155,10 +155,10 @@ NPC::NPC(const NPCType *npc_type_data, Spawn2 *in_respawn, const glm::vec4 &posi
// lava dragon is a fixed size model and should always use its default
// otherwise pathing issues
if (race == RACE_LAVA_DRAGON_49) {
if (race == Race::LavaDragon) {
size = 5;
}
if (race == RACE_WURM_158) {
if (race == Race::Wurm) {
size = 15;
}
@@ -3691,25 +3691,25 @@ void NPC::ScaleNPC(uint8 npc_level, bool always_scale, bool override_special_abi
bool NPC::IsGuard()
{
switch (GetRace()) {
case RT_GUARD:
case Race::FreeportGuard:
if (GetTexture() == 1 || GetTexture() == 2)
return true;
break;
case RT_IKSAR_2:
case Race::IksarCitizen:
if (GetTexture() == 1)
return true;
break;
case RT_GUARD_2:
case RT_GUARD_3:
case RT_GUARD_4:
case RT_HUMAN_3:
case RT_HALFLING_2:
case RT_ERUDITE_2:
case RT_BARBARIAN_2:
case RT_DARK_ELF_2:
case RT_TROLL_2:
case Race::Felguard:
case Race::Fayguard:
case Race::VahShirGuard:
case Race::QeynosCitizen:
case Race::RivervaleCitizen:
case Race::EruditeCitizen:
case Race::HalasCitizen:
case Race::NeriakCitizen:
case Race::GrobbCitizen:
case OGGOK_CITIZEN:
case RT_DWARF_2:
case Race::KaladimCitizen:
return true;
default:
break;
+1 -1
View File
@@ -71,7 +71,7 @@ Petition::Petition(uint32 id)
{
petid = id;
charclass = Class::None;
charrace = RACE_DOUG_0;
charrace = Race::Doug;
charlevel = 0;
checkouts = 0;
unavailables = 0;
+16 -16
View File
@@ -7430,42 +7430,42 @@ bool Mob::PassCastRestriction(int value)
case IS_BIXIE:
case IS_BIXIE2:
if ((GetRace() == RT_BIXIE) ||(GetRace() == RT_BIXIE_2))
if ((GetRace() == Race::Bixie) ||(GetRace() == Race::Bixie2))
return true;
break;
case IS_HARPY:
if ((GetRace() == RT_HARPY) ||(GetRace() == RT_HARPY_2))
if ((GetRace() == Race::Harpy) ||(GetRace() == Race::Harpy2))
return true;
break;
case IS_GNOLL:
if ((GetRace() == RT_GNOLL) || (GetRace() == RT_GNOLL_2) || (GetRace() == RT_GNOLL_3))
if ((GetRace() == Race::Gnoll) || (GetRace() == Race::Gnoll2) || (GetRace() == Race::Gnoll3))
return true;
break;
case IS_SPORALI:
if ((GetRace() == RT_SPORALI) ||(GetRace() == RT_FUNGUSMAN))
if ((GetRace() == Race::Sporali) ||(GetRace() == Race::Fungusman))
return true;
break;
case IS_KOBOLD:
if ((GetRace() == RT_KOBOLD) ||(GetRace() == RT_KOBOLD_2))
if ((GetRace() == Race::Kobold) ||(GetRace() == Race::Kobold2))
return true;
break;
case IS_FROSTCRYPT_SHADE:
if (GetRace() == RT_GIANT_SHADE)
if (GetRace() == Race::GiantShade)
return true;
break;
case IS_DRAKKIN:
if (GetRace() == RT_DRAKKIN)
if (GetRace() == Race::Drakkin)
return true;
break;
case IS_UNDEAD_OR_VALDEHOLM_GIANT:
if (GetBodyType() == BT_Undead || GetRace() == RT_GIANT_12 || GetRace() == RT_GIANT_13)
if (GetBodyType() == BT_Undead || GetRace() == Race::Giant2 || GetRace() == Race::Giant3)
return true;
break;
@@ -7496,7 +7496,7 @@ bool Mob::PassCastRestriction(int value)
break;
case IS_FAE_OR_PIXIE:
if ((GetRace() == RT_PIXIE) || (GetRace() == RT_FAY_DRAKE))
if ((GetRace() == Race::Pixie) || (GetRace() == Race::FayDrake))
return true;
break;
@@ -7511,12 +7511,12 @@ bool Mob::PassCastRestriction(int value)
break;
case IS_CLOCKWORK_AND_HP_LESS_THAN_45_PCT:
if ((GetRace() == RT_GNOMEWORK || GetRace() == RACE_CLOCKWORK_GNOME_88) && (GetHPRatio() < 45))
if ((GetRace() == Race::Gnomework || GetRace() == Race::ClockworkGnome) && (GetHPRatio() < 45))
return true;
break;
case IS_WISP_AND_HP_LESS_THAN_10_PCT:
if ((GetRace() == RT_WILL_O_WISP) && (GetHPRatio() < 10))
if ((GetRace() == Race::Wisp) && (GetHPRatio() < 10))
return true;
break;
@@ -7889,12 +7889,12 @@ bool Mob::PassCastRestriction(int value)
break;
case IS_TREANT:
if (GetRace() == RT_TREANT || GetRace() == RT_TREANT_2 || GetRace() == RT_TREANT_3)
if (GetRace() == Race::Treant || GetRace() == Race::Treant2 || GetRace() == Race::Treant3)
return true;
break;
case IS_SCARECROW:
if (GetRace() == RT_SCARECROW || GetRace() == RT_SCARECROW_2)
if (GetRace() == Race::Scarecrow || GetRace() == Race::Scarecrow2)
return true;
break;
@@ -10263,7 +10263,7 @@ void Mob::ApplySpellEffectIllusion(int32 spell_id, Mob *caster, int buffslot, in
gender_id
);
if (base != RACE_ELEMENTAL_75 && base != RACE_DRAKKIN_522) {
if (base != Race::Elemental && base != Race::Drakkin) {
if (max > 0) {
if (limit == 0) {
SendIllusionPacket(
@@ -10303,7 +10303,7 @@ void Mob::ApplySpellEffectIllusion(int32 spell_id, Mob *caster, int buffslot, in
}
);
}
} else if (base == RACE_ELEMENTAL_75){
} else if (base == Race::Elemental){
SendIllusionPacket(
AppearanceStruct{
.gender_id = static_cast<uint8>(gender_id),
@@ -10311,7 +10311,7 @@ void Mob::ApplySpellEffectIllusion(int32 spell_id, Mob *caster, int buffslot, in
.texture = static_cast<uint8>(limit),
}
);
} else if (base == RACE_DRAKKIN_522) {
} else if (base == Race::Drakkin) {
FaceChange_Struct f{
.haircolor = GetHairColor(),
.beardcolor = GetBeardColor(),
+46 -46
View File
@@ -880,118 +880,118 @@ float Mob::GetZOffset() const {
float offset = 3.125f;
switch (GetModel()) {
case RACE_BASILISK_436:
case Race::Basilisk:
offset = 0.577f;
break;
case RACE_DRAKE_430:
case Race::Drake2:
offset = 0.5f;
break;
case RACE_DRAKE_432:
case Race::Drake3:
offset = 1.9f;
break;
case RACE_DRAGON_435:
case Race::Dragon:
offset = 0.93f;
break;
case RACE_LAVA_SPIDER_450:
case Race::LavaSpider:
offset = 0.938f;
break;
case RACE_ALLIGATOR_479:
case Race::Alligator2:
offset = 0.8f;
break;
case RACE_LAVA_SPIDER_QUEEN_451:
case Race::LavaSpiderQueen:
offset = 0.816f;
break;
case RACE_DRAGON_437:
case Race::Dragon2:
offset = 0.527f;
break;
case RACE_PUMA_439:
case Race::Puma2:
offset = 1.536f;
break;
case RACE_RAT_415:
case Race::Rat:
offset = 1.0f;
break;
case RACE_DRAGON_438:
case RACE_DRAGON_452:
case Race::Dragon3:
case Race::Dragon4:
offset = 0.776f;
break;
case RACE_SPIDER_QUEEN_441:
case Race::SpiderQueen:
offset = 0.816f;
break;
case RACE_SPIDER_440:
case Race::Spider:
offset = 0.938f;
break;
case RACE_IMP_46:
case RACE_SNAKE_468:
case RACE_CORATHUS_459:
case Race::Imp:
case Race::Snake:
case Race::Corathus:
offset = 1.0f;
break;
case RACE_DRACHNID_COCOON_462:
case Race::DrachnidCocoon:
offset = 1.5f;
break;
case RACE_DRAGON_530:
case Race::Dragon5:
offset = 1.2f;
break;
case RACE_GOO_549:
case RACE_GOO_548:
case Race::Goo4:
case Race::Goo3:
offset = 0.5f;
break;
case RACE_GOO_547:
case Race::Goo2:
offset = 0.5f;
break;
case RACE_DRACOLICH_604:
case Race::Dracolich:
offset = 1.2f;
break;
case RACE_TELMIRA_653:
case Race::Telmira:
offset = 5.9f;
break;
case RACE_MORELL_THULE_658:
case Race::MorellThule:
offset = 4.0f;
break;
case RACE_ARMOR_OF_MARR_323:
case RACE_AMYGDALAN_663:
case Race::AnimatedArmor:
case Race::Amygdalan:
offset = 5.0f;
break;
case RACE_SPECTRAL_IKSAR_147:
case RACE_SANDMAN_664:
case Race::IksarSpirit:
case Race::Sandman:
offset = 4.0f;
break;
case RACE_LAVA_DRAGON_49:
case RACE_ALARAN_SENTRY_STONE_703:
case Race::LavaDragon:
case Race::AlaranSentryStone:
offset = 9.0f;
break;
case RACE_RABBIT_668:
case Race::Rabbit:
offset = 5.0f;
break;
case RACE_WURM_158:
case RACE_BLIND_DREAMER_669:
case Race::Wurm:
case Race::BlindDreamer:
offset = 7.0f;
break;
case RACE_SIREN_187:
case RACE_HALAS_CITIZEN_90:
case RACE_OTTERMAN_190:
case Race::Siren:
case Race::HalasCitizen:
case Race::Othmir:
offset = .5f;
break;
case RACE_COLDAIN_183:
case Race::Coldain:
offset = .6f;
break;
case RACE_WEREWOLF_14:
case Race::Werewolf:
offset = 1.2f;
break;
case RACE_DWARF_8:
case Race::Dwarf:
offset = .7f;
break;
case RACE_HORSE_216:
case Race::Horse:
offset = 1.4f;
break;
case RACE_ENCHANTED_ARMOR_175:
case RACE_TIGER_63:
case Race::EnchantedArmor:
case Race::Tiger:
offset = 1.75f;
break;
case RACE_STATUE_OF_RALLOS_ZEK_66:
case Race::StatueOfRallosZek:
offset = 1.0f;
break;
case RACE_GORAL_687:
case RACE_SELYRAH_686:
case Race::Goral:
case Race::Selyrah:
offset = 2.0f;
break;
default: