The Dragon Heir by Cinda Williams Chima
Books in this trilogy: Book 1. The Warrior heir -- Book 2. The Wizard heir -- Book 3. The Dragon heir. In Book 3 Moral compasses spin out of control as a final battle storms through a town that was meant to be a refuge.