When Gadwick, the Wizened enters the battlefield, draw X cards.
Whenever you cast a blue spell, tap target nonland permanent an opponent controls.
If Gadwick enters the battlefield without being cast, or if it was cast for a cost other than its mana cost, the value of X for its first ability is 0.
Gadwick’s second ability resolves before the spell that caused it to trigger. It resolves even if that spell is countered.
Gadwick’s triggered ability won’t trigger when you cast it because it’s not on the battlefield yet.