Kobiesan

Player::GetXPRestBonus in player.cpp

Jan 13th, 2019
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. uint32 Player::GetXPRestBonus(uint32 xp)
  2. {
  3.     uint32 rested_bonus = (uint32)GetRestBonus();           // xp for each rested bonus
  4.  
  5.     if (rested_bonus > xp)                                   // max rested_bonus == xp or (r+x) = 200% xp
  6.         rested_bonus = xp;
  7.  
  8.     SetRestBonus(GetRestBonus() - rested_bonus);
  9.  
  10.     TC_LOG_DEBUG("entities.player", "Player::GetXPRestBonus: Player '%s' (%s) gain %u xp (+%u Rested Bonus). Rested points=%f", GetGUID().ToString().c_str(), GetName().c_str(), xp + rested_bonus, rested_bonus, GetRestBonus());
  11.     return HasAura(aura_id) ? rested_bonus * 2 : rested_bonus;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment