contract Priced is Ownable {
    uint256 private price       = 500000000000000000;  // Basic price in wei
    uint16  private zMax        = 1600;                // Max z for get price percent
    uint256 private zPrice      = 25000000000000000;   // Price for each item in z index (in wei)
    uint8   private commission  = 10;                  // Update commission in percent

    function setPriceData(uint256 _price, uint16 _zMax, uint256 _zPrice, uint8 _commission) external onlyOwner {
        price       = _price;
        zMax        = _zMax;
        zPrice      = _zPrice;
        commission  = _commission;
    }

    function getCreatePrice(uint16 z, uint256 zCount) internal view returns(uint256) {
        return ((price * uint256(Math.divide(int256(z), int256(zMax), 4))) / 10000) + (zPrice * zCount);
    }

    function getCommission(uint256 starPrice) internal view returns(uint256) {
        return Math.percent(starPrice, commission);
    }
}
/***********************************************
 ***************
 * Priced contract
 ***************
 **********************************************/
function setPriceData(uint256 _price, uint16 _zMax, uint256 _zPrice, uint8 _commission) external onlyOwner {
    price       = _price;
    zMax        = _zMax;
    zPrice      = _zPrice;
    commission  = _commission;
}

// Update commission in percent