AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
StatSystem.cpp File Reference
#include "Config.h"
#include "Creature.h"
#include "Pet.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "SharedDefines.h"
#include "SpellAuraEffects.h"
#include "SpellMgr.h"
#include "Unit.h"

Go to the source code of this file.

Functions

bool _ModifyUInt32 (bool apply, uint32 &baseValue, int32 &amount)
 

Variables

const float m_diminishing_k [MAX_CLASSES]
 

Function Documentation

◆ _ModifyUInt32()

bool _ModifyUInt32 ( bool  apply,
uint32 baseValue,
int32 amount 
)
inline
29{
30 // If amount is negative, change sign and value of apply.
31 if (amount < 0)
32 {
33 apply = !apply;
34 amount = -amount;
35 }
36 if (apply)
37 baseValue += amount;
38 else
39 {
40 // Make sure we do not get uint32 overflow.
41 if (amount > int32(baseValue))
42 amount = baseValue;
43 baseValue -= amount;
44 }
45 return apply;
46}
std::int32_t int32
Definition: Define.h:104
void apply(T *val)
Definition: ByteConverter.h:40

Referenced by Player::ApplyFeralAPBonus(), Player::ApplyHealthRegenBonus(), Player::ApplyManaRegenBonus(), and Player::ApplySpellPowerBonus().

Variable Documentation

◆ m_diminishing_k

const float m_diminishing_k[MAX_CLASSES]
Initial value:
=
{
0.9560f,
0.9560f,
0.9880f,
0.9880f,
0.9830f,
0.9560f,
0.9880f,
0.9830f,
0.9830f,
0.0f,
0.9720f
}

Referenced by Player::GetMissPercentageFromDefence(), Player::UpdateDodgePercentage(), and Player::UpdateParryPercentage().