Its AD&D its how encounters were designed. In AD&D you could encounter level 18+ NPCs and things like liches in the mid levels. Note even in 5E a lot of NPC spell casters do not have optimised spell lists for combat. Same thing happened in AD&D where you might have to worry about a fireball being cast by said lich at level 8 (and in 2E that fireball was 10d6, 18d6 1E).
The adventure has a lot of role playing in it, the Lich if it was in 3.5 would have been a bardic lich with the lich template. The Lich is also not really a good lich as he was not transformed willingly so even though its smart it kind of lacks some of the erm cunning of a regular lich I suppose.
Its spent 500 years waiting a prophecy as Bane/Cyric/evil BBEG type god transformed it against its will to act as a guardian. I think the PCs are 2-4 levels away from being able to handle it RAW so I am going to rewrite the encounter.
The Lich is goian to be an AD&D lich (5E quasi lich? ) so I will strip away its lair actions and/or legendary actions so it will be a level 18 spellcaster with perhaps its spells drawn from the Bard list to better match up the fluff from the adventure.
So this lich is going to be a lot weaker than a normal lich probably CR 13 or 14.
I still think the CR 21 lich is more like CR 15 or 16 than 21.
My PCs are also over equipped perhaps as they have a staff of striking and a +3 intelligent longsword that you can finesse that is intelligent and can cast heal or greater restoration 1/week and it can only be attuned by a good aligned PC.
Why not make it a
Mage, with some of the Lich traits?
Here is my take on a level appropriate Lich. Feel free to use it:
Minor Lich
Medium undead, LE
Armor Class: 19 (natural armor, bracers of defence)
Hit Points: 99 (15d8+30)
Speed: 30 ft
STR: 9 (-1), DEX: 16 (+3), CON: 14 (+2), INT: 18 (+4), WIS: 15 (+2), CHA: 11 (0)
Proficiency Bonus +4
Saving Throws: Int +8, Wis +6, Con +6
Skills: History +8, Arcana +12, Insight +6, Perception +6
Senses: Truesight 120', passive Perception 16
Damage Immunities: Poison
Condition Immunities: Charmed, Exhaustion, Frightened, Paralyzed, Poisoned
Damage Resistances: Cold, Lightning, Necrotic; Bludgeoning, Piercing, And Slashing From Nonmagical Weapons
Languages: any four languages
Challenge: 10
Spellcasting.The Lich is an 11th-level spellcaster. Its spellcasting ability is Intelligence (spell save DC 16, +8 to hit with spell attacks). The Lich has the following wizard spells prepared:
Cantrips (at will): fire bolt, ray of frost, mage hand, blade ward
1st level (4 slots): detect magic, magic missile, shield
2nd level (3 slots): misty step, suggestion, mirror image
3rd level (3 slots): counterspell, fireball, fly
4th level (3 slots): greater invisibility, dimension door
5th level (2 slot): wall of force, cloudkill
6th level (1 slot): disintegrate
Legendary Resistance (3/day): If the lich fails a saving throw, it can choose to succeed instead.
Turn Resistance.The lich has advantage on saving throws against any effect that turns undead.
Actions
Paralyzing Touch: Melee Spell Attack: +8 to hit, reach 5 ft., one creature. Hit: 10 (3d6) cold damage. The target must succeed on a DC 16 Constitution saving throw or be paralyzed for 1 minute. The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success.
Legendary Actions
The lich 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 lich regains spent legendary actions at the start of its turn.
Cantrip:The lich casts a cantrip.
Paralyzing Touch (Costs 2 Actions): The lich uses its Paralyzing Touch.
Frightening Gaze (Costs 2 Actions): The lich fixes its gaze on one creature it can see within 10 feet of it. The target must succeed on a DC 16 Wisdom saving throw against this magic or become Frightened for 1 minute. The Frightened target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. If a target's saving throw is successful or the effect ends for it, the target is immune to the lich's gaze for the next 24 hours.
Disrupt Life (Costs 3 Actions): Each non-undead creature within 20 feet of the lich must make a DC 16 Constitution saving throw against this magic, taking 21 (6d6) necrotic damage on a failed save, or half as much damage on a successful one.
Equipment: Bracers of defence, 4 potions of greater healing
____________________________________________________
Tactics: The Lich has several
alarm spells rigged in its dungeon lair, plus a rat familiar (whom the lich observes the party through its senses, paying particular notice of any clerics, paladins and mages) and undead minions observing the one entrance to the chamber where it is located, making surprise all but impossible.
It is unlikey the PCs distinguish the rat from any others they have seen in the dungeon.
Once alerted to the PCs it casts
mirror image a round or two prior to combat starting. On its first action it splits the party with
Wall of force. It seeks to isolate the party spellcaster (recognising them as a threat) from the rest of the party (specifically clerics and paladins). Its first legendary action it uses
blade ward (granting it resistance to all S/B/P damage till the end of its next turn). It then uses
Frightening gaze on the leading creature trapped in the wall of force.
On its second turn it uses
misty step (or
dimension door) to teleport behind the party and in a position where it can target the now isolated spellcaster. It uses
paralysing touch (being unable to cast another spell on its turn due to casting misty step as a bonus action) as its action, (repeating it if necessary as its first legendary action) and then spams repeated (3d10 damage)
firebolt or
ray of frost cantrips as its remaining legendary actions (trying to provoke an unparalysed target into using shield, thus preventing the target from using counterspell when the liches turn next comes around). It uses
counter spell itself to counter any dangerous spell directed at it from its target.
Remember if the target is paralysed, the liches attacks are automatically critical hits (6d10 damage) as its within 5' of the target.
On turn 3, the Lich hits the target with a
disintegrate spell (DC 16 Dex save negates) if the target is not paralaysed. If the target attempts to counterspell this, the lich counters this counterspell. If the target is paralysed, the lich simply continues to destroy the target with more paralysing touches, rays of frost or firebolts (remember, these are critical hits if they land) saving its more dangerous spells for other PCs (prefering to save its 6th level slot for a third wall of force). It is wary of using disintegrate unless desperate as its main goal is to loot the PCs of their magic items.
Once the target is at 0HP the lich continues to hit the target with ranged attacks untill it fails 3 death saves. As it does so it taunts the other PCs who are stranded on the rear of the wall of force who forced to watch helplessly as this happens. It then loots the dead PC corpse (make sure you laugh evilly as you do so).
On its next turn it retreats 100' away into the darkness (it is unlikely that any PCs can see it 100' away, but the lich has true sight 120') drinks its potions of healing if necessary, casts blade ward as a legendary action and then casts wall of force again (breaking its concentration on the first wall), isolating a second PC, and repeats this process.
(It backs off into the darkness, heals and protects itself with blade ward as it realises PCs with readied actions who can see the lich might anticiapte this move and attack the lich during the brief instant the first wall drops and the second one appears).
The Lich is also fond of repeatedly using its frightening gaze through the wall at helpless PCs trapped inside it.
If sorely pressed (the Lich only attacks as it wants the PCs gear, if they seriously challenge it, it leaves at once) it uses dimension door to teleport to a special isolated 'panic room' it had constructed underground 300' away (isolated by over 200' of solid rock, it was dug out of the dungeon wth the aid of ethereal creatures, who the Lich then destroyed). It is in this room that it stores its loot, its spellbook and its phylactery. The room contains several potions of greater healing and three scrolls of dimension door. It is located 400' away (through solid rock again) from an underground river that leads to the surface (allowing the Lich to dimension door out of this room and to the river - seeing as it doesnt need to breathe, the Lich then uses the river to escape to the ouside by walking along the bottom of it).
The panic room is protected by an alarm spell that is triggered if a non undead creature enters it (a difficult proposition at best). It is also lined with lead, warding it against divination magic.
After fleeing the dungon, it hires competent spies (and its familiar) to steal bits of hair or minor personal effects from the PCs (for use with scrying) and keeps tabs on the PCs. It then (via several lackies and stooges) arranges for the PCs to be hired for a supposedly easy task (engineered by the Lich) that leads them into a dungeon (designed by the Lich) full of death traps and super deadly encounters (the Lich is not present in the dungeon). Several assasins wait outside the dungeon to kill the weary PCs on thier exit.
If the Lich forms the view that a PC might be willing to betray the others, it sends agents to strike a deal with that PC for him to kill the others in exchange for a legendary magic item of the PCs choice (plus his pick of his companions gear) and a pardon from the Lich.