What I mean is: Is it possible to make statues or spellbooks that grant individual spells, random or predetermined, when activated? Has anyone here experimented with this at all?
No, it's not possible. Er -- it's not possible to give a random skill to a character, but it is possible for a statue to be scripted to trigger a random spell from a list of spells; Or a spell could be scripted to trigger another spell randomly from a list. (Funny story, in the original alphas of Dredmor you learned spells by finding spellbooks which would grant a % chance to learn a spell from a school. It was weird.)
Make an item which triggers two effects. The first one will cast a spell depending on which buff is on you. The second one will cycle through the few buffs which control the above, but only if the control buff is not up, and put the control buff up if it's not there. Otherwise (if the control buff is also up) it just renews the spell-controlling buff you have. The spell-controlling buffs would have unlimited duration and be good for two attacks, and the control buff would be removable so that the player would be able to choose whether to keep the spell or cycle it. Then it depends on whether the item is equippable or usable; if it's the former you need to decide on the trigger, and if it's the latter you need to decide whether the item will give itself back in some form or if you need to find/make a new spell book every time you want to cast a spell. And yes, I experimented with that, for something which I am still working on ... .
This would actually be a neat feature. You could use an infinite use wand, but does that respect mana requirements and scaling?
Mana requirements are the same for every sub-spell (one scalable value for skills; none for items); more can be achieved through use of drain effect albeit with a caveat that this one just decreases your current mana and doesn't care if it causes your mana to go below 0. Thus, you could make something which gave you a few spells with varied mana costs, but if it was an item it would flat-out ignore situations where you don't have any mana and just cast the spell anyway. That is, unless you went a bit further and made it so that the buffs which control which spell is cast (of which you will only have one at a time) drains mana from you every turn (the same way Syzygy and other spells of this sort do) but gives you that one point of mana back every turn; that way you would only be able to get any spell out of it if your mana was above 0. It still leaves you with something which works any time your mana is above 0, even if it is supposed to cost more, e.g. 10 mana. One can make it so that it is guaranteed to remove the points you didn't have when casting it at some point later, but that would only complicate it so unless it's absolutely necessary to have it work perfectly in that regard I think the above drawback isn't all that bad. And scaling? It's always possible to set it if there are any scalable effects, so very much yes. The stuff I am still (slowly, but still ... ) working on scales to mana capacity and it doesn't appear to be malfunctioning in that regard.
Hrmm, Kazeto, can you confirm that a buff that costs 1 mana per turn with a duration of 0 will last 0 turns if you're on 0 mana? Or have I misinterpreted what you said?
I assume that by “duration of 0” you mean that it is not limited by the timer at all—in which case it would only stop working if you don't have enough mana—and that it will take 1 mana per turn and not 1 mana every 0 turns (let us not violate the code any more than necessary, shall we). In which case it would be up for exactly 0 turns (or 1 turn if you count the starting turn as first instead of zeroth) because you have no mana and that's the only thing which limits it. Albeit that is merely a part of what I said, so I have a tingling feeling that you might still be misinterpreting something. Oh well, try on your own and see if you can get something out of it, and if it happens that the answer is “no” we will try again with the mess of an explanation I created.