diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp index 529d3c18c..47814717a 100644 --- a/src/game/DBCStores.cpp +++ b/src/game/DBCStores.cpp @@ -146,6 +146,8 @@ MapDifficultyMap sMapDifficultyMap; DBCStorage sMovieStore(MovieEntryfmt); +DBCStorage sNumTalentsAtLevelStore(NumTalentsAtLevelfmt); + DBCStorage sOverrideSpellDataStore(OverrideSpellDatafmt); DBCStorage sQuestFactionRewardStore(QuestFactionRewardfmt); DBCStorage sQuestSortStore(QuestSortEntryfmt); @@ -202,6 +204,9 @@ DBCStorage sSummonPropertiesStore(SummonPropertiesfmt); DBCStorage sTalentStore(TalentEntryfmt); TalentSpellPosMap sTalentSpellPosMap; DBCStorage sTalentTabStore(TalentTabEntryfmt); +DBCStorage sTalentTreePrimarySpellsStore(TalentTreePrimarySpellsfmt); +typedef std::map > TalentTreePrimarySpellsMap; +TalentTreePrimarySpellsMap sTalentTreePrimarySpellsMap; // store absolute bit position for first rank for talent inspect static uint32 sTalentTabPages[MAX_CLASSES][3]; @@ -538,6 +543,7 @@ void LoadDBCStores(const std::string& dataPath) sMapDifficultyStore.Clear(); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sMovieStore, dbcPath,"Movie.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sNumTalentsAtLevelStore, dbcPath,"NumTalentsAtLevel.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sOverrideSpellDataStore, dbcPath,"OverrideSpellData.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sQuestFactionRewardStore, dbcPath,"QuestFactionReward.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sQuestSortStore, dbcPath,"QuestSort.dbc"); @@ -675,13 +681,18 @@ void LoadDBCStores(const std::string& dataPath) continue; // store class talent tab pages - uint32 cls = 1; - for(uint32 m=1;!(m & talentTabInfo->ClassMask) && cls < MAX_CLASSES;m <<=1, ++cls) {} - - sTalentTabPages[cls][talentTabInfo->tabpage]=talentTabId; + for (uint32 cls = 1; cls < MAX_CLASSES; ++cls) + if (talentTabInfo->ClassMask & (1 << (cls - 1))) + sTalentTabPages[cls][talentTabInfo->tabpage] = talentTabId; } } + LoadDBC(availableDbcLocales,bar,bad_dbc_files, sTalentTreePrimarySpellsStore, dbcPath, "TalentTreePrimarySpells.dbc"); + for (uint32 i = 0; i < sTalentTreePrimarySpellsStore.GetNumRows(); ++i) + if (TalentTreePrimarySpellsEntry const* talentSpell = sTalentTreePrimarySpellsStore.LookupEntry(i)) + sTalentTreePrimarySpellsMap[talentSpell->TalentTree].push_back(talentSpell->SpellId); + sTalentTreePrimarySpellsStore.Clear(); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTaxiNodesStore, dbcPath,"TaxiNodes.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTaxiPathStore, dbcPath,"TaxiPath.dbc"); @@ -1051,6 +1062,15 @@ uint32 const* GetTalentTabPages(uint32 cls) return sTalentTabPages[cls]; } +std::vector const* GetTalentTreePrimarySpells(uint32 talentTree) +{ + TalentTreePrimarySpellsMap::const_iterator itr = sTalentTreePrimarySpellsMap.find(talentTree); + if (itr == sTalentTreePrimarySpellsMap.end()) + return NULL; + + return &itr->second; +} + bool IsPointInAreaTriggerZone(AreaTriggerEntry const* atEntry, uint32 mapid, float x, float y, float z, float delta) { if (mapid != atEntry->mapid) diff --git a/src/game/DBCStores.h b/src/game/DBCStores.h index fa758266b..488d25a2c 100644 --- a/src/game/DBCStores.h +++ b/src/game/DBCStores.h @@ -89,6 +89,7 @@ inline Difficulty GetPrevDifficulty(Difficulty diff, bool isRaid) } uint32 const* /*[3]*/ GetTalentTabPages(uint32 cls); +std::vector const* GetTalentTreePrimarySpells(uint32 talentTree); bool IsPointInAreaTriggerZone(AreaTriggerEntry const* atEntry, uint32 mapid, float x, float y, float z, float delta = 0.0f); @@ -172,6 +173,7 @@ extern DBCStorage sMapStore; //extern DBCStorage sMapDifficultyStore; -- use GetMapDifficultyData insteed extern MapDifficultyMap sMapDifficultyMap; extern DBCStorage sMovieStore; +extern DBCStorage sNumTalentsAtLevelStore; extern DBCStorage sOverrideSpellDataStore; extern DBCStorage sQuestFactionRewardStore; extern DBCStorage sQuestSortStore; diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index 10814f755..6e94c274f 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -1339,6 +1339,12 @@ struct MovieEntry //uint32 unk2; // 3 4.0.0 }; +struct NumTalentsAtLevelEntry +{ + //uint32 Level; // 0 index + float Talents; // 1 talent count +}; + #define MAX_OVERRIDE_SPELLS 10 struct OverrideSpellDataEntry @@ -2146,6 +2152,14 @@ struct TalentTabEntry //uint32 spellIds[2]; // 9-10 passive mastery bonus spells? }; +struct TalentTreePrimarySpellsEntry +{ + //uint32 Id; // 0 index + uint32 TalentTree; // 1 entry from TalentTab.dbc + uint32 SpellId; // 2 spell id to learn + //uint32 Flags; // 3 some kind of flags +}; + struct TaxiNodesEntry { uint32 ID; // 0 m_ID diff --git a/src/game/DBCfmt.h b/src/game/DBCfmt.h index f545e5a62..3f5630674 100644 --- a/src/game/DBCfmt.h +++ b/src/game/DBCfmt.h @@ -86,6 +86,7 @@ const char MailTemplateEntryfmt[]="nxs"; const char MapEntryfmt[]="nsiiiisissififfiiiii"; const char MapDifficultyEntryfmt[]="niisiis"; const char MovieEntryfmt[]="nxxx"; +const char NumTalentsAtLevelfmt[]="df"; const char OverrideSpellDatafmt[]="niiiiiiiiiixx"; const char QuestFactionRewardfmt[]="niiiiiiiiii"; const char QuestSortEntryfmt[]="nx"; @@ -130,6 +131,7 @@ const char SpellShapeshiftFormfmt[]="nxxiixiiixxiiiiiiiixx"; const char SummonPropertiesfmt[] = "niiiii"; const char TalentEntryfmt[]="niiiiiiixxiiibbbbxx"; const char TalentTabEntryfmt[]="nxxiiixxxxx"; +const char TalentTreePrimarySpellsfmt[]="diix"; const char TaxiNodesEntryfmt[]="nifffsiixxx"; const char TaxiPathEntryfmt[]="niii"; const char TaxiPathNodeEntryfmt[]="diiifffiiii"; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 2b3341712..db118ebba 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "12139" + #define REVISION_NR "12140" #endif // __REVISION_NR_H__