diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp index e0e7263b0..33c7cc0aa 100644 --- a/src/game/DBCStores.cpp +++ b/src/game/DBCStores.cpp @@ -97,6 +97,7 @@ DBCStorage sGtChanceToMeleeCritBaseStore(GtChance DBCStorage sGtChanceToMeleeCritStore(GtChanceToMeleeCritfmt); DBCStorage sGtChanceToSpellCritBaseStore(GtChanceToSpellCritBasefmt); DBCStorage sGtChanceToSpellCritStore(GtChanceToSpellCritfmt); +DBCStorage sGtOCTClassCombatRatingScalarStore(GtOCTClassCombatRatingScalarfmt); DBCStorage sGtOCTRegenHPStore(GtOCTRegenHPfmt); //DBCStorage sGtOCTRegenMPStore(GtOCTRegenMPfmt); -- not used currently DBCStorage sGtRegenHPPerSptStore(GtRegenHPPerSptfmt); @@ -358,7 +359,7 @@ void LoadDBCStores(const std::string& dataPath) exit(1); } - const uint32 DBCFilesCount = 88; + const uint32 DBCFilesCount = 89; barGoLink bar( (int)DBCFilesCount ); @@ -431,6 +432,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtChanceToSpellCritBaseStore, dbcPath,"gtChanceToSpellCritBase.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtChanceToSpellCritStore, dbcPath,"gtChanceToSpellCrit.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtOCTClassCombatRatingScalarStore,dbcPath,"gtOCTClassCombatRatingScalar.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtOCTRegenHPStore, dbcPath,"gtOCTRegenHP.dbc"); //LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtOCTRegenMPStore, dbcPath,"gtOCTRegenMP.dbc"); -- not used currently LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtRegenHPPerSptStore, dbcPath,"gtRegenHPPerSpt.dbc"); diff --git a/src/game/DBCStores.h b/src/game/DBCStores.h index e460ca234..8989580e8 100644 --- a/src/game/DBCStores.h +++ b/src/game/DBCStores.h @@ -108,6 +108,7 @@ extern DBCStorage sGtChanceToMeleeCritBaseStore; extern DBCStorage sGtChanceToMeleeCritStore; extern DBCStorage sGtChanceToSpellCritBaseStore; extern DBCStorage sGtChanceToSpellCritStore; +extern DBCStorage sGtOCTClassCombatRatingScalarStore; extern DBCStorage sGtOCTRegenHPStore; //extern DBCStorage sGtOCTRegenMPStore; -- not used currently extern DBCStorage sGtRegenHPPerSptStore; diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index 334265c50..22993cb3b 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -496,7 +496,7 @@ struct AchievementCriteriaEntry // 1: ByEventId(?) (serverside IDs), 2: ByQuestId, 5: ByCastSpellId(?) // 6: BySpellIdTarget(some of these are unknown spells, some not, some maybe spells) // 7: ByKillNpcId, 9: ByUseItemId - uint32 timedCriteriaMiscId; // 28 Alway appears with timed events, used internally to start the achievement, store + uint32 timedCriteriaMiscId; // 28 Alway appears with timed events, used internally to start the achievement, store uint32 timeLimit; // 29 time limit in seconds uint32 showOrder; // 30 show order, also used in achievement shift-links as index in state bitmask @@ -921,6 +921,8 @@ struct GlyphSlotEntry // All Gt* DBC store data for 100 levels, some by 100 per class/race #define GT_MAX_LEVEL 100 +// gtOCTClassCombatRatingScalar.dbc stores data for 32 ratings, look at MAX_COMBAT_RATING for real used amount +#define GT_MAX_RATING 32 struct GtBarberShopCostBaseEntry { @@ -952,6 +954,11 @@ struct GtChanceToSpellCritEntry float ratio; }; +struct GtOCTClassCombatRatingScalarEntry +{ + float ratio; +}; + struct GtOCTRegenHPEntry { float ratio; diff --git a/src/game/DBCfmt.h b/src/game/DBCfmt.h index a071e66d1..0025c20e6 100644 --- a/src/game/DBCfmt.h +++ b/src/game/DBCfmt.h @@ -56,6 +56,7 @@ const char GtChanceToMeleeCritBasefmt[]="f"; const char GtChanceToMeleeCritfmt[]="f"; const char GtChanceToSpellCritBasefmt[]="f"; const char GtChanceToSpellCritfmt[]="f"; +const char GtOCTClassCombatRatingScalarfmt[]="df"; const char GtOCTRegenHPfmt[]="f"; //const char GtOCTRegenMPfmt[]="f"; const char GtRegenHPPerSptfmt[]="f"; diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 4986a836a..2b5def1cd 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -5125,22 +5125,24 @@ float Player::GetSpellCritFromIntellect() return crit*100.0f; } -float Player::GetRatingCoefficient(CombatRating cr) const +float Player::GetRatingMultiplier(CombatRating cr) const { uint32 level = getLevel(); if (level>GT_MAX_LEVEL) level = GT_MAX_LEVEL; GtCombatRatingsEntry const *Rating = sGtCombatRatingsStore.LookupEntry(cr*GT_MAX_LEVEL+level-1); - if (Rating == NULL) + // gtOCTClassCombatRatingScalarStore.dbc starts with 1, CombatRating with zero, so cr+1 + GtOCTClassCombatRatingScalarEntry const *classRating = sGtOCTClassCombatRatingScalarStore.LookupEntry((getClass()-1)*GT_MAX_RATING+cr+1); + if (!Rating || !classRating) return 1.0f; // By default use minimum coefficient (not must be called) - return Rating->ratio; + return classRating->ratio / Rating->ratio; } float Player::GetRatingBonusValue(CombatRating cr) const { - return float(GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + cr)) / GetRatingCoefficient(cr); + return float(GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + cr)) * GetRatingMultiplier(cr); } float Player::GetExpertiseDodgeOrParryReduction(WeaponAttackType attType) const @@ -5205,20 +5207,20 @@ void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply) { case CR_HASTE_MELEE: { - float RatingChange = value / GetRatingCoefficient(cr); + float RatingChange = value * GetRatingMultiplier(cr); ApplyAttackTimePercentMod(BASE_ATTACK,RatingChange,apply); ApplyAttackTimePercentMod(OFF_ATTACK,RatingChange,apply); break; } case CR_HASTE_RANGED: { - float RatingChange = value / GetRatingCoefficient(cr); + float RatingChange = value * GetRatingMultiplier(cr); ApplyAttackTimePercentMod(RANGED_ATTACK, RatingChange, apply); break; } case CR_HASTE_SPELL: { - float RatingChange = value / GetRatingCoefficient(cr); + float RatingChange = value * GetRatingMultiplier(cr); ApplyCastTimePercentMod(RatingChange,apply); break; } diff --git a/src/game/Player.h b/src/game/Player.h index 5e17a1aed..72ec18cfd 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1873,7 +1873,7 @@ class MANGOS_DLL_SPEC Player : public Unit float GetSpellCritFromIntellect(); float OCTRegenHPPerSpirit(); float OCTRegenMPPerSpirit(); - float GetRatingCoefficient(CombatRating cr) const; + float GetRatingMultiplier(CombatRating cr) const; float GetRatingBonusValue(CombatRating cr) const; uint32 GetBaseSpellPowerBonus() { return m_baseSpellPower; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index c243dad34..16879572b 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 "10754" + #define REVISION_NR "10755" #endif // __REVISION_NR_H__