This will be a two part approach. You will first need to get the calculation in place and working first. In the calculation you can specify hard coded values and colums. Rather than making reference to the cart values for this you would use the column names in square brackets. Also, you are setting the calculation for the column, not setting a discount amount. So what you have that looks like this:
$this->Bookdiscounttenpercent = abs($this->Quantity >= 10 && $this->Quantity < 30 && $this->ItemType == 2) *( $this->TotalPrice * .10);
Will need to look more like this:
abs([Quantity] >= 10 && [Quantity] < 30 && [ItemType] == 2) *( [TotalPrice] * .10);
So if you called this calculation column discountAmount it would hold the result of this calculation. The abs function is a php function that returns 0 if the expression inside is false, and 1 if it is true. So when this code is evaluated if the item has a quantity of more than 10 and less than 30 and the item type is 2 this part of the abs function will return 1. You are then multiplying 1 by the next part, which is the discount amount. So when an item meets this condition it will have 10% of the total price for the item held in this column.
You will then need to have a discount rule that just checks if there are items in the cart and if there is discount based on the subtotal of this new discountAmount calculated column.