Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. void Player::addManaSpent(uint64_t spent)
  2. {
  3. if(spent == 0)
  4. return;
  5. if(this->maglevel+1 == 201 && this->vocation == VOCATION_SORCERER)
  6. return;
  7. if(this->maglevel+1 == 31 && this->vocation == VOCATION_KNIGHT)
  8. return;
  9. if(this->maglevel+1 == 81 && this->vocation == VOCATION_PALADIN)
  10. return;
  11. #ifdef YUR_MULTIPLIERS
  12. spent *= g_config.MANA_MUL[vocation];
  13. #endif //YUR_MULTIPLIERS
  14.  
  15. this->manaspent += spent;
  16. //Magic Level Advance
  17. uint64_t reqMana = this->getReqMana(this->maglevel+1, this->vocation);
  18. if (this->access < g_config.ACCESS_PROTECT && this->manaspent >= reqMana)
  19. {
  20. this->manaspent -= reqMana;
  21. #ifdef __MIZIAK_CREATURESCRIPTS__
  22. int32_t tab[] = {7, this->maglevel, this->maglevel+1};
  23. actions.creatureEvent("advance", this, NULL, NULL, tab);
  24. #endif //__MIZIAK_CREATURESCRIPTS__
  25. this->maglevel++;
  26. std::stringstream MaglvMsg;
  27. MaglvMsg << "You advanced from magic level " << (this->maglevel - 1) << " to magic level " << this->maglevel << ".";
  28. this->sendTextMessage(MSG_ADVANCE, MaglvMsg.str().c_str());
  29. this->sendStats();
  30. }
  31. //End Magic Level Advance*/
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement