SpellChanting.cs (Cast Spells by Mantra) /************ SpellChanting.cs ************* * * (C) 2008, Lokai * * Description: Speech Handler that will * detect if you have a particular * spell based on the mantra that * you speak, and will cast it. * *******************************************/ Spell Chanting (- or - "Say it, don't 'splay it!") Created by request (sort of.) This was tested on Admin and player characters. No mods needed. If it matches the mantra for a spell you possess, what you say will not be displayed as normal speech, but instead you will cast that spell. NEW ZIP FILE POSTED: This version of SpellChanting includes support for disabling casting of spells using the spell book. If you want to make it so users must use Scrolls, Wands or "Chant the Mantra" to cast, make the following change to Spell.cs: In the Cast() method, add the following line at the top: Code: if (!string.IsNullOrEmpty(Mantra) && !m_Spoken && !(m_Scroll is SpellScroll) && !(m_Scroll is BaseWand)) return false;This is what it will look like in the method: Code: public bool Cast() { if (!string.IsNullOrEmpty(Mantra) && !m_Spoken && !(m_Scroll is SpellScroll) && !(m_Scroll is BaseWand)) return false; m_StartCastTime = DateTime.Now; ...snip... Before the Cast() method, add the following new variable and method: Code: #region Added for SpellChanting private bool m_Spoken = false; public bool Cast(bool spoken) { m_Spoken = spoken; return Cast(); } #endregion Attached Files: