diff options
| author | HelloKitty <andrew.blakely@ymail.com> | 2020-05-15 13:41:16 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-15 20:41:16 +0200 |
| commit | 43b595111dce03258c29fd926201660b9d3acb8d (patch) | |
| tree | d47f71e018ea1ba6c3a1d34580d52ef695672388 /src/server/shared/DataStores | |
| parent | 1d43003cfa29cee2c7921fdeaa5c1714d085c770 (diff) | |
Further improve ChrRace DBC handling (#24508)
* Core/DBC: Added ChrRacesAllianceType for ChrRaces.dbc
* Core/Character: Check ChrRace DBC playable in HandleCharCreateOpcode
* Core/DBC: Implement ChrRacesFlags removing literals
Cannot take credit for this enum, derived from documentation in
https://wowdev.wiki/DB/ChrRaces
* Core/Character: Check CHRRACES_FLAGS_NOT_PLAYABLE on creation
* Core/DBC: Fix formatting of ChrRaces enums
* Core/DBC: Use ChrRaces CreatureType instead of hardcoded humanoid assumption
* Address enum style code changes
Diffstat (limited to 'src/server/shared/DataStores')
| -rw-r--r-- | src/server/shared/DataStores/DBCStructure.h | 20 | ||||
| -rw-r--r-- | src/server/shared/DataStores/DBCfmt.h | 2 |
2 files changed, 19 insertions, 3 deletions
diff --git a/src/server/shared/DataStores/DBCStructure.h b/src/server/shared/DataStores/DBCStructure.h index cd71c310f30..e2d828f37a7 100644 --- a/src/server/shared/DataStores/DBCStructure.h +++ b/src/server/shared/DataStores/DBCStructure.h @@ -392,6 +392,20 @@ struct ChrClassesEntry uint32 expansion; // 59 (0 - original race, 1 - tbc addon, ...) }; +enum ChrRacesAllianceType +{ + CHRRACES_ALLIANCE_TYPE_ALLIANCE = 0, + CHRRACES_ALLIANCE_TYPE_HORDE = 1, + CHRRACES_ALLIANCE_TYPE_NOT_PLAYABLE = 2, +}; + +enum ChrRacesFlags +{ + CHRRACES_FLAGS_NOT_PLAYABLE = 0x01, + CHRRACES_FLAGS_BARE_FEET = 0x02, + CHRRACES_FLAGS_CAN_MOUNT = 0x04 +}; + struct ChrRacesEntry { uint32 RaceID; // 0 @@ -402,11 +416,11 @@ struct ChrRacesEntry uint32 model_f; // 5 // 6 unused uint32 TeamID; // 7 (7-Alliance 1-Horde) - // 8 unused + uint32 CreatureType; // 8 Blizzlike Always 7 (humanoid). uint32 ResSicknessSpellID; // 9 Blizzlike DBC always 15007. // 10-11 unused uint32 CinematicSequence; // 12 id from CinematicSequences.dbc - //uint32 unk_322; // 13 faction (0 alliance, 1 horde, 2 not available?) + uint32 Alliance; // 13 faction (0 alliance, 1 horde, 2 not available?) char* name[16]; // 14-29 used for DBC language detection/selection // 30 string flags, unused //char* nameFemale[16]; // 31-46, if different from base (male) case @@ -415,6 +429,8 @@ struct ChrRacesEntry // 64 string flags, unused // 65-67 unused uint32 expansion; // 68 (0 - original race, 1 - tbc addon, ...) + + inline bool HasFlag(ChrRacesFlags flag) const { return !!(Flags & flag); } }; struct CinematicCameraEntry diff --git a/src/server/shared/DataStores/DBCfmt.h b/src/server/shared/DataStores/DBCfmt.h index 00267759742..0370fea071b 100644 --- a/src/server/shared/DataStores/DBCfmt.h +++ b/src/server/shared/DataStores/DBCfmt.h @@ -37,7 +37,7 @@ char constexpr CharSectionsEntryfmt[] = "diiixxxiii"; char constexpr CharTitlesEntryfmt[] = "nxssssssssssssssssxssssssssssssssssxi"; char constexpr ChatChannelsEntryfmt[] = "nixssssssssssssssssxxxxxxxxxxxxxxxxxx"; char constexpr ChrClassesEntryfmt[] = "nxixssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixii"; -char constexpr ChrRacesEntryfmt[] = "niixiixixixxixssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi"; +char constexpr ChrRacesEntryfmt[] = "niixiixiiixxiissssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi"; char constexpr CinematicCameraEntryfmt[] = "nsiffff"; char constexpr CinematicSequencesEntryfmt[] = "nxixxxxxxx"; char constexpr CreatureDisplayInfofmt[] = "nixifxxxxxxxxxxx"; |
