func: function LevelUp(uint256 _tokenId,uint32 _level) external payable {
      require(msg.sender == captainTokenIdToOwner[_tokenId]);
      Captain storage captain = captains[_tokenId];
      uint32 captainId = captain.captainId;
      uint32 level = captain.level;
      uint256 cur_exp = SafeMath.mul(SafeMath.mul(level,SafeMath.sub(level,1)),25); 
      uint256 req_exp = SafeMath.mul(SafeMath.mul(_level,SafeMath.sub(_level,1)),25);
      require(captain.exp>=SafeMath.sub(req_exp,cur_exp));
      uint256 exp = SafeMath.sub(captain.exp,SafeMath.sub(req_exp,cur_exp));
      if (SafeMath.add32(level,_level)>=99) {
        captains[_tokenId].level = 99;
      } else {
        captains[_tokenId].level = _level;
      }
  
      (captains[_tokenId].atk,captains[_tokenId].defense,,) = config.getLevelConfig(captainId,captains[_tokenId].level);
      captains[_tokenId].exp = exp;
      
      LevelUP(msg.sender,level,captain.level);
    }