Advertisement
Kobiesan

Player::Update in player.cpp

Jan 13th, 2019
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.04 KB | None | 0 0
  1. if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING))
  2.     {
  3.         if (roll_chance_i(3) && _restTime > 0)      // freeze update
  4.         {
  5.             time_t currTime = GameTime::GetGameTime();
  6.             time_t timeDiff = currTime - _restTime;
  7.             if (timeDiff >= 10)                             // freeze update
  8.             {
  9.                 _restTime = currTime;
  10.  
  11.                 float bubble;
  12.                 if (HasSpell(90168)) // If has Inner Peace give double rest exp.
  13.                 {
  14.                     bubble = 0.125f * sWorld->getRate(RATE_REST_INGAME) * 2;
  15.                 }
  16.                 else
  17.                 {
  18.                     bubble = 0.125f * sWorld->getRate(RATE_REST_INGAME);
  19.                 }
  20.                 float extraPerSec = ((float)GetUInt32Value(PLAYER_NEXT_LEVEL_XP) / 72000.0f) * bubble;
  21.  
  22.                 // speed collect rest bonus (section/in hour)
  23.                 float currRestBonus = GetRestBonus();
  24.                 SetRestBonus(currRestBonus + timeDiff * extraPerSec);
  25.             }
  26.         }
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement