mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-21 15:27:47 -04:00
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/game/AuctionHouse/AuctionHouseMgr.h src/server/game/Entities/Creature/Creature.cpp src/server/game/Entities/Player/Player.cpp src/server/game/Entities/Unit/StatSystem.cpp src/server/game/Entities/Unit/Unit.cpp src/server/game/Entities/Vehicle/Vehicle.cpp src/server/game/Handlers/NPCHandler.cpp
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "World.h"
|
||||
|
||||
inline bool _ModifyUInt32(bool apply, uint32& baseValue, int32& amount)
|
||||
{
|
||||
@@ -437,6 +438,10 @@ void Player::UpdateBlockPercentage()
|
||||
value += GetTotalAuraModifier(SPELL_AURA_MOD_BLOCK_PERCENT);
|
||||
// Increase from rating
|
||||
value += GetRatingBonusValue(CR_BLOCK);
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_STATS_LIMITS_ENABLE))
|
||||
value = value > sWorld->getFloatConfig(CONFIG_STATS_LIMITS_BLOCK) ? sWorld->getFloatConfig(CONFIG_STATS_LIMITS_BLOCK) : value;
|
||||
|
||||
value = value < 0.0f ? 0.0f : value;
|
||||
}
|
||||
SetStatFloatValue(PLAYER_BLOCK_PERCENTAGE, value);
|
||||
@@ -471,6 +476,10 @@ void Player::UpdateCritPercentage(WeaponAttackType attType)
|
||||
float value = GetTotalPercentageModValue(modGroup) + GetRatingBonusValue(cr);
|
||||
// Modify crit from weapon skill and maximized defense skill of same level victim difference
|
||||
value += (int32(GetMaxSkillValueForLevel()) - int32(GetMaxSkillValueForLevel())) * 0.04f;
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_STATS_LIMITS_ENABLE))
|
||||
value = value > sWorld->getFloatConfig(CONFIG_STATS_LIMITS_CRIT) ? sWorld->getFloatConfig(CONFIG_STATS_LIMITS_CRIT) : value;
|
||||
|
||||
value = value < 0.0f ? 0.0f : value;
|
||||
SetStatFloatValue(index, value);
|
||||
}
|
||||
@@ -570,6 +579,10 @@ void Player::UpdateParryPercentage()
|
||||
nondiminishing += GetTotalAuraModifier(SPELL_AURA_MOD_PARRY_PERCENT);
|
||||
// apply diminishing formula to diminishing parry chance
|
||||
value = nondiminishing + diminishing * parry_cap[pclass] / (diminishing + parry_cap[pclass] * m_diminishing_k[pclass]);
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_STATS_LIMITS_ENABLE))
|
||||
value = value > sWorld->getFloatConfig(CONFIG_STATS_LIMITS_PARRY) ? sWorld->getFloatConfig(CONFIG_STATS_LIMITS_PARRY) : value;
|
||||
|
||||
value = value < 0.0f ? 0.0f : value;
|
||||
}
|
||||
SetStatFloatValue(PLAYER_PARRY_PERCENTAGE, value);
|
||||
@@ -602,6 +615,9 @@ void Player::UpdateDodgePercentage()
|
||||
uint32 pclass = getClass()-1;
|
||||
float value = nondiminishing + (diminishing * dodge_cap[pclass] / (diminishing + dodge_cap[pclass] * m_diminishing_k[pclass]));
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_STATS_LIMITS_ENABLE))
|
||||
value = value > sWorld->getFloatConfig(CONFIG_STATS_LIMITS_DODGE) ? sWorld->getFloatConfig(CONFIG_STATS_LIMITS_DODGE) : value;
|
||||
|
||||
value = value < 0.0f ? 0.0f : value;
|
||||
SetStatFloatValue(PLAYER_DODGE_PERCENTAGE, value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user