This is the first in a series of lessons to teach you how to be invincible. Dying is bad. Back in Geb, they called those who could survive "The Quick" because we understood every possible trick. It doesn't matter how good your defenses are if you allow your enemy to defeat you with cheap tactics. Darkness, ranged attacks from the air, and more I will teach you to overcome.
But for your first lesson, I'm going to tell you about invisible opponents. They're pretty annoying, especially for me. If you aren't either a sneaky rogue or a raging barbarian, invisible enemies can strike you easily, and even if you are, you might have trouble locating them and landing your blows. The situation is worst for targeted magic-users, who can't even use such attacks at all.
So how do you fight against an enemy like that? If you're a druid or good at tricking items to work for you, an excellent and inexpensive solution is a Wand of faerie fire for 2 prestige (or scrolls for 25 gold each). These will hit a 5-foot radius and reveal invisible creatures for more than long enough to kill them, with the added bonus of making their stealthing more difficult. Faerie fire's big sister is glitterdust, which effects a radius twice as large (great for multiple enemies or if you can't quite pinpoint their location), and it is available for most any arcane caster. Scrolls with 5 copies are 2 prestige (or you can go truly crazy and buy a wand for 4500), but glitterdust has an added effect of blinding the targets (turning the tables on them as far as who can see whom!) which means that casting it yourself is preferable if possible--expendables just don't pack the same punch.
If you're a diviner or just otherwise paranoid about invisible monsters getting the drop on you, see invisibility can't be beat. It lasts for probably an entire dungeon (and if you're a diviner, what else were you going to use that slot to do?), and at the very least will tell you where to aim your
glitterdust, while preventing an ambush. This lovely spell isn't available in potions, as it is unfortunately personal only, so if you can't cast it yourself, you'll need to trick a scroll or wand to accept you as the caster (again you can get a scroll of 5 uses for 2 prestige).
For all our friends from the Order of the Kyra and the other clerics out there, invisibility purge quickly removes invisibility in a huge radius for a reasonable duration, which is like a see invisibility for the whole party. Just make sure you don't have any ninjas or other lovers of invisibility among your allies, as the spell doesn't discriminate between friend and foe!
If you're absolutely paranoid that you're facing the threat of invisible enemies who are immune to divinations (like from a mind blank spell), then the first thing you should do is just run away from such a foe and return to the Lodge. But if you must fight, you can give yourself back the advantage by using spells like elemental body or echolocation to gain tremorsense or blindsight. You can even summon creatures with better visual capabilities to find the enemies for you (or bring one along to begin with). Against even the stealthiest invisible creature, even the humble dog can eventually locate it via scent by sweeping the room until it comes within 5 feet.
If you don't have access to magic, there's still a few tricks you can use to even the odds. Even a simple powder, costing merely a single copper, can outline an invisible creature to allow you to locate it, and you can spread it on the floor and look for footprints. Remember that invisible creatures also make non-creatures touching them invisible too (otherwise they'd have to strip naked!), so this will only work for a split second. It still could make all the difference. If you have some combat training available, you could consider training in the art of Blind-Fighting. This will allow you to keep your defenses up against melee attacks from unseen opponents while also drastically decreasing your chance of missing when you attack the right general vicinity. This will also help you against tactics such as darkness, which I'll discuss later. Finally, the true equalizer in the case of invisibility is grappling. Once you've grappled an opponent, you know right where they are, so they no longer receive any of those pesky miss chances.
If all else fails, pay attention to where the enemy is when it attacks and especially whether you know for sure that it moved or took a step beforehand to locate its position; it's possible that there's only a few places it could be!
If even that fails and you simply can't land attacks against the invisible opposition, you should retreat. Either the enemy will chase you, and you can try to engage in a location better suited for such a battle, or they'll allow your egress and you can regroup and possibly buy items to assist with fighting invisible enemies or prepare new spells.