diff options
| author | Shauren <shauren.trinity@gmail.com> | 2025-01-19 18:29:38 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2025-01-19 18:29:38 +0100 |
| commit | cb4013efe67a875dc19ef3bcd5b8c142f5a131d6 (patch) | |
| tree | b00de9bbf536e78a915272fe791856087a999a9a /src/server/game | |
| parent | 453ae0ab88eb7c64cb10f35302c337ec99e272b5 (diff) | |
Core/Misc: Added float chrono typedefs
Diffstat (limited to 'src/server/game')
| -rw-r--r-- | src/server/game/Spells/Auras/SpellAuras.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 2a29366ae6d..3d7664f19b6 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -2010,15 +2010,13 @@ void Aura::TriggerProcOnEvent(uint32 procEffectMask, AuraApplication* aurApp, Pr float Aura::CalcPPMProcChance(Unit* actor) const { - using FSeconds = std::chrono::duration<float, Seconds::period>; - // Formula see http://us.battle.net/wow/en/forum/topic/8197741003#1 float ppm = m_spellInfo->CalcProcPPM(actor, GetCastItemLevel()); float averageProcInterval = 60.0f / ppm; TimePoint currentTime = GameTime::Now(); - float secondsSinceLastAttempt = std::min(std::chrono::duration_cast<FSeconds>(currentTime - m_lastProcAttemptTime).count(), 10.0f); - float secondsSinceLastProc = std::min(std::chrono::duration_cast<FSeconds>(currentTime - m_lastProcSuccessTime).count(), 1000.0f); + float secondsSinceLastAttempt = std::min(duration_cast<FloatSeconds>(currentTime - m_lastProcAttemptTime).count(), 10.0f); + float secondsSinceLastProc = std::min(duration_cast<FloatSeconds>(currentTime - m_lastProcSuccessTime).count(), 1000.0f); float chance = std::max(1.0f, 1.0f + ((secondsSinceLastProc / averageProcInterval - 1.5f) * 3.0f)) * ppm * secondsSinceLastAttempt / 60.0f; RoundToInterval(chance, 0.0f, 1.0f); |
