diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp index c2f36ef3f..05f0cd5f6 100644 --- a/src/game/DBCStores.cpp +++ b/src/game/DBCStores.cpp @@ -175,6 +175,7 @@ DBCStorage sTaxiPathStore(TaxiPathEntryfmt); TaxiPathNodesByPath sTaxiPathNodesByPath; static DBCStorage sTaxiPathNodeStore(TaxiPathNodeEntryfmt); +DBCStorage sTeamContributionPoints(TeamContributionPointsfmt); DBCStorage sTotemCategoryStore(TotemCategoryEntryfmt); DBCStorage sVehicleStore(VehicleEntryfmt); DBCStorage sVehicleSeatStore(VehicleSeatEntryfmt); @@ -357,7 +358,7 @@ void LoadDBCStores(const std::string& dataPath) exit(1); } - const uint32 DBCFilesCount = 87; + const uint32 DBCFilesCount = 88; barGoLink bar( (int)DBCFilesCount ); @@ -632,6 +633,7 @@ void LoadDBCStores(const std::string& dataPath) } } + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTeamContributionPoints, dbcPath,"TeamContributionPoints.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTotemCategoryStore, dbcPath,"TotemCategory.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sVehicleStore, dbcPath,"Vehicle.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sVehicleSeatStore, dbcPath,"VehicleSeat.dbc"); diff --git a/src/game/DBCStores.h b/src/game/DBCStores.h index ad07b0528..6d94f853c 100644 --- a/src/game/DBCStores.h +++ b/src/game/DBCStores.h @@ -160,6 +160,7 @@ extern TaxiMask sTaxiNodesMask; extern TaxiMask sOldContinentsNodesMask; extern TaxiPathSetBySource sTaxiPathSetBySource; extern TaxiPathNodesByPath sTaxiPathNodesByPath; +extern DBCStorage sTeamContributionPoints; extern DBCStorage sTotemCategoryStore; extern DBCStorage sVehicleStore; extern DBCStorage sVehicleSeatStore; diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index 4478f81db..223099769 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -1704,6 +1704,12 @@ struct TaxiPathNodeEntry uint32 departureEventID; // 10 m_departureEventID }; +struct TeamContributionPoints +{ + //uint32 Entry; // 0 + float Value; // 1 (???) +}; + struct TotemCategoryEntry { uint32 ID; // 0 diff --git a/src/game/DBCfmt.h b/src/game/DBCfmt.h index 3185a2a89..47225489b 100644 --- a/src/game/DBCfmt.h +++ b/src/game/DBCfmt.h @@ -103,6 +103,7 @@ const char TalentTabEntryfmt[]="nxxxxxxxxxxxxxxxxxxxiiix"; const char TaxiNodesEntryfmt[]="nifffssssssssssssssssxii"; const char TaxiPathEntryfmt[]="niii"; const char TaxiPathNodeEntryfmt[]="diiifffiiii"; +const char TeamContributionPointsfmt[]="df"; const char TotemCategoryEntryfmt[]="nxxxxxxxxxxxxxxxxxii"; const char VehicleEntryfmt[]="niffffiiiiiiiifffffffffffffffssssfifixxx"; const char VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiixxxxxxxxxxxx"; diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 1795654cf..783d6df5a 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -13696,8 +13696,8 @@ void Player::RewardQuest(Quest const *pQuest, uint32 reward, Object* questGiver, } // honor reward - if (pQuest->GetRewHonorAddition()) - RewardHonor(NULL, 0, MaNGOS::Honor::hk_honor_at_level(getLevel(), pQuest->GetRewHonorAddition())); + if (uint32 honor = pQuest->CalculateRewardHonor(getLevel())) + RewardHonor(NULL, 0, honor); // title reward if (pQuest->GetCharTitleId()) diff --git a/src/game/QuestDef.cpp b/src/game/QuestDef.cpp index ab282ceca..6e0254695 100644 --- a/src/game/QuestDef.cpp +++ b/src/game/QuestDef.cpp @@ -19,6 +19,7 @@ #include "QuestDef.h" #include "Player.h" #include "World.h" +#include "DBCStores.h" Quest::Quest(Field * questRecord) { @@ -271,3 +272,23 @@ bool Quest::IsAllowedInRaid() const return sWorld.getConfig(CONFIG_BOOL_QUEST_IGNORE_RAID); } + +uint32 Quest::CalculateRewardHonor(uint32 level) const +{ + if (level > GT_MAX_LEVEL) + level = GT_MAX_LEVEL; + + uint32 honor = 0; + + if(GetRewHonorAddition() > 0 || GetRewHonorMultiplier() > 0.0f) + { + // values stored from 0.. for 1... + TeamContributionPoints const* tc = sTeamContributionPoints.LookupEntry(level-1); + if(!tc) + return 0; + uint32 i_honor = uint32(tc->Value * GetRewHonorMultiplier() * 0.1000000014901161); + honor = i_honor + GetRewHonorAddition(); + } + + return honor; +} diff --git a/src/game/QuestDef.h b/src/game/QuestDef.h index 5eb7fef70..9a67cbbd1 100644 --- a/src/game/QuestDef.h +++ b/src/game/QuestDef.h @@ -273,6 +273,8 @@ class Quest void SetQuestActiveState(bool state) { m_isActive = state; } bool IsActive() const { return m_isActive; } + uint32 CalculateRewardHonor(uint32 level) const; + // multiple values std::string ObjectiveText[QUEST_OBJECTIVES_COUNT]; uint32 ReqItemId[QUEST_ITEM_OBJECTIVES_COUNT]; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 3cf2e8b5a..691edde66 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 "10718" + #define REVISION_NR "10719" #endif // __REVISION_NR_H__