feat(Core/DBC): load CharSections and EmotesTextSound (#27578)

Co-authored-by: antony <[email protected]>
Co-authored-by: UltraNix <[email protected]>
Co-authored-by: kadeshar <[email protected]>
Co-authored-by: arks <[email protected]>
Co-authored-by: treeston <[email protected]>
Co-authored-by: Shauren <[email protected]>
This commit is contained in:
Keleborn
2026-09-21 22:06:36 +02:00
committed by GitHub
co-authored by antony UltraNix kadeshar arks treeston Shauren
parent 6792c7de37
commit 0126bc3cc8
5 changed files with 86 additions and 3 deletions
@@ -0,0 +1,24 @@
--
-- World DB override tables for CharSections.dbc and EmotesTextSound.dbc.
CREATE TABLE IF NOT EXISTS `charsections_dbc` (
`ID` int NOT NULL DEFAULT '0',
`RaceID` int NOT NULL DEFAULT '0',
`SexID` int NOT NULL DEFAULT '0',
`BaseSection` int NOT NULL DEFAULT '0',
`TextureName_1` varchar(100) DEFAULT NULL,
`TextureName_2` varchar(100) DEFAULT NULL,
`TextureName_3` varchar(100) DEFAULT NULL,
`Flags` int NOT NULL DEFAULT '0',
`VariationIndex` int NOT NULL DEFAULT '0',
`ColorIndex` int NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `emotestextsound_dbc` (
`ID` int NOT NULL DEFAULT '0',
`EmotesTextID` int NOT NULL DEFAULT '0',
`RaceID` int NOT NULL DEFAULT '0',
`SexID` int NOT NULL DEFAULT '0',
`SoundID` int NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+21 -3
View File
@@ -28,9 +28,6 @@
#include "World.h"
#include <map>
typedef std::map<uint16, uint32> AreaFlagByAreaID;
typedef std::map<uint32, uint32> AreaFlagByMapID;
typedef std::tuple<int16, int8, int32> WMOAreaTableKey;
typedef std::map<WMOAreaTableKey, WMOAreaTableEntry const*> WMOAreaInfoByTripple;
@@ -49,6 +46,9 @@ DBCStorage <BattlemasterListEntry> sBattlemasterListStore(BattlemasterListEntryf
DBCStorage <BarberShopStyleEntry> sBarberShopStyleStore(BarberShopStyleEntryfmt);
DBCStorage <CharStartOutfitEntry> sCharStartOutfitStore(CharStartOutfitEntryfmt);
std::map<uint32, CharStartOutfitEntry const*> sCharStartOutfitMap;
DBCStorage <CharSectionsEntry> sCharSectionsStore(CharSectionsEntryfmt);
DBCStorage <CharTitlesEntry> sCharTitlesStore(CharTitlesEntryfmt);
DBCStorage <ChatChannelsEntry> sChatChannelsStore(ChatChannelsEntryfmt);
DBCStorage <ChrClassesEntry> sChrClassesStore(ChrClassesEntryfmt);
@@ -71,6 +71,10 @@ DBCStorage <DurabilityCostsEntry> sDurabilityCostsStore(DurabilityCostsfmt);
DBCStorage <EmotesEntry> sEmotesStore(EmotesEntryfmt);
DBCStorage <EmotesTextEntry> sEmotesTextStore(EmotesTextEntryfmt);
typedef std::tuple<uint32, uint32, uint32> EmotesTextSoundKey;
static std::map<EmotesTextSoundKey, EmotesTextSoundEntry const*> sEmotesTextSoundMap;
DBCStorage <EmotesTextSoundEntry> sEmotesTextSoundStore(EmotesTextSoundEntryfmt);
typedef std::map<uint32, SimpleFactionsList> FactionTeamMap;
static FactionTeamMap sFactionTeamMap;
DBCStorage <FactionEntry> sFactionStore(FactionEntryfmt);
@@ -280,6 +284,7 @@ void LoadDBCStores(std::string const& dataPath)
LOAD_DBC(sBattlemasterListStore, "BattlemasterList.dbc", "battlemasterlist_dbc");
LOAD_DBC(sBarberShopStyleStore, "BarberShopStyle.dbc", "barbershopstyle_dbc");
LOAD_DBC(sCharStartOutfitStore, "CharStartOutfit.dbc", "charstartoutfit_dbc");
LOAD_DBC(sCharSectionsStore, "CharSections.dbc", "charsections_dbc");
LOAD_DBC(sCharTitlesStore, "CharTitles.dbc", "chartitles_dbc");
LOAD_DBC(sChatChannelsStore, "ChatChannels.dbc", "chatchannels_dbc");
LOAD_DBC(sChrClassesStore, "ChrClasses.dbc", "chrclasses_dbc");
@@ -299,6 +304,7 @@ void LoadDBCStores(std::string const& dataPath)
LOAD_DBC(sDurabilityQualityStore, "DurabilityQuality.dbc", "durabilityquality_dbc");
LOAD_DBC(sEmotesStore, "Emotes.dbc", "emotes_dbc");
LOAD_DBC(sEmotesTextStore, "EmotesText.dbc", "emotestext_dbc");
LOAD_DBC(sEmotesTextSoundStore, "EmotesTextSound.dbc", "emotestextsound_dbc");
LOAD_DBC(sFactionStore, "Faction.dbc", "faction_dbc");
LOAD_DBC(sFactionTemplateStore, "FactionTemplate.dbc", "factiontemplate_dbc");
LOAD_DBC(sGameObjectArtKitStore, "GameObjectArtKit.dbc", "gameobjectartkit_dbc");
@@ -408,6 +414,12 @@ void LoadDBCStores(std::string const& dataPath)
std::swap(*(float*)(&info->maxZ), *(float*)(&info->minZ));
}
for (EmotesTextSoundEntry const* emoteTextSound : sEmotesTextSoundStore)
{
EmotesTextSoundKey key(emoteTextSound->EmotesTextId, emoteTextSound->RaceId, emoteTextSound->SexId);
sEmotesTextSoundMap[key] = emoteTextSound;
}
// fill data
for (MapDifficultyEntry const* entry : sMapDifficultyStore)
sMapDifficultyMap[MAKE_PAIR32(entry->MapId, entry->Difficulty)] = MapDifficulty(entry->resetTime, entry->maxPlayers, entry->areaTriggerText[0] != '\0');
@@ -913,6 +925,12 @@ SkillRaceClassInfoEntry const* GetSkillRaceClassInfo(uint32 skill, uint8 race, u
return nullptr;
}
EmotesTextSoundEntry const* FindTextSoundEmoteFor(uint32 emote, uint32 race, uint32 gender)
{
auto itr = sEmotesTextSoundMap.find(EmotesTextSoundKey(emote, race, gender));
return itr != sEmotesTextSoundMap.end() ? itr->second : nullptr;
}
std::vector<SkillLineAbilityEntry const*> const& GetSkillLineAbilitiesBySkillLine(uint32 skillLine)
{
auto it = sSkillLineAbilityIndexBySkillLine.find(skillLine);
+3
View File
@@ -72,6 +72,7 @@ typedef std::unordered_multimap<uint32, SkillRaceClassInfoEntry const*> SkillRac
typedef std::pair<SkillRaceClassInfoMap::iterator, SkillRaceClassInfoMap::iterator> SkillRaceClassInfoBounds;
SkillRaceClassInfoEntry const* GetSkillRaceClassInfo(uint32 skill, uint8 race, uint8 class_);
EmotesTextSoundEntry const* FindTextSoundEmoteFor(uint32 emote, uint32 race, uint32 gender);
typedef std::unordered_map<uint32 /* SkillLine */, std::vector<SkillLineAbilityEntry const*> > SkillLineAbilityIndexBySkillLine;
std::vector<SkillLineAbilityEntry const*> const& GetSkillLineAbilitiesBySkillLine(uint32 skillLine);
@@ -87,6 +88,7 @@ extern DBCStorage <BarberShopStyleEntry> sBarberShopStyleStore;
extern DBCStorage <BattlemasterListEntry> sBattlemasterListStore;
extern DBCStorage <ChatChannelsEntry> sChatChannelsStore;
extern DBCStorage <CharStartOutfitEntry> sCharStartOutfitStore;
extern DBCStorage <CharSectionsEntry> sCharSectionsStore;
extern DBCStorage <CharTitlesEntry> sCharTitlesStore;
extern DBCStorage <ChrClassesEntry> sChrClassesStore;
extern DBCStorage <ChrRacesEntry> sChrRacesStore;
@@ -105,6 +107,7 @@ extern DBCStorage <DurabilityCostsEntry> sDurabilityCostsStore;
extern DBCStorage <DurabilityQualityEntry> sDurabilityQualityStore;
extern DBCStorage <EmotesEntry> sEmotesStore;
extern DBCStorage <EmotesTextEntry> sEmotesTextStore;
extern DBCStorage <EmotesTextSoundEntry> sEmotesTextSoundStore;
extern DBCStorage <FactionEntry> sFactionStore;
extern DBCStorage <FactionTemplateEntry> sFactionTemplateStore;
extern DBCStorage <GameObjectArtKitEntry> sGameObjectArtKitStore;
@@ -628,6 +628,33 @@ struct CharStartOutfitEntry
//int32 ItemInventorySlot[MAX_OUTFIT_ITEMS]; // 53-76 not required at server side
};
enum CharSectionFlags
{
SECTION_FLAG_PLAYER = 0x01,
SECTION_FLAG_DEATH_KNIGHT = 0x04
};
enum CharSectionType
{
SECTION_TYPE_SKIN = 0,
SECTION_TYPE_FACE = 1,
SECTION_TYPE_FACIAL_HAIR = 2,
SECTION_TYPE_HAIR = 3,
SECTION_TYPE_UNDERWEAR = 4
};
struct CharSectionsEntry
{
//uint32 ID; // 0
uint32 RaceID; // 1
uint32 SexID; // 2
uint32 BaseSection; // 3, CharSectionType
//char const* TextureName[3]; // 4-6
uint32 Flags; // 7, CharSectionFlags
uint32 VariationIndex; // 8
uint32 ColorIndex; // 9
};
struct CharTitlesEntry
{
uint32 ID; // 0, title ids, for example in Quest::GetCharTitleId()
@@ -903,6 +930,15 @@ struct EmotesTextEntry
uint32 textid;
};
struct EmotesTextSoundEntry
{
uint32 Id; // 0
uint32 EmotesTextId; // 1
uint32 RaceId; // 2
uint32 SexId; // 3, 0 male / 1 female
uint32 SoundId; // 4
};
struct FactionEntry
{
uint32 ID; // 0 m_ID
+2
View File
@@ -29,6 +29,7 @@ char constexpr BankBagSlotPricesEntryfmt[] = "ni";
char constexpr BarberShopStyleEntryfmt[] = "nixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiii";
char constexpr BattlemasterListEntryfmt[] = "niiiiiiiiixssssssssssssssssxiixx";
char constexpr CharStartOutfitEntryfmt[] = "dbbbXiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
char constexpr CharSectionsEntryfmt[] = "diiixxxiii";
char constexpr CharTitlesEntryfmt[] = "nxssssssssssssssssxssssssssssssssssxi";
char constexpr ChatChannelsEntryfmt[] = "nixssssssssssssssssxxxxxxxxxxxxxxxxxx"; // ChatChannelsEntryfmt, index not used (more compact store)
char constexpr ChrClassesEntryfmt[] = "nxixssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixii";
@@ -48,6 +49,7 @@ char constexpr DurabilityCostsfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiiiiiii";
char constexpr DurabilityQualityfmt[] = "nf";
char constexpr EmotesEntryfmt[] = "nxxiiix";
char constexpr EmotesTextEntryfmt[] = "nxixxxxxxxxxxxxxxxx";
char constexpr EmotesTextSoundEntryfmt[] = "niiii";
char constexpr FactionEntryfmt[] = "niiiiiiiiiiiiiiiiiiffixssssssssssssssssxxxxxxxxxxxxxxxxxx";
char constexpr FactionTemplateEntryfmt[] = "niiiiiiiiiiiii";
char constexpr GameObjectArtKitfmt[] = "nxxxxxxx";