function confirmQuest(address _addr) public disableContract
    {
        _addr = msg.sender;
        bool _isFinish;
        (_isFinish, ,) = checkQuest(_addr);
        require(_isFinish == true);
        require(playersQuests[_addr].haveQuest  == true);

        if (games[round].endTime <= now) endRound();
        
        updateReward(_addr);

        Player storage p      = players[_addr];
        Game storage g        = games[round];
        PlayerQuest storage pQ = playersQuests[_addr];

        uint256 _share = pQ.deposit;
        uint256 rate = 0;
        
        
        if (pQ.questId == 2) rate = 50 + randomNumber(_addr, 0, 51);
        if (pQ.questId == 0 && pQ.level == 4) rate = 50 + randomNumber(_addr, 0, 51); 
        if (pQ.questId == 1 && pQ.level == 4) rate = 50 + randomNumber(_addr, 0, 51);
        if (pQ.questId == 5 && pQ.level == 4) rate = 50 + randomNumber(_addr, 0, 51);
        
        if (pQ.questId == 0 && pQ.level == 3) rate = 25 + randomNumber(_addr, 0, 51); 
        if (pQ.questId == 1 && pQ.level == 3) rate = 25 + randomNumber(_addr, 0, 51);
        if (pQ.questId == 5 && pQ.level == 3) rate = 25 + randomNumber(_addr, 0, 51);
        
        if (pQ.questId == 0 && pQ.level == 2) rate = 10 + randomNumber(_addr, 0, 41); 
        if (pQ.questId == 1 && pQ.level == 2) rate = 10 + randomNumber(_addr, 0, 41);
        if (pQ.questId == 5 && pQ.level == 2) rate = 10 + randomNumber(_addr, 0, 41);
        if (pQ.questId == 3) rate = 10 + randomNumber(_addr, 0, 51);
        
        if (pQ.questId == 0 && pQ.level == 1) rate = randomNumber(_addr, 0, 26); 
        if (pQ.questId == 1 && pQ.level == 1) rate = randomNumber(_addr, 0, 26);
        if (pQ.questId == 5 && pQ.level == 1) rate = randomNumber(_addr, 0, 26);
        if (pQ.questId == 4) rate = randomNumber(_addr, 0, 26);

        if (rate > 0) _share += SafeMath.div(SafeMath.mul(_share, rate), 100);

        g.crystals = SafeMath.add(g.crystals, _share);
        
        if (p.currentRound == round) {
            p.share = SafeMath.add(p.share, _share);
        } else {
            p.share = _share;
            p.currentRound = round;
        }

        p.questSequence += 1; 
        p.totalQuestFinish += 1; 
        pQ.haveQuest = false;

        emit ConfirmQuest(_addr, pQ.questId, pQ.level, pQ.deposit, SafeMath.sub(_share, pQ.deposit), rate);

        pQ.deposit = 0; 
    }