mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-20 23:11:56 -04:00
Core/DataStores: Corrected reading CharStartOutfit.dbc
This commit is contained in:
@@ -62,6 +62,7 @@ DBCStorage <BankBagSlotPricesEntry> sBankBagSlotPricesStore(BankBagSlotPricesEnt
|
||||
DBCStorage <BattlemasterListEntry> sBattlemasterListStore(BattlemasterListEntryfmt);
|
||||
DBCStorage <BarberShopStyleEntry> sBarberShopStyleStore(BarberShopStyleEntryfmt);
|
||||
DBCStorage <CharStartOutfitEntry> sCharStartOutfitStore(CharStartOutfitEntryfmt);
|
||||
std::map<uint32, CharStartOutfitEntry const*> sCharStartOutfitMap;
|
||||
DBCStorage <CharTitlesEntry> sCharTitlesStore(CharTitlesEntryfmt);
|
||||
DBCStorage <ChatChannelsEntry> sChatChannelsStore(ChatChannelsEntryfmt);
|
||||
DBCStorage <ChrClassesEntry> sChrClassesStore(ChrClassesEntryfmt);
|
||||
@@ -284,6 +285,10 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sBattlemasterListStore, dbcPath, "BattlemasterList.dbc");
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sBarberShopStyleStore, dbcPath, "BarberShopStyle.dbc");
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sCharStartOutfitStore, dbcPath, "CharStartOutfit.dbc");
|
||||
for (uint32 i = 0; i < sCharStartOutfitStore.GetNumRows(); ++i)
|
||||
if (CharStartOutfitEntry const* outfit = sCharStartOutfitStore.LookupEntry(i))
|
||||
sCharStartOutfitMap[outfit->Race | (outfit->Class << 8) | (outfit->Gender << 16)] = outfit;
|
||||
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sCharTitlesStore, dbcPath, "CharTitles.dbc");
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sChatChannelsStore, dbcPath, "ChatChannels.dbc");
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sChrClassesStore, dbcPath, "ChrClasses.dbc");
|
||||
@@ -872,3 +877,11 @@ uint32 GetLiquidFlags(uint32 liquidType)
|
||||
return 0;
|
||||
}
|
||||
|
||||
CharStartOutfitEntry const* GetCharStartOutfitEntry(uint8 race, uint8 class_, uint8 gender)
|
||||
{
|
||||
std::map<uint32, CharStartOutfitEntry const*>::const_iterator itr = sCharStartOutfitMap.find(race | (class_ << 8) | (gender << 16));
|
||||
if (itr == sCharStartOutfitMap.end())
|
||||
return NULL;
|
||||
|
||||
return itr->second;
|
||||
}
|
||||
|
||||
@@ -65,6 +65,8 @@ uint32 GetLiquidFlags(uint32 liquidType);
|
||||
PvPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 level);
|
||||
PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundBracketId id);
|
||||
|
||||
CharStartOutfitEntry const* GetCharStartOutfitEntry(uint8 race, uint8 class_, uint8 gender);
|
||||
|
||||
extern DBCStorage <AchievementEntry> sAchievementStore;
|
||||
extern DBCStorage <AchievementCriteriaEntry> sAchievementCriteriaStore;
|
||||
extern DBCStorage <AreaTableEntry> sAreaStore;// recommend access using functions
|
||||
|
||||
@@ -629,13 +629,13 @@ struct BattlemasterListEntry
|
||||
struct CharStartOutfitEntry
|
||||
{
|
||||
//uint32 Id; // 0
|
||||
uint32 RaceClassGender; // 1 (UNIT_FIELD_BYTES_0 & 0x00FFFFFF) comparable (0 byte = race, 1 byte = class, 2 byte = gender)
|
||||
int32 ItemId[MAX_OUTFIT_ITEMS]; // 2-13
|
||||
//int32 ItemDisplayId[MAX_OUTFIT_ITEMS]; // 14-25 not required at server side
|
||||
//int32 ItemInventorySlot[MAX_OUTFIT_ITEMS]; // 26-37 not required at server side
|
||||
//uint32 Unknown1; // 38, unique values (index-like with gaps ordered in other way as ids)
|
||||
//uint32 Unknown2; // 39
|
||||
//uint32 Unknown3; // 40
|
||||
uint8 Race; // 1
|
||||
uint8 Class; // 2
|
||||
uint8 Gender; // 3
|
||||
//uint8 Unused; // 4
|
||||
int32 ItemId[MAX_OUTFIT_ITEMS]; // 5-28
|
||||
//int32 ItemDisplayId[MAX_OUTFIT_ITEMS]; // 29-52 not required at server side
|
||||
//int32 ItemInventorySlot[MAX_OUTFIT_ITEMS]; // 53-76 not required at server side
|
||||
};
|
||||
|
||||
struct CharTitlesEntry
|
||||
|
||||
@@ -31,7 +31,7 @@ char const AuctionHouseEntryfmt[] = "niiixxxxxxxxxxxxxxxxx";
|
||||
char const BankBagSlotPricesEntryfmt[] = "ni";
|
||||
char const BarberShopStyleEntryfmt[] = "nixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiii";
|
||||
char const BattlemasterListEntryfmt[] = "niiiiiiiiixssssssssssssssssxiixx";
|
||||
char const CharStartOutfitEntryfmt[] = "xniiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||
char const CharStartOutfitEntryfmt[] = "dbbbXiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||
char const CharTitlesEntryfmt[] = "nxssssssssssssssssxxxxxxxxxxxxxxxxxxi";
|
||||
char const ChatChannelsEntryfmt[] = "nixssssssssssssssssxxxxxxxxxxxxxxxxxx";
|
||||
char const ChrClassesEntryfmt[] = "nxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixii";
|
||||
|
||||
@@ -1120,7 +1120,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo)
|
||||
addActionButton(action_itr->button, action_itr->action, action_itr->type);
|
||||
|
||||
// original items
|
||||
if (CharStartOutfitEntry const* oEntry = sCharStartOutfitStore.LookupEntry(RaceClassGender))
|
||||
if (CharStartOutfitEntry const* oEntry = GetCharStartOutfitEntry(createInfo->Race, createInfo->Class, createInfo->Gender))
|
||||
{
|
||||
for (int j = 0; j < MAX_OUTFIT_ITEMS; ++j)
|
||||
{
|
||||
|
||||
@@ -2956,10 +2956,9 @@ void ObjectMgr::PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint3
|
||||
if (count < -1)
|
||||
sLog->outError(LOG_FILTER_SQL, "Invalid count %i specified on item %u be removed from original player create info (use -1)!", count, itemId);
|
||||
|
||||
uint32 RaceClass = (race_) | (class_ << 8);
|
||||
for (uint32 gender = 0; gender < GENDER_NONE; ++gender)
|
||||
{
|
||||
if (CharStartOutfitEntry const* entry = sCharStartOutfitStore.LookupEntry(RaceClass | (gender << 16)))
|
||||
if (CharStartOutfitEntry const* entry = GetCharStartOutfitEntry(race_, class_, gender))
|
||||
{
|
||||
bool found = false;
|
||||
for (uint8 x = 0; x < MAX_OUTFIT_ITEMS; ++x)
|
||||
|
||||
Reference in New Issue
Block a user