diff options
| author | Shauren <shauren.trinity@gmail.com> | 2018-10-04 18:50:21 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2018-11-05 00:00:34 +0100 |
| commit | 0a779bd791fb63b2fc1663206279c7eaa9c02c6f (patch) | |
| tree | cf13cec2eaab909646f278242981dd51349fddfd /src/server/game/DataStores | |
| parent | 7512ffb0587eccd8fbb2a2841900d572056dbae3 (diff) | |
Core/PacketIO: Updated packet structures to 8.0.1
Diffstat (limited to 'src/server/game/DataStores')
| -rw-r--r-- | src/server/game/DataStores/DB2LoadInfo.h | 34 | ||||
| -rw-r--r-- | src/server/game/DataStores/DB2Stores.cpp | 36 | ||||
| -rw-r--r-- | src/server/game/DataStores/DB2Stores.h | 5 | ||||
| -rw-r--r-- | src/server/game/DataStores/DB2Structure.h | 17 |
4 files changed, 91 insertions, 1 deletions
diff --git a/src/server/game/DataStores/DB2LoadInfo.h b/src/server/game/DataStores/DB2LoadInfo.h index bf831521cba..81ba8e1d6df 100644 --- a/src/server/game/DataStores/DB2LoadInfo.h +++ b/src/server/game/DataStores/DB2LoadInfo.h @@ -51,6 +51,24 @@ struct AchievementLoadInfo } }; +struct AnimationDataLoadInfo +{ + static DB2LoadInfo const* Instance() + { + static DB2FieldMeta const fields[] = + { + { false, FT_INT, "ID" }, + { false, FT_SHORT, "Fallback" }, + { false, FT_BYTE, "BehaviorTier" }, + { true, FT_INT, "BehaviorID" }, + { true, FT_INT, "Flags1" }, + { true, FT_INT, "Flags2" }, + }; + static DB2LoadInfo const loadInfo(&fields[0], std::extent<decltype(fields)>::value, AnimationDataMeta::Instance(), HOTFIX_SEL_ANIMATION_DATA); + return &loadInfo; + } +}; + struct AnimKitLoadInfo { static DB2LoadInfo const* Instance() @@ -3384,6 +3402,22 @@ struct NamesReservedLocaleLoadInfo } }; +struct NumTalentsAtLevelLoadInfo +{ + static DB2LoadInfo const* Instance() + { + static DB2FieldMeta const fields[] = + { + { false, FT_INT, "ID" }, + { true, FT_INT, "NumTalents" }, + { true, FT_INT, "NumTalentsDeathKnight" }, + { true, FT_INT, "NumTalentsDemonHunter" }, + }; + static DB2LoadInfo const loadInfo(&fields[0], std::extent<decltype(fields)>::value, NumTalentsAtLevelMeta::Instance(), HOTFIX_SEL_NUM_TALENTS_AT_LEVEL); + return &loadInfo; + } +}; + struct OverrideSpellDataLoadInfo { static DB2LoadInfo const* Instance() diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp index 0adeac47f51..59b99139d8c 100644 --- a/src/server/game/DataStores/DB2Stores.cpp +++ b/src/server/game/DataStores/DB2Stores.cpp @@ -37,6 +37,7 @@ #endif DB2Storage<AchievementEntry> sAchievementStore("Achievement.db2", AchievementLoadInfo::Instance()); +DB2Storage<AnimationDataEntry> sAnimationDataStore("AnimationData.db2", AnimationDataLoadInfo::Instance()); DB2Storage<AnimKitEntry> sAnimKitStore("AnimKit.db2", AnimKitLoadInfo::Instance()); DB2Storage<AreaGroupMemberEntry> sAreaGroupMemberStore("AreaGroupMember.db2", AreaGroupMemberLoadInfo::Instance()); DB2Storage<AreaTableEntry> sAreaTableStore("AreaTable.db2", AreaTableLoadInfo::Instance()); @@ -182,6 +183,7 @@ DB2Storage<NameGenEntry> sNameGenStore("NameGen.db2", Nam DB2Storage<NamesProfanityEntry> sNamesProfanityStore("NamesProfanity.db2", NamesProfanityLoadInfo::Instance()); DB2Storage<NamesReservedEntry> sNamesReservedStore("NamesReserved.db2", NamesReservedLoadInfo::Instance()); DB2Storage<NamesReservedLocaleEntry> sNamesReservedLocaleStore("NamesReservedLocale.db2", NamesReservedLocaleLoadInfo::Instance()); +DB2Storage<NumTalentsAtLevelEntry> sNumTalentsAtLevelStore("NumTalentsAtLevel.db2", NumTalentsAtLevelLoadInfo::Instance()); DB2Storage<OverrideSpellDataEntry> sOverrideSpellDataStore("OverrideSpellData.db2", OverrideSpellDataLoadInfo::Instance()); DB2Storage<PhaseEntry> sPhaseStore("Phase.db2", PhaseLoadInfo::Instance()); DB2Storage<PhaseXPhaseGroupEntry> sPhaseXPhaseGroupStore("PhaseXPhaseGroup.db2", PhaseXPhaseGroupLoadInfo::Instance()); @@ -490,6 +492,7 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale) #define LOAD_DB2(store) LoadDB2(availableDb2Locales, bad_db2_files, _stores, &store, db2Path, defaultLocale, store) LOAD_DB2(sAchievementStore); + LOAD_DB2(sAnimationDataStore); LOAD_DB2(sAnimKitStore); LOAD_DB2(sAreaGroupMemberStore); LOAD_DB2(sAreaTableStore); @@ -634,6 +637,7 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale) LOAD_DB2(sNamesProfanityStore); LOAD_DB2(sNamesReservedStore); LOAD_DB2(sNamesReservedLocaleStore); + LOAD_DB2(sNumTalentsAtLevelStore); LOAD_DB2(sOverrideSpellDataStore); LOAD_DB2(sPhaseStore); LOAD_DB2(sPhaseXPhaseGroupStore); @@ -2102,6 +2106,28 @@ ResponseCodes DB2Manager::ValidateName(std::wstring const& name, LocaleConstant return CHAR_NAME_SUCCESS; } +int32 DB2Manager::GetNumTalentsAtLevel(uint32 level, Classes playerClass) +{ + NumTalentsAtLevelEntry const* numTalentsAtLevel = sNumTalentsAtLevelStore.LookupEntry(level); + if (!numTalentsAtLevel) + numTalentsAtLevel = sNumTalentsAtLevelStore.LookupEntry(sNumTalentsAtLevelStore.GetNumRows() - 1); + + if (numTalentsAtLevel) + { + switch (playerClass) + { + case CLASS_DEATH_KNIGHT: + return numTalentsAtLevel->NumTalentsDeathKnight; + case CLASS_DEMON_HUNTER: + return numTalentsAtLevel->NumTalentsDemonHunter; + default: + return numTalentsAtLevel->NumTalents; + } + } + + return 0; +} + PVPDifficultyEntry const* DB2Manager::GetBattlegroundBracketByLevel(uint32 mapid, uint32 level) { PVPDifficultyEntry const* maxEntry = nullptr; // used for level > max listed level case @@ -2152,6 +2178,16 @@ uint32 DB2Manager::GetRequiredLevelForPvpTalentSlot(uint8 slot, Classes class_) return 0; } +int32 DB2Manager::GetPvpTalentNumSlotsAtLevel(uint32 level, Classes class_) const +{ + int32 slots = 0; + for (uint8 slot = 0; slot < MAX_PVP_TALENT_SLOTS; ++slot) + if (level >= GetRequiredLevelForPvpTalentSlot(slot, class_)) + ++slots; + + return slots; +} + std::vector<QuestPackageItemEntry const*> const* DB2Manager::GetQuestPackageItems(uint32 questPackageID) const { auto itr = _questPackages.find(questPackageID); diff --git a/src/server/game/DataStores/DB2Stores.h b/src/server/game/DataStores/DB2Stores.h index 46a0dee2095..06f8635c908 100644 --- a/src/server/game/DataStores/DB2Stores.h +++ b/src/server/game/DataStores/DB2Stores.h @@ -35,6 +35,7 @@ class DB2HotfixGeneratorBase; TC_GAME_API extern DB2Storage<AchievementEntry> sAchievementStore; +TC_GAME_API extern DB2Storage<AnimationDataEntry> sAnimationDataStore; TC_GAME_API extern DB2Storage<AnimKitEntry> sAnimKitStore; TC_GAME_API extern DB2Storage<AreaTableEntry> sAreaTableStore; TC_GAME_API extern DB2Storage<AreaTriggerEntry> sAreaTriggerStore; @@ -301,12 +302,13 @@ public: MapDifficultyEntry const* GetDefaultMapDifficulty(uint32 mapId, Difficulty* difficulty = nullptr) const; MapDifficultyEntry const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty) const; MapDifficultyEntry const* GetDownscaledMapDifficultyData(uint32 mapId, Difficulty &difficulty) const; - std::string GetNameGenEntry(uint8 race, uint8 gender) const; MountEntry const* GetMount(uint32 spellId) const; MountEntry const* GetMountById(uint32 id) const; MountTypeXCapabilitySet const* GetMountCapabilities(uint32 mountType) const; MountXDisplayContainer const* GetMountDisplays(uint32 mountId) const; + std::string GetNameGenEntry(uint8 race, uint8 gender) const; ResponseCodes ValidateName(std::wstring const& name, LocaleConstant locale) const; + static int32 GetNumTalentsAtLevel(uint32 level, Classes playerClass); std::vector<uint32> const* GetPhasesForGroup(uint32 group) const; PowerTypeEntry const* GetPowerTypeEntry(Powers power) const; PowerTypeEntry const* GetPowerTypeByName(std::string const& name) const; @@ -314,6 +316,7 @@ public: static PVPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 level); static PVPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundBracketId id); uint32 GetRequiredLevelForPvpTalentSlot(uint8 slot, Classes class_) const; + int32 GetPvpTalentNumSlotsAtLevel(uint32 level, Classes class_) const; std::vector<QuestPackageItemEntry const*> const* GetQuestPackageItems(uint32 questPackageID) const; std::vector<QuestPackageItemEntry const*> const* GetQuestPackageItemsFallback(uint32 questPackageID) const; uint32 GetQuestUniqueBitFlag(uint32 questId); diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h index fa8aa435673..0c38d0fb213 100644 --- a/src/server/game/DataStores/DB2Structure.h +++ b/src/server/game/DataStores/DB2Structure.h @@ -45,6 +45,15 @@ struct AchievementEntry int16 SharesCriteria; // referenced achievement (counting of all completed criterias) }; +struct AnimationDataEntry +{ + uint32 ID; + uint16 Fallback; + uint8 BehaviorTier; + int32 BehaviorID; + int32 Flags[2]; +}; + struct AnimKitEntry { uint32 ID; @@ -2052,6 +2061,14 @@ struct NamesReservedLocaleEntry uint8 LocaleMask; }; +struct NumTalentsAtLevelEntry +{ + uint32 ID; + int32 NumTalents; + int32 NumTalentsDeathKnight; + int32 NumTalentsDemonHunter; +}; + #define MAX_OVERRIDE_SPELL 10 struct OverrideSpellDataEntry |
