For example, could you have the player get hit by a small amount of damage every time they attack a certain monster within sight range? Or have a (de)buff automatically applied to a monster after its health drops? I'm just browsing the mod wiki and brainstorming some ideas at the moment.
Yes, they can have effects like that. Of course, some effects triggering all the time would make players want to strangle you with a piano wire (especially if it was damaging you on being hit and there was nothing to indicate that in the monsters' descriptions), but you can do whatever you want there. Here you can find some resources relating to modding in general, and I think there is a page about procs: http://dredmod.com/wiki/Main_Page
So, uh. I'm trying to figure out how to have a particular monster cause a 1-attack-lasting debuff each time the player hits it. I can see how to trigger the spell if the monster hits the player, or a way to tie the desired effect to a given skill, but not how to just have it happen normally. Help?
Urgh. Is there at least a way for a monster's <onDeath> spell to target the player? So far all I can get it to do is debuff it's own corpse regardless of ai hints or type="whatever"s.
Update on my frustrations: Using a template hasn't been very helpful so far, since it directly targets *floor* tiles rather than monsters/players/stuff standing there which as far as I can tell means that any taxa restrictions are completely ignored. Once the spell triggers reach the actual effects then they do apply to the player but also debuff any nearby monsters (and show the animations literally everywhere visible). I tried to use an area spell type but that CTD the game dunno why. Having the onDeath spell use a template which then triggers a targetmonster type spell almost works in that it appears to hit specific entities rather than just the floor and thus respect taxa ... but targetmonster doesn't hit the player, only monsters! Using type="self" would seem the obvious solution, but no, that just redirects every single tile of the template spell back to the dead monster and leaves it with the debuff dozens of times over. >_<
HA HA HA HA HA. Glorious victory! By adding amount="1" to the template-type's spell trigger, it apparently stores the effect on the player/monsters until the end of the turn and then triggers the spell from them, correctly checking for taxa and the like. This isn't a perfect solution since the player won't be debuffed for that turn's monster attacks (I think), but it's close enough.