In Nethack3.4.3, can an altar be wished for?
I've been playing 343 for a while, even read the wiki as best I can, but can't find an answer to this. I have an Elven Priest that has been to Sokoban (BoH) and found the quest portal but still haven't found an altar. I have 7 cursed scrolls of create monster that should help me level up for the quest, but I'd hate to waste all the potential sacrifices. I have 2 blessed magic lamps, and a bones pile has supplied SDSM, MR cloak, Macicbane, and Stormbringer. Being a priest I'd like to unrestrict at least one of the weapons...Short of running all the way to minetown, I'd like to wish for an altar near the Quest portal. Is such a thing possible or would it just waste a wish?
Solution 1:
Chasing through the source code, the function readobjnam()
in objnam.c
is responsible for translating object name into internal game structures, and determining what you can (and can't) wish for. Altars are in the "wizard-only" section of the function, along with traps, fountains, and other dungeon features:
if (wizard && from_user) {
...
if(!BSTRCMP(bp, p-5, "altar")) {
aligntyp al;
levl[u.ux][u.uy].typ = ALTAR;
if(!strncmpi(bp, "chaotic ", 8))
al = A_CHAOTIC;
else if(!strncmpi(bp, "neutral ", 8))
al = A_NEUTRAL;
else if(!strncmpi(bp, "lawful ", 7))
al = A_LAWFUL;
else if(!strncmpi(bp, "unaligned ", 10))
al = A_NONE;
else /* -1 - A_CHAOTIC, 0 - A_NEUTRAL, 1 - A_LAWFUL */
al = (!rn2(6)) ? A_NONE : rn2((int)A_LAWFUL+2) - 1;
levl[u.ux][u.uy].altarmask = Align2amask( al );
pline("%s altar.", An(align_str(al)));
newsym(u.ux, u.uy);
return(&zeroobj);
}
Solution 2:
You can only wish for items, and an altar isn't an item. Wishing for an altar won't work.