/*
 * Ok this bit of code is mostly for you RPers out there.
 * Basicly, every player has a voice type, and when they
 * talk it goes like..
 * Thri says in a demanding voice, "Give me that sword!"
 * Modifications needed to do_say, something like
 *
 * if (ch->pl_voice != 0)
   {
        say_char_voice(ch, argument);
        return;
   }
 * and some way to either A) Set your voice depending on your mood.
 * or B) Setup your voice during creation.
 * code also checks for mprog say triggers, so if you dont have
 * mprogs, well, you can just remove that part of the code =)
 *
 * Orginal idea by KaVir from his Lost City mud.
 * Code by Thri (Cyhawk)
 *
 * No credit is truely nessecary, but if you need to credit
 * someone, credit KaVir.
 *
 * - Thri
 * (Cyhawk)
 * cyhawkx@sbcglobal.net
 * AIM: CalibanL
 */
 
/* This snip uses the Modified BSD licence.
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 * 
 *    1. Redistributions of source code must retain the above copyright notice, this
 *         list of conditions and the following disclaimer.
 *    2. Redistributions in binary form must reproduce the above copyright
 *         notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
 *    3. The name of the author may not be used to endorse or promote products
 *         derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 * THE POSSIBILITY OF SUCH DAMAGE.
*/
 

#define VOICE_NORMAL            1
#define VOICE_SQUEEKY           2
#define VOICE_RASPY             3
#define VOICE_LOW_TONE          4
#define VOICE_HIGH_PITCHED      5
#define VOICE_DEEP_VOICE        6
#define VOICE_SOFT              7
#define VOICE_BOOMING           8
#define VOICE_STRESSED          9
#define VOICE_EVIL              10
#define VOICE_SWEET             11
#define VOICE_DEMANDING         12
#define VOICE_GROWLING          13
#define VOICE_CHEER             14
#define MAX_VOICE               14

char *return_voice_type        args ((int voice_number));

void say_char_voice (CHAR_DATA * ch, char *argument)
{
        char buf1[MSL];
        char buf2[MSL];
        if (argument[0] == '\0')
        {
                send_to_char ("Say what?\n\r", ch);
                return;
        }

        sprintf(buf1, "{w$n says%s, \"$T\"{x", return_voice_type(ch->pl_voice));
        sprintf(buf2, "{wYou say%s, \"$T\"{x", return_voice_type(ch->pl_voice));

        act (buf1, ch, NULL, argument, TO_ROOM);
        act (buf2, ch, NULL, argument, TO_CHAR);

        // Trigger
        if (!IS_NPC (ch))
        {
                CHAR_DATA *mob, *mob_next;
                for (mob = ch->in_room->people; mob != NULL; mob = mob_next)
                {
                     mob_next = mob->next_in_room;
                     if (IS_NPC (mob) && HAS_TRIGGER (mob, TRIG_SPEECH)
                          && mob->position == mob->pIndexData->default_pos)
                          mp_act_trigger (argument, mob, ch, NULL, NULL, TRIG_SPEECH);
                }
        }
    return;
}

char *return_voice_type(int voice_number)
{
        switch(voice_number)
        {        default:
                  return "{x";
                break;
                case VOICE_SQUEEKY:
                  return " in a squeey voice";
                break;
                case VOICE_RASPY:
                  return " in a raspy voice";
                break;
                case VOICE_LOW_TONE:
                  return " in a low toned mannor";
                break;
                case VOICE_HIGH_PITCHED:
                  return " in a high pitched voice";
                break;
                case VOICE_DEEP_VOICE:
                  return " in a deep voice";
                break;
                case VOICE_SOFT:
                  return " softly";
                break;
                case VOICE_BOOMING:
                  return " boomingly";
                break;
                case VOICE_STRESSED:
                  return " in a stressed voice";
                break;
                case VOICE_EVIL:
                  return " in a evilish voice";
                break;
                case VOICE_SWEET:
                  return " sweetly";
                break;
                case VOICE_DEMANDING:
                  return " demandingly";
                break;
                case VOICE_GROWLING:
                  return " growling";
                break;
                case VOICE_CHEER:
                  return " in a cherry voice";
                break;
        }
}