diff options
| author | krz <none@none> | 2009-05-25 23:35:09 +0200 | 
|---|---|---|
| committer | krz <none@none> | 2009-05-25 23:35:09 +0200 | 
| commit | 01f178a1db0bf42b58bb4fefcafa020ce71e5f74 (patch) | |
| tree | c0ddf5dd668439a736c50c1a337b307787941f1e /src/game/SpellAuras.cpp | |
| parent | dd9939942413318c773ad126492e7731fe17a7b7 (diff) | |
Fix for 4s rule while drinking in arena.
--HG--
branch : trunk
Diffstat (limited to 'src/game/SpellAuras.cpp')
| -rw-r--r-- | src/game/SpellAuras.cpp | 36 | 
1 files changed, 15 insertions, 21 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 6dd2930b1bd..dc8616e2fa7 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -5917,13 +5917,14 @@ void Aura::PeriodicDummyTick()                  if ((*i)->GetId() == GetId())                  {                      BattleGround *bg = ((Player*)m_target)->GetBattleGround(); -                    // Get tick number -                    int32 tick = (m_maxduration - m_duration) / m_modifier.periodictime; -                    // Default case (not on arenas) -                    if (tick == 0 ) +                    if(!bg || !bg->isArena())                      { -                        (*i)->GetModifier()->m_amount = m_modifier.m_amount; -                         +                        // default case - not in arena +                        m_isPeriodic = false; +                        if(m_tickNumber == 1) +                            (*i)->GetModifier()->m_amount = m_modifier.m_amount; +                        ((Player*)m_target)->UpdateManaRegen(); +                        return;                      }                      //**********************************************                      // This feature uses only in arenas @@ -5932,26 +5933,19 @@ void Aura::PeriodicDummyTick()                      // on 0 tick -   0  (handled in 2 second)                      // on 1 tick - 166% (handled in 4 second)                      // on 2 tick - 133% (handled in 6 second) -                    // Not need update after 3 tick -                     -                    if(!bg || !bg->isArena()) -                    { -                      m_isPeriodic = false; -                      ((Player*)m_target)->UpdateManaRegen(); -                      return; -                    } -                    if (tick > 3) +                    // Not need update after 4 tick +                    if (m_tickNumber > 4)                          return; -                    // Apply bonus for 0 - 3 tick -                    switch (tick) +                    // Apply bonus for 1 - 4 tick +                    switch (m_tickNumber)                      { -                        case 0:   // 0% -                            (*i)->GetModifier()->m_amount = m_modifier.m_amount = 0; +                        case 1:   // 0% +                            (*i)->GetModifier()->m_amount = 0;                              break; -                        case 1:   // 166% +                        case 2:   // 166%                              (*i)->GetModifier()->m_amount = m_modifier.m_amount * 5 / 3;                              break; -                        case 2:   // 133% +                        case 3:   // 133%                              (*i)->GetModifier()->m_amount = m_modifier.m_amount * 4 / 3;                              break;                          default:  // 100% - normal regen  | 
