contract DragonMinting is DragonAuction {

    /// @dev we can create promo dragons, up to a limit. Only callable by CMO
    /// @param _dna the encoded genes of the dragons to be created, any value is accepted
    /// @param _owner the future owner of the created dragons. Default to contract CMO
    function createPromoDragon(
        uint256 _dna,
        uint64 _agility,
        uint64 _strength,
        uint64 _intelligence,
        uint64 _runelevel,
        address _owner)
        external onlyCLevel {

        address dragonOwner = _owner;
        if (dragonOwner == address(0)) {
            dragonOwner = cmoAddress;
        }

        _createDragon(0, 0, 0, _dna, _agility, _strength, _intelligence, _runelevel, dragonOwner);
    }

    /// @dev Creates a new gen0 dragon with the given dna and
    ///  creates an auction for it.
    function createGen0Auction(
        uint256 _dna,
        uint256 _startingPrice,
        uint256 _endingPrice,
        uint64 _agility,
        uint64 _strength,
        uint64 _intelligence,
        uint256 _duration )
        external onlyCLevel {

        //require(gen0CreatedCount < GEN0_CREATION_LIMIT);


        uint256 dragonId = _createDragon(0, 0, 0, _dna, _agility, _strength, _intelligence, 0, address(this));
        _approve(dragonId, address(saleAuction));

        saleAuction.createAuction(
            dragonId,
            _startingPrice,
            _endingPrice,
            _duration,
            address(uint160(address(this)))
        );

        //gen0CreatedCount++;
    }
}
/// @title all functions related to creating dragons
function createGen0Auction(
    uint256 _dna,
    uint256 _startingPrice,
    uint256 _endingPrice,
    uint64 _agility,
    uint64 _strength,
    uint64 _intelligence,
    uint256 _duration )
    external onlyCLevel {

    //require(gen0CreatedCount < GEN0_CREATION_LIMIT);


    uint256 dragonId = _createDragon(0, 0, 0, _dna, _agility, _strength, _intelligence, 0, address(this));
    _approve(dragonId, address(saleAuction));

    saleAuction.createAuction(
        dragonId,
        _startingPrice,
        _endingPrice,
        _duration,
        address(uint160(address(this)))
    );

    //gen0CreatedCount++;
}

/// @dev Creates a new gen0 dragon with the given dna and
///  creates an auction for it.