Nightmare mudlib lfun: catch_tell()
void catch_tell(string str);
Any string told to a living object gets passed through first to any
catch_tell() function in the living object. If no such function exists,
then nothing happens. If such a function exists, then whatever is defined
in catch_tell() by the creator happens.
*****
example:
This code might appear in any monster:
void catch_tell(string str) {
string who;
if(!sscanf(str, "%s smiles %*s", who) return;
if(!present(lower_case(who))) return;
tell_room(environment(this_object()), "Monster smiles at "+who+".\n",
({ this_object(), present(lower_case(who)) }) );
tell_object(present(lower_case(who)), "Monster smiles at you.\n");
}