Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING))
- {
- if (roll_chance_i(3) && _restTime > 0) // freeze update
- {
- time_t currTime = GameTime::GetGameTime();
- time_t timeDiff = currTime - _restTime;
- if (timeDiff >= 10) // freeze update
- {
- _restTime = currTime;
- float bubble;
- if (HasSpell(90168)) // If has Inner Peace give double rest exp.
- {
- bubble = 0.125f * sWorld->getRate(RATE_REST_INGAME) * 2;
- }
- else
- {
- bubble = 0.125f * sWorld->getRate(RATE_REST_INGAME);
- }
- float extraPerSec = ((float)GetUInt32Value(PLAYER_NEXT_LEVEL_XP) / 72000.0f) * bubble;
- // speed collect rest bonus (section/in hour)
- float currRestBonus = GetRestBonus();
- SetRestBonus(currRestBonus + timeDiff * extraPerSec);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement