Magic Mouth(Player's Handbook v.3.5, p. 251)
Level: Bard 1, Emissary of Barachiel 1, Vigilante 1, Wizard 2, Sha'ir 2, Sorcerer 2, Magewright 2, Spellthief 2, Court Herald 2, Merchant Prince 3,
Components: V, S, M,
Casting Time: 1 standard action
Range: Close (25 ft. + 5 ft./2 levels)
Target: One creature or object
Duration: Permanent until discharged
Saving Throw: Will negates (object)
Spell Resistance: Yes (object)
This spell imbues the chosen object or creature with an enchanted mouth that suddenly appears and speaks its message the next time a specified event occurs. The message, which must be twenty-five or fewer words long, can be in any language known by you and can be delivered over a period of 10 minutes. The mouth cannot utter verbal components, use command words, or activate magical effects. It does, however, move according to the words articulated; if it were placed upon a statue, the mouth of the statue would move and appear to speak. Of course, magic mouth can be placed upon a tree, rock, or any other object or creature.
The spell functions when specific conditions are fulfilled according to your command as set in the spell. Commands can be as general or as detailed as desired, although only visual and audible triggers can be used, such as the following: "Speak only when a venerable female human carrying a sack sits cross-legged within a distance of one foot". Triggers react to what appears to be the case. Disguises and illusions can fool them. Normal darkness does not defeat a visual trigger, but magical darkness or invisibility does. Silent movement or magical silence defeats audible triggers. Audible triggers can be keyed to general types of noises (footsteps, metal clanking) or to a specific noise or spoken word (when a pin drops, or when anyone says "Boo"). Actions can serve as triggers if they are visible or audible. For example, "Speak when any creature touches the statue" is an acceptable command if the creature is visible. A magic mouth cannot distinguish alignment, level, Hit Dice, or class except by external garb.
The range limit of a trigger is 15 feet per caster level, so a 6th-level caster can command a magic mouth to respond to triggers as far as 90 feet away. Regardless of range, the mouth can respond only to visible or audible triggers and actions in line of sight or within hearing distance.
Magic mouth can be made permanent with a permanency spell.
Material Component: A small bit of honeycomb and jade dust worth 10 gp.