Immutable Form. The dragon is immune to any spell or effect that would alter its form.
Legendary Resistance (3/day). If the dragon fails a saving throw, it can choose to succeed instead.
Self Destruct. When the dragon is reduced to 0 hit points, it explodes, and each creature within 30 feet of it must make a DC 18 Dex Saving Throw, taking 21 (6d6) fire damage and 21 (6d6) piercing damage on a failed save or half as much damage on a successful one.
Multiattack. The dragon makes three attacks: one with its bite and two with its claws.
Bite. Melee Weapon Attack: +11 to hit, reach 10 ft., one target. Hit: 17 (2d10+6) piercing damage.
Claw. Melee Weapon Attack: +11 to hit, reach 5 ft., one target. Hit: 13 (2d6+6) slashing damage.
Tail. Melee Weapon Attack: +11 to hit, reach 15 ft., one target. Hit: 15 (2d8+6) bludgeoning damage.
Breath Weapons (Recharge 5-6). The dragon uses one of the following breath weapons.
Fire Tar Breath. The dragon sprays flaming tar in a 30 ft. cone. Each creature in that area must make a DC 18 Dex Saving Throw, taking 35 (10d6) fire damage on a failed save, or half as much damage on a successful one. On a failed save, a creature is restrained (escape DC 18). While restrained in this way, a creature takes 10 (3d6) fire damage at the start of each of its turns.
Knockout Gas Breath. The dragon exhales knockout gas in a 60 ft. cone. Each creature in that area must succeed in a DC18 Con. Saving Throw or fall unconscious for 10 min. This effect ends for a creature if the creature takes damage or someone uses an action to wake it.
The dragon can take 3 legendary actions, choosing from the options below. Only one legendary action option can be used at a time and only at the end of another creature's turn. The dragon regains spent legendary actions at the start of its turn.
Detect. The dragon makes a Wisdom (Perception) Check.
Tail Attack. The dragon makes a tail attack.
Wing Attack (Costs 2 Actions). The dragon beats its wings. Each creature within10 ft. of the dragon must succeed on a DC 19 Dex. Saving Throw or take 13 (2d6+6) bludgeoning damage and be knocked prone. The dragon can then fly up to half its flying speed.