Performs all of the ancillary activities associated with the given character casting the given spell: it removes mana / imbued spells / memorized spells, stops any ongoing singing if needed, performs the "utter", and lags the caster for the correct amount of time for the particular spell. This is useful if you are intercepting a spell but want it to look like the character has actually cast it. Note that this doesn't check whether the character can actually cast the spell (for that you should use can_cast), nor does it fire off the spell - it just does what was listed above.
The spell is given in the second argument exactly as if you were casting the spell in the game, i.e. 'tenebrous claw'; if the second argument is an integer, then it's the spell number.
Examples:Say that you wanted to intercept a 'detect disease' spell and respond that the target had an astral parasite:
#------------------------------------------------------------------------- # This is the code on the astral parasite mob that allows 'detect disease' # to detect whether someone has the parasite #------------------------------------------------------------------------- setproc astral-parasite 0 on_cast # # Check for people casting 'detect disease' on this astral parasite's # victim - notice that the quotes have to be included in the comparisons # with the first and second arguments %s[1] and %s[2] # if(%s[1]='~`detect' AND %s[2]=disease~`' AND name(char_in_room(%a,%s[3]))= get_attr('victim') AND can_cast(%a,'detect disease'),( # # Someone has cast 'detect disease' on the astral parasite's victim # fake_cast(%a,'detect disease'), if(name(%a)=get_attr('victim'), ( msg_character(%a,'You appear to have an astral parasite - ick!') ),( msg_character(%a,'$N appears to have an astral parasite - ick!', char_in_room(%a,%s[3])) ) ), # # Returning true means the game will not handle this cast action # return(true) ) ), # # This is not the casting you're looking for. Move along. # return(false)