function buyAnimalsFromAnimalFactory(string animalName, string animalDesc) public payable 
    {
        require (!isContractPaused);
        require(validPurchase());
        require(msg.sender != 0x0);
    
        uint gId=0;
        
        if (msg.sender!=owner)
        {
            gId=1;
        }

    
        uint256 weiAmount = msg.value;
        
        
        uint256 tokens = weiAmount.div(weiPerAnimal);
        
        
        weiRaised = weiRaised.add(weiAmount);

    
        uniqueAnimalId++;
        
        animalObject = AnimalProperties({
            id:uniqueAnimalId,
            name:animalName,
            desc:animalDesc,
            upForSale: false,
            priceForSale:0,
            upForMating: false,
            eggPhase: false,
            priceForMating:0,
            isBornByMating:false,
            parentId1:0,
            parentId2:0,
            birthdate:now,
            costumeId:0,
            generationId:gId,
			isSpecial:false
        });
          
          
        
        token.sendToken(msg.sender, uniqueAnimalId,animalName); 
        emit AnimalsPurchased(msg.sender, owner, weiAmount, tokens);
        
        
        animalAgainstId[uniqueAnimalId]=animalObject;
        
        
        totalBunniesCreated++;
        
        
        owner.transfer(msg.value);
    }