mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[10755] Use class specific combat rating factors from gtOCTClassCombatRatingScalarStore.dbc
* Some classes had effect of melee haste buffed * Change to armor penetration rating was hidden there too
This commit is contained in:
parent
92ed528eb9
commit
7663cf6329
7 changed files with 24 additions and 11 deletions
|
|
@ -97,6 +97,7 @@ DBCStorage <GtChanceToMeleeCritBaseEntry> sGtChanceToMeleeCritBaseStore(GtChance
|
|||
DBCStorage <GtChanceToMeleeCritEntry> sGtChanceToMeleeCritStore(GtChanceToMeleeCritfmt);
|
||||
DBCStorage <GtChanceToSpellCritBaseEntry> sGtChanceToSpellCritBaseStore(GtChanceToSpellCritBasefmt);
|
||||
DBCStorage <GtChanceToSpellCritEntry> sGtChanceToSpellCritStore(GtChanceToSpellCritfmt);
|
||||
DBCStorage <GtOCTClassCombatRatingScalarEntry> sGtOCTClassCombatRatingScalarStore(GtOCTClassCombatRatingScalarfmt);
|
||||
DBCStorage <GtOCTRegenHPEntry> sGtOCTRegenHPStore(GtOCTRegenHPfmt);
|
||||
//DBCStorage <GtOCTRegenMPEntry> sGtOCTRegenMPStore(GtOCTRegenMPfmt); -- not used currently
|
||||
DBCStorage <GtRegenHPPerSptEntry> 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");
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ extern DBCStorage <GtChanceToMeleeCritBaseEntry> sGtChanceToMeleeCritBaseStore;
|
|||
extern DBCStorage <GtChanceToMeleeCritEntry> sGtChanceToMeleeCritStore;
|
||||
extern DBCStorage <GtChanceToSpellCritBaseEntry> sGtChanceToSpellCritBaseStore;
|
||||
extern DBCStorage <GtChanceToSpellCritEntry> sGtChanceToSpellCritStore;
|
||||
extern DBCStorage <GtOCTClassCombatRatingScalarEntry> sGtOCTClassCombatRatingScalarStore;
|
||||
extern DBCStorage <GtOCTRegenHPEntry> sGtOCTRegenHPStore;
|
||||
//extern DBCStorage <GtOCTRegenMPEntry> sGtOCTRegenMPStore; -- not used currently
|
||||
extern DBCStorage <GtRegenHPPerSptEntry> sGtRegenHPPerSptStore;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10754"
|
||||
#define REVISION_NR "10755"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue