Guest User

Untitled

a guest
Aug 1st, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. bool Player::gainExperience(double& gainExp, Creature* target)
  2. {
  3.     if(!rateExperience(gainExp, target))
  4.         return false;
  5.  
  6.     //soul regeneration
  7.     if(gainExp >= level)
  8.     {
  9.         if(Condition* condition = Condition::createCondition(
  10.             CONDITIONID_DEFAULT, CONDITION_SOUL, 4 * 60 * 1000))
  11.         {
  12.             condition->setParam(CONDITIONPARAM_SOULGAIN,
  13.                 vocation->getGainAmount(GAIN_SOUL));
  14.             condition->setParam(CONDITIONPARAM_SOULTICKS,
  15.                 (vocation->getGainTicks(GAIN_SOUL) * 1000));
  16.             addCondition(condition);
  17.         }
  18.     }
  19.  
  20.     addExperience((uint64_t)gainExp);
  21.     return true;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment