aerys targaryen must have thought that his gods had answered his prayers when lord tywin lannister appeared before the gates of king 's landing with an army twelve thousand strong , professing loyalty .