//DMFI Voice script


int AppearType (string sCom)
{
if (sCom == "ARANEA")
    return APPEARANCE_TYPE_ARANEA;
if (sCom == "ALLIP")
    return APPEARANCE_TYPE_ALLIP;
if (sCom == "ARCH_TARGET")
    return APPEARANCE_TYPE_ARCH_TARGET;
if (sCom == "ARIBETH")
    return APPEARANCE_TYPE_ARIBETH;
if (sCom == "ASABI_CHIEFTAIN")
    return APPEARANCE_TYPE_ASABI_CHIEFTAIN;
if (sCom == "ASABI_SHAMAN")
    return APPEARANCE_TYPE_ASABI_SHAMAN;
if (sCom == "ASABI_WARRIOR")
    return APPEARANCE_TYPE_ASABI_WARRIOR;
if (sCom == "BADGER")
    return APPEARANCE_TYPE_BADGER;
if (sCom == "BADGER_DIRE")
    return APPEARANCE_TYPE_BADGER_DIRE;
if (sCom == "BALOR")
    return APPEARANCE_TYPE_BALOR;
if (sCom == "BARTENDER")
    return APPEARANCE_TYPE_BARTENDER;
if (sCom == "BASILISK")
    return APPEARANCE_TYPE_BASILISK;
if (sCom == "BAT")
    return APPEARANCE_TYPE_BAT;
if (sCom == "BAT_HORROR")
    return APPEARANCE_TYPE_BAT_HORROR;
if (sCom == "BEAR_BLACK")
    return APPEARANCE_TYPE_BEAR_BLACK;
if (sCom == "BEAR_BROWN")
    return APPEARANCE_TYPE_BEAR_BROWN;
if (sCom == "BEAR_DIRE")
    return APPEARANCE_TYPE_BEAR_DIRE;
if (sCom == "BEAR_KODIAK")
    return APPEARANCE_TYPE_BEAR_KODIAK;
if (sCom == "BEAR_POLAR")
    return APPEARANCE_TYPE_BEAR_POLAR;
if (sCom == "BEETLE_FIRE")
    return APPEARANCE_TYPE_BEETLE_FIRE;
if (sCom == "BEETLE_SLICER")
    return APPEARANCE_TYPE_BEETLE_SLICER;
if (sCom == "BEETLE_STAG")
    return APPEARANCE_TYPE_BEETLE_STAG;
if (sCom == "BEETLE_STINK")
    return APPEARANCE_TYPE_BEETLE_STINK;
if (sCom == "BEGGER")
    return APPEARANCE_TYPE_BEGGER;
if (sCom == "BLOOD_SAILER")
    return APPEARANCE_TYPE_BLOOD_SAILER;
if (sCom == "BOAR")
    return APPEARANCE_TYPE_BOAR;
if (sCom == "BOAR_DIRE")
    return APPEARANCE_TYPE_BOAR_DIRE;
if (sCom == "BODAK")
    return APPEARANCE_TYPE_BODAK;
if (sCom == "BUGBEAR_A")
    return APPEARANCE_TYPE_BUGBEAR_A;
if (sCom == "BUGBEAR_B")
    return APPEARANCE_TYPE_BUGBEAR_B;
if (sCom == "BUGBEAR_CHIEFTAIN_A")
    return APPEARANCE_TYPE_BUGBEAR_CHIEFTAIN_A;
if (sCom == "BUGBEAR_CHIEFTAIN_B")
    return APPEARANCE_TYPE_BUGBEAR_CHIEFTAIN_B;
if (sCom == "BUGBEAR_SHAMAN_A")
    return APPEARANCE_TYPE_BUGBEAR_SHAMAN_A;
if (sCom == "BUGBEAR_SHAMAN_B")
    return APPEARANCE_TYPE_BUGBEAR_SHAMAN_B;
if (sCom == "CAT_CAT_DIRE")
    return APPEARANCE_TYPE_CAT_CAT_DIRE;
if (sCom == "CAT_COUGAR")
    return APPEARANCE_TYPE_CAT_COUGAR;
if (sCom == "CAT_CRAG_CAT")
    return APPEARANCE_TYPE_CAT_CRAG_CAT;
if (sCom == "CAT_JAGUAR")
    return APPEARANCE_TYPE_CAT_JAGUAR;
if (sCom == "CAT_KRENSHAR")
    return APPEARANCE_TYPE_CAT_KRENSHAR;
if (sCom == "CAT_LEOPARD")
    return APPEARANCE_TYPE_CAT_LEOPARD;
if (sCom == "CAT_LION")
    return APPEARANCE_TYPE_CAT_LION;
if (sCom == "CAT_MPANTHER")
    return APPEARANCE_TYPE_CAT_MPANTHER;
if (sCom == "CAT_PANTHER")
    return APPEARANCE_TYPE_CAT_PANTHER;
if (sCom == "CHICKEN")
    return APPEARANCE_TYPE_CHICKEN;
if (sCom == "COCKATRICE")
    return APPEARANCE_TYPE_COCKATRICE;
if (sCom == "COMBAT_DUMMY")
    return APPEARANCE_TYPE_COMBAT_DUMMY;
if (sCom == "CONVICT")
    return APPEARANCE_TYPE_CONVICT;
if (sCom == "COW")
    return APPEARANCE_TYPE_COW;
if (sCom == "CULT_MEMBER")
    return APPEARANCE_TYPE_CULT_MEMBER;
if (sCom == "DEER")
    return APPEARANCE_TYPE_DEER;
if (sCom == "DEER_STAG")
    return APPEARANCE_TYPE_DEER_STAG;
if (sCom == "DEVIL")
    return APPEARANCE_TYPE_DEVIL;
if (sCom == "DOG")
    return APPEARANCE_TYPE_DOG;
if (sCom == "DOG_BLINKDOG")
    return APPEARANCE_TYPE_DOG_BLINKDOG;
if (sCom == "DOG_DIRE_WOLF")
    return APPEARANCE_TYPE_DOG_DIRE_WOLF;
if (sCom == "DOG_FENHOUND")
    return APPEARANCE_TYPE_DOG_FENHOUND;
if (sCom == "DOG_HELL_HOUND")
    return APPEARANCE_TYPE_DOG_HELL_HOUND;
if (sCom == "DOG_SHADOW_MASTIF")
    return APPEARANCE_TYPE_DOG_SHADOW_MASTIF;
if (sCom == "DOG_WINTER_WOLF")
    return APPEARANCE_TYPE_DOG_WINTER_WOLF;
if (sCom == "DOG_WORG")
    return APPEARANCE_TYPE_DOG_WORG;
if (sCom == "DOG_WOLF")
    return APPEARANCE_TYPE_DOG_WOLF;
if (sCom == "DOOM_KNIGHT")
    return APPEARANCE_TYPE_DOOM_KNIGHT;
if (sCom == "DRAGON_BLACK")
    return APPEARANCE_TYPE_DRAGON_BLACK;
if (sCom == "DRAGON_BLUE")
    return APPEARANCE_TYPE_DRAGON_BLUE;
if (sCom == "DRAGON_BRASS")
    return APPEARANCE_TYPE_DRAGON_BRASS;
if (sCom == "DRAGON_BRONZE")
    return APPEARANCE_TYPE_DRAGON_BRONZE;
if (sCom == "DRAGON_COPPER")
    return APPEARANCE_TYPE_DRAGON_COPPER;
if (sCom == "DRAGON_GOLD")
    return APPEARANCE_TYPE_DRAGON_GOLD;
if (sCom == "DRAGON_GREEN")
    return APPEARANCE_TYPE_DRAGON_GREEN;
if (sCom == "DRAGON_RED")
    return APPEARANCE_TYPE_DRAGON_RED;
if (sCom == "DRAGON_SILVER")
    return APPEARANCE_TYPE_DRAGON_SILVER;
if (sCom == "DRAGON_WHITE")
    return APPEARANCE_TYPE_DRAGON_WHITE;
if (sCom == "DROW_CLERIC")
    return APPEARANCE_TYPE_DROW_CLERIC;
if (sCom == "DROW_FIGHTER")
    return APPEARANCE_TYPE_DROW_FIGHTER;
if (sCom == "DRUEGAR_CLERIC")
    return APPEARANCE_TYPE_DRUEGAR_CLERIC;
if (sCom == "DRUEGAR_FIGHTER")
    return APPEARANCE_TYPE_DRUEGAR_FIGHTER;
if (sCom == "DRYAD")
    return APPEARANCE_TYPE_DRYAD;
if (sCom == "DWARF")
    return APPEARANCE_TYPE_DWARF;
if (sCom == "DWARF_NPC_FEMALE")
    return APPEARANCE_TYPE_DWARF_NPC_FEMALE;
if (sCom == "DWARF_NPC_MALE")
    return APPEARANCE_TYPE_DWARF_NPC_MALE;
if (sCom == "ELEMENTAL_AIR")
    return APPEARANCE_TYPE_ELEMENTAL_AIR;
if (sCom == "ELEMENTAL_AIR_ELDER")
    return APPEARANCE_TYPE_ELEMENTAL_AIR_ELDER;
if (sCom == "ELEMENTAL_EARTH")
    return APPEARANCE_TYPE_ELEMENTAL_EARTH;
if (sCom == "ELEMENTAL_EARTH_ELDER")
    return APPEARANCE_TYPE_ELEMENTAL_EARTH_ELDER;
if (sCom == "ELEMENTAL_FIRE")
    return APPEARANCE_TYPE_ELEMENTAL_FIRE;
if (sCom == "ELEMENTAL_FIRE_ELDER")
    return APPEARANCE_TYPE_ELEMENTAL_FIRE_ELDER;
if (sCom == "ELEMENTAL_WATER")
    return APPEARANCE_TYPE_ELEMENTAL_WATER;
if (sCom == "ELEMENTAL_WATER_ELDER")
    return APPEARANCE_TYPE_ELEMENTAL_WATER_ELDER;
if (sCom == "ELF")
    return APPEARANCE_TYPE_ELF;
if (sCom == "ELF_NPC_FEMALE")
    return APPEARANCE_TYPE_ELF_NPC_FEMALE;
if (sCom == "ELF_NPC_MALE_01")
    return APPEARANCE_TYPE_ELF_NPC_MALE_01;
if (sCom == "ELF_NPC_MALE_02")
    return APPEARANCE_TYPE_ELF_NPC_MALE_02;
if (sCom == "ETTERCAP")
    return APPEARANCE_TYPE_ETTERCAP;
if (sCom == "ETTIN")
    return APPEARANCE_TYPE_ETTIN;
if (sCom == "FAERIE_DRAGON")
    return APPEARANCE_TYPE_FAERIE_DRAGON;
if (sCom == "FAIRY")
    return APPEARANCE_TYPE_FAIRY;
if (sCom == "FALCON")
    return APPEARANCE_TYPE_FALCON;
if (sCom == "FEMALE_01")
    return APPEARANCE_TYPE_FEMALE_01;
if (sCom == "FEMALE_02")
    return APPEARANCE_TYPE_FEMALE_02;
if (sCom == "FEMALE_03")
    return APPEARANCE_TYPE_FEMALE_03;
if (sCom == "FEMALE_04")
    return APPEARANCE_TYPE_FEMALE_04;
if (sCom == "FORMIAN_MYRMARCH")
    return APPEARANCE_TYPE_FORMIAN_MYRMARCH;
if (sCom == "FORMIAN_QUEEN")
    return APPEARANCE_TYPE_FORMIAN_QUEEN;
if (sCom == "FORMIAN_WARRIOR")
    return APPEARANCE_TYPE_FORMIAN_WARRIOR;
if (sCom == "FORMIAN_WORKER")
    return APPEARANCE_TYPE_FORMIAN_WORKER;
if (sCom == "GARGOYLE")
    return APPEARANCE_TYPE_GARGOYLE;
if (sCom == "GHAST")
    return APPEARANCE_TYPE_GHAST;
if (sCom == "GHOUL")
    return APPEARANCE_TYPE_GHOUL;
if (sCom == "GHOUL_LORD")
    return APPEARANCE_TYPE_GHOUL_LORD;
if (sCom == "GIANT_FIRE")
    return APPEARANCE_TYPE_GIANT_FIRE;
if (sCom == "GIANT_FIRE_FEMALE")
    return APPEARANCE_TYPE_GIANT_FIRE_FEMALE;
if (sCom == "GIANT_FROST")
    return APPEARANCE_TYPE_GIANT_FROST;
if (sCom == "GIANT_FROST_FEMALE")
    return APPEARANCE_TYPE_GIANT_FROST_FEMALE;
if (sCom == "GIANT_HILL")
    return APPEARANCE_TYPE_GIANT_HILL;
if (sCom == "GIANT_MOUNTAIN")
    return APPEARANCE_TYPE_GIANT_MOUNTAIN;
if (sCom == "GNOLL_WARRIOR")
    return APPEARANCE_TYPE_GNOLL_WARRIOR;
if (sCom == "GNOLL_WIZ")
    return APPEARANCE_TYPE_GNOLL_WIZ;
if (sCom == "GNOME")
    return APPEARANCE_TYPE_GNOME;
if (sCom == "GNOME_NPC_FEMALE")
    return APPEARANCE_TYPE_GNOME_NPC_FEMALE;
if (sCom == "GNOME_NPC_MALE")
    return APPEARANCE_TYPE_GNOME_NPC_MALE;
if (sCom == "GOBLIN_A")
    return APPEARANCE_TYPE_GOBLIN_A;
if (sCom == "GOBLIN_B")
    return APPEARANCE_TYPE_GOBLIN_B;
if (sCom == "GOBLIN_CHIEF_A")
    return APPEARANCE_TYPE_GOBLIN_CHIEF_A;
if (sCom == "GOBLIN_CHIEF_B")
    return APPEARANCE_TYPE_GOBLIN_CHIEF_B;
if (sCom == "GOBLIN_SHAMAN_A")
    return APPEARANCE_TYPE_GOBLIN_SHAMAN_A;
if (sCom == "GOBLIN_SHAMAN_B")
    return APPEARANCE_TYPE_GOBLIN_SHAMAN_B;
if (sCom == "GOLEM_BONE")
    return APPEARANCE_TYPE_GOLEM_BONE;
if (sCom == "GOLEM_CLAY")
    return APPEARANCE_TYPE_GOLEM_CLAY;
if (sCom == "GOLEM_FLESH")
    return APPEARANCE_TYPE_GOLEM_FLESH;
if (sCom == "GOLEM_IRON")
    return APPEARANCE_TYPE_GOLEM_IRON;
if (sCom == "GOLEM_STONE")
    return APPEARANCE_TYPE_GOLEM_STONE;
if (sCom == "GORGON")
    return APPEARANCE_TYPE_GORGON;
if (sCom == "GREY_RENDER")
    return APPEARANCE_TYPE_GREY_RENDER;
if (sCom == "GYNOSPHINX")
    return APPEARANCE_TYPE_GYNOSPHINX;
if (sCom == "HALF_ELF")
    return APPEARANCE_TYPE_HALF_ELF;
if (sCom == "HALF_ORC")
    return APPEARANCE_TYPE_HALF_ORC;
if (sCom == "HALF_ORC_NPC_FEMALE")
    return APPEARANCE_TYPE_HALF_ORC_NPC_FEMALE;
if (sCom == "HALF_ORC_NPC_MALE_01")
    return APPEARANCE_TYPE_HALF_ORC_NPC_MALE_01;
if (sCom == "HALF_ORC_NPC_MALE_02")
    return APPEARANCE_TYPE_HALF_ORC_NPC_MALE_02;
if (sCom == "HALFLING")
    return APPEARANCE_TYPE_HALFLING;
if (sCom == "HALFLING_NPC_FEMALE")
    return APPEARANCE_TYPE_HALFLING_NPC_FEMALE;
if (sCom == "HALFLING_NPC_MALE")
    return APPEARANCE_TYPE_HALFLING_NPC_MALE;
if (sCom == "HELMED_HORROR")
    return APPEARANCE_TYPE_HELMED_HORROR;
if (sCom == "HEURODIS_LICH")
    return APPEARANCE_TYPE_HEURODIS_LICH;
if (sCom == "HOBGOBLIN_WARRIOR")
    return APPEARANCE_TYPE_HOBGOBLIN_WARRIOR;
if (sCom == "HOOK_HORROR")
    return APPEARANCE_TYPE_HOOK_HORROR;
if (sCom == "HOBGOBLIN_WIZARD")
    return APPEARANCE_TYPE_HOBGOBLIN_WIZARD;
if (sCom == "HOUSE_GUARD")
    return APPEARANCE_TYPE_HOUSE_GUARD;
if (sCom == "HUMAN")
    return APPEARANCE_TYPE_HUMAN;
if (sCom == "HUMAN_NPC_FEMALE_01")
    return APPEARANCE_TYPE_HUMAN_NPC_FEMALE_01;
if (sCom == "HUMAN_NPC_FEMALE_02")
    return APPEARANCE_TYPE_HUMAN_NPC_FEMALE_02;
if (sCom == "HUMAN_NPC_FEMALE_03")
    return APPEARANCE_TYPE_HUMAN_NPC_FEMALE_03;
if (sCom == "HUMAN_NPC_FEMALE_04")
    return APPEARANCE_TYPE_HUMAN_NPC_FEMALE_04;
if (sCom == "HUMAN_NPC_FEMALE_05")
    return APPEARANCE_TYPE_HUMAN_NPC_FEMALE_05;
if (sCom == "HUMAN_NPC_FEMALE_06")
    return APPEARANCE_TYPE_HUMAN_NPC_FEMALE_06;
if (sCom == "HUMAN_NPC_FEMALE_07")
    return APPEARANCE_TYPE_HUMAN_NPC_FEMALE_07;
if (sCom == "HUMAN_NPC_FEMALE_08")
    return APPEARANCE_TYPE_HUMAN_NPC_FEMALE_08;
if (sCom == "HUMAN_NPC_FEMALE_09")
    return APPEARANCE_TYPE_HUMAN_NPC_FEMALE_09;
if (sCom == "HUMAN_NPC_FEMALE_10")
    return APPEARANCE_TYPE_HUMAN_NPC_FEMALE_10;
if (sCom == "HUMAN_NPC_FEMALE_11")
    return APPEARANCE_TYPE_HUMAN_NPC_FEMALE_11;
if (sCom == "HUMAN_NPC_FEMALE_12")
    return APPEARANCE_TYPE_HUMAN_NPC_FEMALE_12;
if (sCom == "HUMAN_NPC_MALE_01")
    return APPEARANCE_TYPE_HUMAN_NPC_MALE_01;
if (sCom == "HUMAN_NPC_MALE_02")
    return APPEARANCE_TYPE_HUMAN_NPC_MALE_02;
if (sCom == "HUMAN_NPC_MALE_03")
    return APPEARANCE_TYPE_HUMAN_NPC_MALE_03;
if (sCom == "HUMAN_NPC_MALE_04")
    return APPEARANCE_TYPE_HUMAN_NPC_MALE_04;
if (sCom == "HUMAN_NPC_MALE_05")
    return APPEARANCE_TYPE_HUMAN_NPC_MALE_05;
if (sCom == "HUMAN_NPC_MALE_06")
    return APPEARANCE_TYPE_HUMAN_NPC_MALE_06;
if (sCom == "HUMAN_NPC_MALE_07")
    return APPEARANCE_TYPE_HUMAN_NPC_MALE_07;
if (sCom == "HUMAN_NPC_MALE_08")
    return APPEARANCE_TYPE_HUMAN_NPC_MALE_08;
if (sCom == "HUMAN_NPC_MALE_09")
    return APPEARANCE_TYPE_HUMAN_NPC_MALE_09;
if (sCom == "HUMAN_NPC_MALE_10")
    return APPEARANCE_TYPE_HUMAN_NPC_MALE_10;
if (sCom == "HUMAN_NPC_MALE_11")
    return APPEARANCE_TYPE_HUMAN_NPC_MALE_11;
if (sCom == "HUMAN_NPC_MALE_12")
    return APPEARANCE_TYPE_HUMAN_NPC_MALE_12;
if (sCom == "HUMAN_NPC_MALE_13")
    return APPEARANCE_TYPE_HUMAN_NPC_MALE_13;
if (sCom == "HUMAN_NPC_MALE_14")
    return APPEARANCE_TYPE_HUMAN_NPC_MALE_14;
if (sCom == "HUMAN_NPC_MALE_15")
    return APPEARANCE_TYPE_HUMAN_NPC_MALE_15;
if (sCom == "HUMAN_NPC_MALE_16")
    return APPEARANCE_TYPE_HUMAN_NPC_MALE_16;
if (sCom == "HUMAN_NPC_MALE_17")
    return APPEARANCE_TYPE_HUMAN_NPC_MALE_17;
if (sCom == "HUMAN_NPC_MALE_18")
    return APPEARANCE_TYPE_HUMAN_NPC_MALE_18;
if (sCom == "IMP")
    return APPEARANCE_TYPE_IMP;
if (sCom == "INN_KEEPER")
    return APPEARANCE_TYPE_INN_KEEPER;
if (sCom == "INTELLECT_DEVOURER")
    return APPEARANCE_TYPE_INTELLECT_DEVOURER;
if (sCom == "INVISIBLE_HUMAN_MALE")
    return APPEARANCE_TYPE_INVISIBLE_HUMAN_MALE;
if (sCom == "INVISIBLE_STALKER")
    return APPEARANCE_TYPE_INVISIBLE_STALKER;
if (sCom == "KID_FEMALE")
    return APPEARANCE_TYPE_KID_FEMALE;
if (sCom == "KID_MALE")
    return APPEARANCE_TYPE_KID_MALE;
if (sCom == "KOBOLD_A")
    return APPEARANCE_TYPE_KOBOLD_A;
if (sCom == "KOBOLD_B")
    return APPEARANCE_TYPE_KOBOLD_B;
if (sCom == "KOBOLD_CHIEF_A")
    return APPEARANCE_TYPE_KOBOLD_CHIEF_A;
if (sCom == "KOBOLD_CHIEF_B")
    return APPEARANCE_TYPE_KOBOLD_CHIEF_B;
if (sCom == "KOBOLD_SHAMAN_A")
    return APPEARANCE_TYPE_KOBOLD_SHAMAN_A;
if (sCom == "KOBOLD_SHAMAN_B")
    return APPEARANCE_TYPE_KOBOLD_SHAMAN_B;
if (sCom == "LANTERN_ARCHON")
    return APPEARANCE_TYPE_LANTERN_ARCHON;
if (sCom == "LICH")
    return APPEARANCE_TYPE_LICH;
if (sCom == "LIZARDFOLK_A")
    return APPEARANCE_TYPE_LIZARDFOLK_A;
if (sCom == "LIZARDFOLK_B")
    return APPEARANCE_TYPE_LIZARDFOLK_B;
if (sCom == "LIZARDFOLK_SHAMAN_A")
    return APPEARANCE_TYPE_LIZARDFOLK_SHAMAN_A;
if (sCom == "LIZARDFOLK_SHAMAN_B")
    return APPEARANCE_TYPE_LIZARDFOLK_SHAMAN_B;
if (sCom == "LIZARDFOLK_WARRIOR_A")
    return APPEARANCE_TYPE_LIZARDFOLK_WARRIOR_A;
if (sCom == "LIZARDFOLK_WARRIOR_B")
    return APPEARANCE_TYPE_LIZARDFOLK_WARRIOR_B;
if (sCom == "LUSKAN_GUARD")
    return APPEARANCE_TYPE_LUSKAN_GUARD;
if (sCom == "MALE_01")
    return APPEARANCE_TYPE_MALE_01;
if (sCom == "MALE_02")
    return APPEARANCE_TYPE_MALE_02;
if (sCom == "MALE_03")
    return APPEARANCE_TYPE_MALE_03;
if (sCom == "MALE_04")
    return APPEARANCE_TYPE_MALE_04;
if (sCom == "MALE_05")
    return APPEARANCE_TYPE_MALE_05;
if (sCom == "MANTICORE")
    return APPEARANCE_TYPE_MANTICORE;
if (sCom == "MEDUSA")
    return APPEARANCE_TYPE_MEDUSA;
if (sCom == "MEPHIT_AIR")
    return APPEARANCE_TYPE_MEPHIT_AIR;
if (sCom == "MEPHIT_DUST")
    return APPEARANCE_TYPE_MEPHIT_DUST;
if (sCom == "MEPHIT_EARTH")
    return APPEARANCE_TYPE_MEPHIT_EARTH;
if (sCom == "MEPHIT_FIRE")
    return APPEARANCE_TYPE_MEPHIT_FIRE;
if (sCom == "MEPHIT_ICE")
    return APPEARANCE_TYPE_MEPHIT_ICE;
if (sCom == "MEPHIT_MAGMA")
    return APPEARANCE_TYPE_MEPHIT_MAGMA;
if (sCom == "MEPHIT_OOZE")
    return APPEARANCE_TYPE_MEPHIT_OOZE;
if (sCom == "MEPHIT_SALT")
    return APPEARANCE_TYPE_MEPHIT_SALT;
if (sCom == "MEPHIT_STEAM")
    return APPEARANCE_TYPE_MEPHIT_STEAM;
if (sCom == "MEPHIT_WATER")
    return APPEARANCE_TYPE_MEPHIT_WATER;
if (sCom == "MINOGON")
    return APPEARANCE_TYPE_MINOGON;
if (sCom == "MINOTAUR")
    return APPEARANCE_TYPE_MINOTAUR;
if (sCom == "MINOTAUR_CHIEFTAIN")
    return APPEARANCE_TYPE_MINOTAUR_CHIEFTAIN;
if (sCom == "MINOTAUR_SHAMAN")
    return APPEARANCE_TYPE_MINOTAUR_SHAMAN;
if (sCom == "MOHRG")
    return APPEARANCE_TYPE_MOHRG;
if (sCom == "MUMMY_COMMON")
    return APPEARANCE_TYPE_MUMMY_COMMON;
if (sCom == "MUMMY_FIGHTER_2")
    return APPEARANCE_TYPE_MUMMY_FIGHTER_2;
if (sCom == "MUMMY_GREATER")
    return APPEARANCE_TYPE_MUMMY_GREATER;
if (sCom == "MUMMY_WARRIOR")
    return APPEARANCE_TYPE_MUMMY_WARRIOR;
if (sCom == "NW_MILITIA_MEMBER")
    return APPEARANCE_TYPE_NW_MILITIA_MEMBER;
if (sCom == "NWN_AARIN")
    return APPEARANCE_TYPE_NWN_AARIN;
if (sCom == "NWN_ARIBETH_EVIL")
    return APPEARANCE_TYPE_NWN_ARIBETH_EVIL;
if (sCom == "NWN_HAEDRALINE")
    return APPEARANCE_TYPE_NWN_HAEDRALINE;
if (sCom == "NWN_MAUGRIM")
    return APPEARANCE_TYPE_NWN_MAUGRIM;
if (sCom == "NWN_MORAG")
    return APPEARANCE_TYPE_NWN_MORAG;
if (sCom == "NWN_NASHER")
    return APPEARANCE_TYPE_NWN_NASHER;
if (sCom == "NWN_SEDOS")
    return APPEARANCE_TYPE_NWN_SEDOS;
if (sCom == "NYMPH")
    return APPEARANCE_TYPE_NYMPH;
if (sCom == "OGRE")
    return APPEARANCE_TYPE_OGRE;
if (sCom == "OGRE_CHIEFTAIN")
    return APPEARANCE_TYPE_OGRE_CHIEFTAIN;
if (sCom == "OGRE_CHIEFTAINB")
    return APPEARANCE_TYPE_OGRE_CHIEFTAINB;
if (sCom == "OGRE_MAGE")
    return APPEARANCE_TYPE_OGRE_MAGE;
if (sCom == "OGRE_MAGEB")
    return APPEARANCE_TYPE_OGRE_MAGEB;
if (sCom == "OGREB")
    return APPEARANCE_TYPE_OGREB;
if (sCom == "OLD_MAN")
    return APPEARANCE_TYPE_OLD_MAN;
if (sCom == "OLD_WOMAN")
    return APPEARANCE_TYPE_OLD_WOMAN;
if (sCom == "ORC_A")
    return APPEARANCE_TYPE_ORC_A;
if (sCom == "ORC_B")
    return APPEARANCE_TYPE_ORC_B;
if (sCom == "ORC_CHIEFTAIN_A")
    return APPEARANCE_TYPE_ORC_CHIEFTAIN_A;
if (sCom == "ORC_CHIEFTAIN_B")
    return APPEARANCE_TYPE_ORC_CHIEFTAIN_B;
if (sCom == "ORC_SHAMAN_A")
    return APPEARANCE_TYPE_ORC_SHAMAN_A;
if (sCom == "ORC_SHAMAN_B")
    return APPEARANCE_TYPE_ORC_SHAMAN_B;
if (sCom == "OX")
    return APPEARANCE_TYPE_OX;
if (sCom == "PENGUIN")
    return APPEARANCE_TYPE_PENGUIN;
if (sCom == "PLAGUE_VICTIM")
    return APPEARANCE_TYPE_PLAGUE_VICTIM;
if (sCom == "PROSTITUTE_01")
    return APPEARANCE_TYPE_PROSTITUTE_01;
if (sCom == "PROSTITUTE_02")
    return APPEARANCE_TYPE_PROSTITUTE_02;
if (sCom == "PSEUDODRAGON")
    return APPEARANCE_TYPE_PSEUDODRAGON;
if (sCom == "QUASIT")
    return APPEARANCE_TYPE_QUASIT;
if (sCom == "RAKSHASA_BEAR_MALE")
    return APPEARANCE_TYPE_RAKSHASA_BEAR_MALE;
if (sCom == "RAKSHASA_TIGER_FEMALE")
    return APPEARANCE_TYPE_RAKSHASA_TIGER_FEMALE;
if (sCom == "RAKSHASA_TIGER_MALE")
    return APPEARANCE_TYPE_RAKSHASA_TIGER_MALE;
if (sCom == "RAKSHASA_WOLF_MALE")
    return APPEARANCE_TYPE_RAKSHASA_WOLF_MALE;
if (sCom == "RAT")
    return APPEARANCE_TYPE_RAT;
if (sCom == "RAT_DIRE")
    return APPEARANCE_TYPE_RAT_DIRE;
if (sCom == "RAVEN")
    return APPEARANCE_TYPE_RAVEN;
if (sCom == "SHADOW")
    return APPEARANCE_TYPE_SHADOW;
if (sCom == "SHADOW_FIEND")
    return APPEARANCE_TYPE_SHADOW_FIEND;
if (sCom == "SHIELD_GUARDIAN")
    return APPEARANCE_TYPE_SHIELD_GUARDIAN;
if (sCom == "SHOP_KEEPER")
    return APPEARANCE_TYPE_SHOP_KEEPER;
if (sCom == "SKELETAL_DEVOURER")
    return APPEARANCE_TYPE_SKELETAL_DEVOURER;
if (sCom == "SKELETON_CHIEFTAIN")
    return APPEARANCE_TYPE_SKELETON_CHIEFTAIN;
if (sCom == "SKELETON_COMMON")
    return APPEARANCE_TYPE_SKELETON_COMMON;
if (sCom == "SKELETON_MAGE")
    return APPEARANCE_TYPE_SKELETON_MAGE;
if (sCom == "SKELETON_WARRIOR")
    return APPEARANCE_TYPE_SKELETON_WARRIOR;
if (sCom == "SKELETON_PRIEST")
    return APPEARANCE_TYPE_SKELETON_PRIEST;
if (sCom == "SKELETON_WARRIOR_1")
    return APPEARANCE_TYPE_SKELETON_WARRIOR_1;
if (sCom == "SKELETON_WARRIOR_2")
    return APPEARANCE_TYPE_SKELETON_WARRIOR_2;
if (sCom == "SPIDER_WRAITH")
    return APPEARANCE_TYPE_SPIDER_WRAITH;
if (sCom == "STINGER")
    return APPEARANCE_TYPE_STINGER;
if (sCom == "STINGER_CHIEFTAIN")
    return APPEARANCE_TYPE_STINGER_CHIEFTAIN;
if (sCom == "STINGER_MAGE")
    return APPEARANCE_TYPE_STINGER_MAGE;
if (sCom == "STINGER_WARRIOR")
    return APPEARANCE_TYPE_STINGER_WARRIOR;
if (sCom == "SUCCUBUS")
    return APPEARANCE_TYPE_SUCCUBUS;
if (sCom == "TROLL")
    return APPEARANCE_TYPE_TROLL;
if (sCom == "TROLL_CHIEFTAIN")
    return APPEARANCE_TYPE_TROLL_CHIEFTAIN;
if (sCom == "TROLL_SHAMAN")
    return APPEARANCE_TYPE_TROLL_SHAMAN;
if (sCom == "UMBERHULK")
    return APPEARANCE_TYPE_UMBERHULK;
if (sCom == "UTHGARD_ELK_TRIBE")
    return APPEARANCE_TYPE_UTHGARD_ELK_TRIBE;
if (sCom == "UTHGARD_TIGER_TRIBE")
    return APPEARANCE_TYPE_UTHGARD_TIGER_TRIBE;
if (sCom == "VAMPIRE_FEMALE")
    return APPEARANCE_TYPE_VAMPIRE_FEMALE;
if (sCom == "VAMPIRE_MALE")
    return APPEARANCE_TYPE_VAMPIRE_MALE;
if (sCom == "VROCK")
    return APPEARANCE_TYPE_VROCK;
if (sCom == "WAITRESS")
    return APPEARANCE_TYPE_WAITRESS;
if (sCom == "WAR_DEVOURER")
    return APPEARANCE_TYPE_WAR_DEVOURER;
if (sCom == "WERECAT")
    return APPEARANCE_TYPE_WERECAT;
if (sCom == "WERERAT")
    return APPEARANCE_TYPE_WERERAT;
if (sCom == "WEREWOLF")
    return APPEARANCE_TYPE_WEREWOLF;
if (sCom == "WIGHT")
    return APPEARANCE_TYPE_WIGHT;
if (sCom == "WILL_O_WISP")
    return APPEARANCE_TYPE_WILL_O_WISP;
if (sCom == "WRAITH")
    return APPEARANCE_TYPE_WRAITH;
if (sCom == "WYRMLING_BLACK")
    return APPEARANCE_TYPE_WYRMLING_BLACK;
if (sCom == "WYRMLING_BLUE")
    return APPEARANCE_TYPE_WYRMLING_BLUE;
if (sCom == "WYRMLING_BRASS")
    return APPEARANCE_TYPE_WYRMLING_BRASS;
if (sCom == "WYRMLING_BRONZE")
    return APPEARANCE_TYPE_WYRMLING_BRONZE;
if (sCom == "WYRMLING_COPPER")
    return APPEARANCE_TYPE_WYRMLING_COPPER;
if (sCom == "WYRMLING_GOLD")
    return APPEARANCE_TYPE_WYRMLING_GOLD;
if (sCom == "WYRMLING_GREEN")
    return APPEARANCE_TYPE_WYRMLING_GREEN;
if (sCom == "WYRMLING_RED")
    return APPEARANCE_TYPE_WYRMLING_RED;
if (sCom == "WYRMLING_SILVER")
    return APPEARANCE_TYPE_WYRMLING_SILVER;
if (sCom == "WYRMLING_WHITE")
    return APPEARANCE_TYPE_WYRMLING_WHITE;
if (sCom == "YUAN_TI")
    return APPEARANCE_TYPE_YUAN_TI;
if (sCom == "YUAN_TI_CHIEFTEN")
    return APPEARANCE_TYPE_YUAN_TI_CHIEFTEN;
if (sCom == "YUAN_TI_WIZARD")
    return APPEARANCE_TYPE_YUAN_TI_WIZARD;
if (sCom == "ZOMBIE")
    return APPEARANCE_TYPE_ZOMBIE;
if (sCom == "ZOMBIE_ROTTING")
    return APPEARANCE_TYPE_ZOMBIE_ROTTING;
if (sCom == "ZOMBIE_TYRANT_FOG")
    return APPEARANCE_TYPE_ZOMBIE_TYRANT_FOG;
if (sCom == "ZOMBIE_WARRIOR_1")
    return APPEARANCE_TYPE_ZOMBIE_WARRIOR_1;
if (sCom == "ZOMBIE_WARRIOR_2")
    return APPEARANCE_TYPE_ZOMBIE_WARRIOR_2;

return -1;
}

 void dmw_CleanUp(object oMySpeaker)
{
   int nCount;
   int nCache;
   //DeleteLocalObject(oMySpeaker, "dmfi_univ_target");
   DeleteLocalLocation(oMySpeaker, "dmfi_univ_location");
   DeleteLocalObject(oMySpeaker, "dmw_item");
   DeleteLocalString(oMySpeaker, "dmw_repamt");
   DeleteLocalString(oMySpeaker, "dmw_repargs");
   nCache = GetLocalInt(oMySpeaker, "dmw_playercache");
   for(nCount = 1; nCount <= nCache; nCount++)
   {
      DeleteLocalObject(oMySpeaker, "dmw_playercache" + IntToString(nCount));
   }
   DeleteLocalInt(oMySpeaker, "dmw_playercache");
   nCache = GetLocalInt(oMySpeaker, "dmw_itemcache");
   for(nCount = 1; nCount <= nCache; nCount++)
   {
      DeleteLocalObject(oMySpeaker, "dmw_itemcache" + IntToString(nCount));
   }
   DeleteLocalInt(oMySpeaker, "dmw_itemcache");
   for(nCount = 1; nCount <= 10; nCount++)
   {
      DeleteLocalString(oMySpeaker, "dmw_dialog" + IntToString(nCount));
      DeleteLocalString(oMySpeaker, "dmw_function" + IntToString(nCount));
      DeleteLocalString(oMySpeaker, "dmw_params" + IntToString(nCount));
   }
   DeleteLocalString(oMySpeaker, "dmw_playerfunc");
   DeleteLocalInt(oMySpeaker, "dmw_started");
}
//Smoking Function by Jason Robinson
location GetLocationAboveAndInFrontOf(object oPC, float fDist, float fHeight)
{
    float fDistance = -fDist;
    object oTarget = (oPC);
    object oArea = GetArea(oTarget);
    vector vPosition = GetPosition(oTarget);
    vPosition.z += fHeight;
    float fOrientation = GetFacing(oTarget);
    vector vNewPos = AngleToVector(fOrientation);
    float vZ = vPosition.z;
    float vX = vPosition.x - fDistance * vNewPos.x;
    float vY = vPosition.y - fDistance * vNewPos.y;
    fOrientation = GetFacing(oTarget);
    vX = vPosition.x - fDistance * vNewPos.x;
    vY = vPosition.y - fDistance * vNewPos.y;
    vNewPos = AngleToVector(fOrientation);
    vZ = vPosition.z;
    vNewPos = Vector(vX, vY, vZ);
    return Location(oArea, vNewPos, fOrientation);
}

//Smoking Function by Jason Robinson
void SmokePipe(object oActivator)
{
    string sEmote1 = "*puffs on a pipe*";
    string sEmote2 = "*inhales from a pipe*";
    string sEmote3 = "*pulls a mouthful of smoke from a pipe*";
    float fHeight = 1.7;
    float fDistance = 0.1;
    // Set height based on race and gender
    if (GetGender(oActivator) == GENDER_MALE)
    {
        switch (GetRacialType(oActivator))
        {
            case RACIAL_TYPE_HUMAN:
            case RACIAL_TYPE_HALFELF: fHeight = 1.7; fDistance = 0.12; break;
            case RACIAL_TYPE_ELF: fHeight = 1.55; fDistance = 0.08; break;
            case RACIAL_TYPE_GNOME:
            case RACIAL_TYPE_HALFLING: fHeight = 1.15; fDistance = 0.12; break;
            case RACIAL_TYPE_DWARF: fHeight = 1.2; fDistance = 0.12; break;
            case RACIAL_TYPE_HALFORC: fHeight = 1.9; fDistance = 0.2; break;
        }
    }
    else
    {
        // FEMALES
        switch (GetRacialType(oActivator))
        {
            case RACIAL_TYPE_HUMAN:
            case RACIAL_TYPE_HALFELF: fHeight = 1.6; fDistance = 0.12; break;
            case RACIAL_TYPE_ELF: fHeight = 1.45; fDistance = 0.12; break;
            case RACIAL_TYPE_GNOME:
            case RACIAL_TYPE_HALFLING: fHeight = 1.1; fDistance = 0.075; break;
            case RACIAL_TYPE_DWARF: fHeight = 1.2; fDistance = 0.1; break;
            case RACIAL_TYPE_HALFORC: fHeight = 1.8; fDistance = 0.13; break;
        }
    }
    location lAboveHead = GetLocationAboveAndInFrontOf(oActivator, fDistance, fHeight);
    // emotes
    switch (d3())
    {
        case 1: AssignCommand(oActivator, ActionSpeakString(sEmote1)); break;
        case 2: AssignCommand(oActivator, ActionSpeakString(sEmote2)); break;
        case 3: AssignCommand(oActivator, ActionSpeakString(sEmote3));break;
    }
    // glow red
    AssignCommand(oActivator, ActionDoCommand(ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_LIGHT_RED_5), oActivator, 0.15)));
    // wait a moment
    AssignCommand(oActivator, ActionWait(3.0));
    // puff of smoke above and in front of head
    AssignCommand(oActivator, ActionDoCommand(ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SMOKE_PUFF), lAboveHead)));
    // if female, turn head to left
    if ((GetGender(oActivator) == GENDER_FEMALE) && (GetRacialType(oActivator) != RACIAL_TYPE_DWARF))
        AssignCommand(oActivator, ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_LEFT, 1.0, 5.0));
}

void ParseEmote(string sEmote, object oPC)
{
    DeleteLocalInt(oPC, "dmfi_univ_int");
    object oRightHand = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC);
    object oLeftHand =  GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC);
    //PrintString("<Conv>"+GetName(GetArea(oPC))+ " " + GetName(oPC) + ": " + sEmote + " </Conv>");
    if (!GetIsPC(oPC)) AssignCommand(oPC, SpeakString(sEmote));

    if (GetStringLeft(sEmote, 1) == "*")
    {
        int iToggle;
        string sBuffer;
        sBuffer = GetStringRight(sEmote, GetStringLength(sEmote)-1);
        while (!iToggle && GetStringLength(sBuffer) > 1)
        {
            if (GetStringLeft(sBuffer,1) == "*")
                iToggle = abs(iToggle - 1);
            sBuffer = GetStringRight(sBuffer, GetStringLength(sBuffer)-1);
        }
        sEmote = GetStringLeft(sEmote, GetStringLength(sEmote)-GetStringLength(sBuffer));
    }

    int iSit;
    object oArea;
    object oChair;

    //*emote* rolls
    if ((FindSubString(sEmote, "Strength") != -1) ||
        (FindSubString(sEmote, "strength") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 61);
    else if ((FindSubString(sEmote, "Dexterity") != -1)||
             (FindSubString(sEmote, "dexterity") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 62);
    else if ((FindSubString(sEmote, "Constitution") != -1)||
           (FindSubString(sEmote, "constitution") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 63);
    else if ((FindSubString(sEmote, "Intelligence") != -1)||
            (FindSubString(sEmote, "intelligence") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 64);
    else if ((FindSubString(sEmote, "Wisdom") != -1) ||
            (FindSubString(sEmote, "wisdom") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 65);
    else if ((FindSubString(sEmote, "Charisma") != -1)||
            (FindSubString(sEmote, "charisma") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 66);
    else if ((FindSubString(sEmote, "Fortitude") != -1)||
           (FindSubString(sEmote, "fortitude") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 67);
    else if ((FindSubString(sEmote, "Reflex") != -1) ||
            (FindSubString(sEmote, "reflex") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 68);
    else if ((FindSubString(sEmote, "Will") != -1) ||
            (FindSubString(sEmote, "will") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 69);
    else if ((FindSubString(sEmote, "Animal Empathy") != -1)||
           (FindSubString(sEmote, "animal empathy") != -1)||
           (FindSubString(sEmote, "Animal Empathy") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 71);
    else if ((FindSubString(sEmote, "Appraise") != -1)||
            (FindSubString(sEmote, "appraise") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 72);
     else if ((FindSubString(sEmote, "Bluff") != -1) ||
             (FindSubString(sEmote, "bluff") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 73);
    else if ((FindSubString(sEmote, "Concentration") != -1) ||
            (FindSubString(sEmote, "concentration") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 74);
     else if ((FindSubString(sEmote, "Craft Armor") != -1) ||
            (FindSubString(sEmote, "Craft armor") != -1)||
            (FindSubString(sEmote, "craft armor") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 75);
     else if ((FindSubString(sEmote, "Craft Trap") != -1) ||
             (FindSubString(sEmote, "Craft trap") != -1)||
             (FindSubString(sEmote, "craft trap") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 76);
     else if ((FindSubString(sEmote, "Craft Weapon") != -1) ||
             (FindSubString(sEmote, "Craft weapon") != -1)||
             (FindSubString(sEmote, "craft weapon") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 77);
     else if ((FindSubString(sEmote, "Disable Trap") != -1) ||
             (FindSubString(sEmote, "Disable trap") != -1)||
             (FindSubString(sEmote, "disable trap") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 78);
    else if ((FindSubString(sEmote, "Discipline") != -1)||
            (FindSubString(sEmote, "discipline") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 79);
    else if ((FindSubString(sEmote, "Heal") != -1)||
             (FindSubString(sEmote, "heal") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 81);
    else if ((FindSubString(sEmote, "Hide") != -1)||
             (FindSubString(sEmote, "hide") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 82);
    else if ((FindSubString(sEmote, "Intimidate") != -1) ||
             (FindSubString(sEmote, "intimidate") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 83);
    else if ((FindSubString(sEmote, "Listen") != -1)||
             (FindSubString(sEmote, "listen") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 84);
    else if ((FindSubString(sEmote, "Lore") != -1)||
             (FindSubString(sEmote, "lore") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 85);
    else if ((FindSubString(sEmote, "Move Silently") != -1)||
            (FindSubString(sEmote, "Move silently") != -1)||
            (FindSubString(sEmote, "move silently") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 86);
    else if ((FindSubString(sEmote, "Open Lock") != -1)||
             (FindSubString(sEmote, "Open lock") != -1)||
             (FindSubString(sEmote, "open lock") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 87);
    else if ((FindSubString(sEmote, "Parry") != -1)||
            (FindSubString(sEmote, "parry") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 88);
    else if ((FindSubString(sEmote, "Perform") != -1)||
            (FindSubString(sEmote, "perform") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 89);
    else if ((FindSubString(sEmote, "Persuade") != -1) ||
            (FindSubString(sEmote, "persuade") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 91);
    else if ((FindSubString(sEmote, "Pickpocket") != -1) ||
             (FindSubString(sEmote, "Pick Pocket") != -1) ||
             (FindSubString(sEmote, "pickpocket") != -1)||
             (FindSubString(sEmote, "Pick pocket") != -1)||
             (FindSubString(sEmote, "pick pocket") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 92);
    else if ((FindSubString(sEmote, "Search") != -1)||
            (FindSubString(sEmote, "search") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 93);
    else if ((FindSubString(sEmote, "Set Trap") != -1)||
            (FindSubString(sEmote, "Set trap") != -1)||
            (FindSubString(sEmote, "set trap") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 94);
    else if ((FindSubString(sEmote, "Spellcraft") != -1)||
             (FindSubString(sEmote, "spellcraft") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 95);
    else if ((FindSubString(sEmote, "Spot") != -1)||
             (FindSubString(sEmote, "spot") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 96);
    else if ((FindSubString(sEmote, "Taunt") != -1)||
            (FindSubString(sEmote, "taunt") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 97);
    else if ((FindSubString(sEmote, "Tumble") != -1)||
             (FindSubString(sEmote, "tumble") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 98);
    else if ((FindSubString(sEmote, "Use Magic Device") != -1)||
            (FindSubString(sEmote, "use magic device") != -1)||
            (FindSubString(sEmote, "Use magic device") != -1))
        SetLocalInt(oPC, "dmfi_univ_int", 99);

    if (GetLocalInt(oPC, "dmfi_univ_int"))
    {
        SetLocalString(oPC, "dmfi_univ_conv", "pc_dicebag");
        ExecuteScript("dmfi_execute", oPC);
        return;
    }

    //*emote*
    if (FindSubString(GetStringLowerCase(sEmote), "*bows") != -1 ||
        FindSubString(GetStringLowerCase(sEmote), " bows") != -1 ||
        FindSubString(GetStringLowerCase(sEmote), "curtsey") != -1)
        AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_BOW, 1.0));
    else if (FindSubString(GetStringLowerCase(sEmote), "drink") != -1 ||
             FindSubString(GetStringLowerCase(sEmote), "sips") != -1)
            AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_DRINK, 1.0));
    else if (FindSubString(GetStringLowerCase(sEmote), "drinks") != -1 &&
             FindSubString(GetStringLowerCase(sEmote), "sits") != -1)
             {
                AssignCommand(oPC, ActionPlayAnimation( ANIMATION_LOOPING_SIT_CROSS, 1.0, 99999.0f));
                DelayCommand(1.0f, AssignCommand(oPC, PlayAnimation( ANIMATION_FIREFORGET_DRINK, 1.0)));
                DelayCommand(3.0f, AssignCommand(oPC, PlayAnimation( ANIMATION_LOOPING_SIT_CROSS, 1.0, 99999.0)));
             }
    else if (FindSubString(GetStringLowerCase(sEmote), "reads") != -1 &&
             FindSubString(GetStringLowerCase(sEmote), "sits") != -1)
             {
                AssignCommand(oPC, ActionPlayAnimation( ANIMATION_LOOPING_SIT_CROSS, 1.0, 99999.0f));
                DelayCommand(1.0f, AssignCommand(oPC, PlayAnimation( ANIMATION_FIREFORGET_READ, 1.0)));
                DelayCommand(3.0f, AssignCommand(oPC, PlayAnimation( ANIMATION_LOOPING_SIT_CROSS, 1.0, 99999.0)));
             }
    else if (FindSubString(GetStringLowerCase(sEmote), "sit")!= -1)
            {
            AssignCommand(oPC, ActionPlayAnimation( ANIMATION_LOOPING_SIT_CROSS, 1.0, 99999.0f));
            }
    else if (FindSubString(GetStringLowerCase(sEmote), "greet")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), "wave") != -1)
        AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_GREETING, 1.0));
    else if (FindSubString(GetStringLowerCase(sEmote), "yawn")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), "stretch") != -1 ||
             FindSubString(GetStringLowerCase(sEmote), "bored") != -1)
        AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_PAUSE_BORED, 1.0));
    else if (FindSubString(GetStringLowerCase(sEmote), "scratch")!= -1)
    {
        AssignCommand(oPC,ActionUnequipItem(oRightHand));
        AssignCommand(oPC,ActionUnequipItem(oLeftHand));
        AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_PAUSE_SCRATCH_HEAD, 1.0));
    }
    else if (FindSubString(GetStringLowerCase(sEmote), "*reads")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), " reads")!= -1||
             FindSubString(GetStringLowerCase(sEmote), "read")!= -1)
        AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_READ, 1.0));
    else if (FindSubString(GetStringLowerCase(sEmote), "salute")!= -1)
    {
        AssignCommand(oPC,ActionUnequipItem(oRightHand));
        AssignCommand(oPC,ActionUnequipItem(oLeftHand));
        AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_SALUTE, 1.0));
    }
    else if (FindSubString(GetStringLowerCase(sEmote), "steal")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), "swipe") != -1)
        AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_STEAL, 1.0));
    else if (FindSubString(GetStringLowerCase(sEmote), "taunt")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), "mock") != -1)
    {
        PlayVoiceChat(VOICE_CHAT_TAUNT, oPC);
        AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_TAUNT, 1.0));
    }
    else if ((FindSubString(GetStringLowerCase(sEmote), "smokes") != -1)||
            (FindSubString(GetStringLowerCase(sEmote), "smoke") != -1))
    {
        SmokePipe(oPC);
    }
    else if (FindSubString(GetStringLowerCase(sEmote), "cheer ")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), "cheer*")!= -1)
    {
        PlayVoiceChat(VOICE_CHAT_CHEER, oPC);
        AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_VICTORY1, 1.0));
    }
    else if (FindSubString(GetStringLowerCase(sEmote), "hooray")!= -1)
    {
        PlayVoiceChat(VOICE_CHAT_CHEER, oPC);
        AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_VICTORY2, 1.0));
    }
    else if (FindSubString(GetStringLowerCase(sEmote), "celebrate")!= -1)
    {
        PlayVoiceChat(VOICE_CHAT_CHEER, oPC);
        AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_VICTORY3, 1.0));
    }
    else if (FindSubString(GetStringLowerCase(sEmote), "giggle")!= -1 && GetGender(oPC) == GENDER_FEMALE)
        AssignCommand(oPC, PlaySound("vs_fshaldrf_haha"));
    else if (FindSubString(GetStringLowerCase(sEmote), "flop")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), "prone")!= -1)
        AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_DEAD_FRONT, 1.0, 99999.0));
    else if (FindSubString(GetStringLowerCase(sEmote), "bends")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), "stoop")!= -1)
        AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0, 99999.0));
    else if (FindSubString(GetStringLowerCase(sEmote), "fiddle")!= -1)
        AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_GET_MID, 1.0, 5.0));
    else if (FindSubString(GetStringLowerCase(sEmote), "nod")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), "agree")!= -1)
        AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_LISTEN, 1.0, 4.0));
    else if (FindSubString(GetStringLowerCase(sEmote), "peers")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), "scans")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), "search")!= -1)
        AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_LOOK_FAR, 1.0, 99999.0));
    else if (FindSubString(GetStringLowerCase(sEmote), "*pray")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), " pray")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), "meditate")!= -1)
    {
        AssignCommand(oPC,ActionUnequipItem(oRightHand));
        AssignCommand(oPC,ActionUnequipItem(oLeftHand));
        AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_MEDITATE, 1.0, 99999.0));
    }
    else if (FindSubString(GetStringLowerCase(sEmote), "drunk")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), "woozy")!= -1)
        AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_PAUSE_DRUNK, 1.0, 99999.0));
    else if (FindSubString(GetStringLowerCase(sEmote), "tired")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), "fatigue")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), "exhausted")!= -1)
    {
        PlayVoiceChat(VOICE_CHAT_REST, oPC);
        AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_PAUSE_TIRED, 1.0, 3.0));
    }
    else if (FindSubString(GetStringLowerCase(sEmote), "fidget")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), "shifts")!= -1)
        AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_PAUSE2, 1.0, 99999.0));
    else if (FindSubString(GetStringLowerCase(sEmote), "sits")!= -1 &&
             (FindSubString(GetStringLowerCase(sEmote), "floor")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), "ground")!= -1))
        AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_SIT_CROSS, 1.0, 99999.0));
    else if (FindSubString(GetStringLowerCase(sEmote), "demand")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), "threaten")!= -1)
        AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_TALK_FORCEFUL, 1.0, 99999.0));
    else if (FindSubString(GetStringLowerCase(sEmote), "laugh")!= -1 ||
            FindSubString(GetStringLowerCase(sEmote), "chuckle")!= -1)
    {
        PlayVoiceChat(VOICE_CHAT_LAUGH, oPC);
        AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_TALK_LAUGHING, 1.0, 2.0));
    }
    else if (FindSubString(GetStringLowerCase(sEmote), "begs")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), "plead")!= -1)
        AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_TALK_PLEADING, 1.0, 99999.0));
    else if (FindSubString(GetStringLowerCase(sEmote), "worship")!= -1)
        AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_WORSHIP, 1.0, 99999.0));
    else if (FindSubString(GetStringLowerCase(sEmote), "snore")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), "*naps")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), " naps")!= -1||
             FindSubString(GetStringLowerCase(sEmote), "nap")!= -1)
        ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_SLEEP), oPC);
    else if (FindSubString(GetStringLowerCase(sEmote), "*sings")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), " sings")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), "hums")!= -1)
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_BARD_SONG), oPC, 6.0f);
    else if (FindSubString(GetStringLowerCase(sEmote), "whistles")!= -1)
        AssignCommand(oPC, PlaySound("as_pl_whistle2"));
    else if (FindSubString(GetStringLowerCase(sEmote), "talks")!= -1 ||
             FindSubString(GetStringLowerCase(sEmote), "chats")!= -1)
        AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_TALK_NORMAL, 1.0, 99999.0));
    else if (FindSubString(GetStringLowerCase(sEmote), "shakes head")!= -1)
    {
        AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_LEFT, 1.0, 0.25f));
        DelayCommand(0.15f, AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_RIGHT, 1.0, 0.25f)));
        DelayCommand(0.40f, AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_LEFT, 1.0, 0.25f)));
        DelayCommand(0.65f, AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_RIGHT, 1.0, 0.25f)));
    }
    else if (FindSubString(GetStringLowerCase(sEmote), "ducks")!= -1)
        AssignCommand(oPC, ActionPlayAnimation(ANIMATION_FIREFORGET_DODGE_DUCK, 1.0, 99999.0));
    else if (FindSubString(GetStringLowerCase(sEmote), "dodge")!= -1)
        AssignCommand(oPC, ActionPlayAnimation(ANIMATION_FIREFORGET_DODGE_SIDE, 1.0, 99999.0));
    else if (FindSubString(GetStringLowerCase(sEmote), "cantrip")!= -1)
        AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_CONJURE1, 1.0, 99999.0));
    else if (FindSubString(GetStringLowerCase(sEmote), "spellcast")!= -1)
        AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_CONJURE2, 1.0, 99999.0));
    else if (FindSubString(GetStringLowerCase(sEmote), "fall")!= -1 &&
             FindSubString(GetStringLowerCase(sEmote), "back")!= -1)
        AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_DEAD_BACK, 1.0, 99999.0));
    else if (FindSubString(GetStringLowerCase(sEmote), "spasm")!= -1)
        AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_SPASM, 1.0, 99999.0));
}

string ConvertDrow(string sLetter)
{
    if (GetStringLength(sLetter) > 1)
        sLetter = GetStringLeft(sLetter, 1);
    string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    int iTrans = FindSubString(sTranslate, sLetter);

    switch (iTrans)
    {
    case 0: return "il";
    case 26: return "Il";
    case 1: return "f";
    case 2: return "st";
    case 28: return "St";
    case 3: return "w";
    case 4: return "a";
    case 5: return "o";
    case 6: return "v";
    case 7: return "ir";
    case 33: return "Ir";
    case 8: return "e";
    case 9: return "vi";
    case 35: return "Vi";
    case 10: return "go";
    case 11: return "c";
    case 12: return "li";
    case 13: return "l";
    case 14: return "e";
    case 15: return "ty";
    case 41: return "Ty";
    case 16: return "r";
    case 17: return "m";
    case 18: return "la";
    case 44: return "La";
    case 19: return "an";
    case 45: return "An";
    case 20: return "y";
    case 21: return "el";
    case 47: return "El";
    case 22: return "ky";
    case 48: return "Ky";
    case 23: return "'";
    case 24: return "a";
    case 25: return "p'";
    case 27: return "F";
    case 29: return "W";
    case 30: return "A";
    case 31: return "O";
    case 32: return "V";
    case 34: return "E";
    case 36: return "Go";
    case 37: return "C";
    case 38: return "Li";
    case 39: return "L";
    case 40: return "E";
    case 42: return "R";
    case 43: return "M";
    case 46: return "Y";
    case 49: return "'";
    case 50: return "A";
    case 51: return "P'";

    default: return sLetter; } return "";
}

string ProcessDrow(string sPhrase)
{
    string sOutput;
    int iToggle;
    while (GetStringLength(sPhrase) > 1)
    {
        if (GetStringLeft(sPhrase,1) == "*")
            iToggle = abs(iToggle - 1);
        if (iToggle)
            sOutput = sOutput + GetStringLeft(sPhrase,1);
        else
            sOutput = sOutput + ConvertDrow(GetStringLeft(sPhrase, 1));

        sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1);
    }
    return sOutput;
}



string ConvertLeetspeak(string sLetter)
{
    if (GetStringLength(sLetter) > 1)
        sLetter = GetStringLeft(sLetter, 1);
    string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    int iTrans = FindSubString(sTranslate, sLetter);

    switch (iTrans)
    {
    case 0: return "4";
    case 26: return "4";
    case 1: return "8";
    case 27: return "8";
    case 2: return "(";
    case 28: return "(";
    case 3: return "|)";
    case 29: return "|)";
    case 4: return "3";
    case 30: return "3";
    case 5: return "f";
    case 31: return "F";
    case 6: return "9";
    case 32: return "9";
    case 7: return "h";
    case 33: return "H";
    case 8: return "!";
    case 34: return "!";
    case 9: return "j";
    case 35: return "J";
    case 10: return "|<";
    case 36: return "|<";
    case 11: return "1";
    case 37: return "1";
    case 12: return "/\/\/";
    case 38: return "/\/\/";
    case 13: return "|\|";
    case 39: return "|\|";
    case 14: return "0";
    case 40: return "0";
    case 15: return "p";
    case 41: return "P";
    case 16: return "Q";
    case 42: return "Q";
    case 17: return "R";
    case 43: return "R";
    case 18: return "5";
    case 44: return "5";
    case 19: return "7";
    case 45: return "7";
    case 20: return "u";
    case 46: return "U";
    case 21: return "\/";
    case 47: return "\/";
    case 22: return "\/\/";
    case 48: return "\/\/";
    case 23: return "x";
    case 49: return "X";
    case 24: return "y";
    case 50: return "Y";
    case 25: return "2";
    case 51: return "2";
    default: return sLetter;
    }
    return "";
}//end ConvertLeetspeak

string ProcessLeetspeak(string sPhrase)
{
    string sOutput;
    int iToggle;
    while (GetStringLength(sPhrase) > 1)
    {
        if (GetStringLeft(sPhrase,1) == "*")
            iToggle = abs(iToggle - 1);
        if (iToggle)
            sOutput = sOutput + GetStringLeft(sPhrase,1);
        else
            sOutput = sOutput + ConvertLeetspeak(GetStringLeft(sPhrase, 1));
        sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1);
    }
    return sOutput;
}

string ConvertInfernal(string sLetter)
{
    if (GetStringLength(sLetter) > 1)
        sLetter = GetStringLeft(sLetter, 1);
    string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    int iTrans = FindSubString(sTranslate, sLetter);

    switch (iTrans)
    {
    case 0: return "o";
    case 1: return "c";
    case 2: return "r";
    case 3: return "j";
    case 4: return "a";
    case 5: return "v";
    case 6: return "k";
    case 7: return "r";
    case 8: return "y";
    case 9: return "z";
    case 10: return "g";
    case 11: return "m";
    case 12: return "z";
    case 13: return "r";
    case 14: return "y";
    case 15: return "k";
    case 16: return "r";
    case 17: return "n";
    case 18: return "k";
    case 19: return "d";
    case 20: return "'";
    case 21: return "r";
    case 22: return "'";
    case 23: return "k";
    case 24: return "i";
    case 25: return "g";
    case 26: return "O";
    case 27: return "C";
    case 28: return "R";
    case 29: return "J";
    case 30: return "A";
    case 31: return "V";
    case 32: return "K";
    case 33: return "R";
    case 34: return "Y";
    case 35: return "Z";
    case 36: return "G";
    case 37: return "M";
    case 38: return "Z";
    case 39: return "R";
    case 40: return "Y";
    case 41: return "K";
    case 42: return "R";
    case 43: return "N";
    case 44: return "K";
    case 45: return "D";
    case 46: return "'";
    case 47: return "R";
    case 48: return "'";
    case 49: return "K";
    case 50: return "I";
    case 51: return "G";
    default: return sLetter;
    }
    return "";
}//end ConvertInfernal

string ProcessInfernal(string sPhrase)
{
    string sOutput;
    int iToggle;
    while (GetStringLength(sPhrase) > 1)
    {
        if (GetStringLeft(sPhrase,1) == "*")
            iToggle = abs(iToggle - 1);
        if (iToggle)
            sOutput = sOutput + GetStringLeft(sPhrase,1);
        else
            sOutput = sOutput + ConvertInfernal(GetStringLeft(sPhrase, 1));
        sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1);
    }
    return sOutput;
}

string ConvertAbyssal(string sLetter)
{
    if (GetStringLength(sLetter) > 1)
        sLetter = GetStringLeft(sLetter, 1);
    string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    int iTrans = FindSubString(sTranslate, sLetter);

    switch (iTrans)
    {
    case 27: return "N";
    case 28: return "M";
    case 29: return "G";
    case 30: return "A";
    case 31: return "K";
    case 32: return "S";
    case 33: return "D";
    case 35: return "H";
    case 36: return "B";
    case 37: return "L";
    case 38: return "P";
    case 39: return "T";
    case 40: return "E";
    case 41: return "B";
    case 43: return "N";
    case 44: return "M";
    case 45: return "G";
    case 48: return "B";
    case 51: return "T";
    case 0: return "oo";
    case 26: return "OO";
    case 1: return "n";
    case 2: return "m";
    case 3: return "g";
    case 4: return "a";
    case 5: return "k";
    case 6: return "s";
    case 7: return "d";
    case 8: return "oo";
    case 34: return "OO";
    case 9: return "h";
    case 10: return "b";
    case 11: return "l";
    case 12: return "p";
    case 13: return "t";
    case 14: return "e";
    case 15: return "b";
    case 16: return "ch";
    case 42: return "Ch";
    case 17: return "n";
    case 18: return "m";
    case 19: return "g";
    case 20: return  "ae";
    case 46: return  "Ae";
    case 21: return  "ts";
    case 47: return  "Ts";
    case 22: return "b";
    case 23: return  "bb";
    case 49: return  "Bb";
    case 24: return  "ee";
    case 50: return  "Ee";
    case 25: return "t";
    default: return sLetter;
    }
    return "";
}//end ConvertAbyssal

string ProcessAbyssal(string sPhrase)
{
    string sOutput;
    int iToggle;
    while (GetStringLength(sPhrase) > 1)
    {
        if (GetStringLeft(sPhrase,1) == "*")
            iToggle = abs(iToggle - 1);
        if (iToggle)
            sOutput = sOutput + GetStringLeft(sPhrase,1);
        else
            sOutput = sOutput + ConvertAbyssal(GetStringLeft(sPhrase, 1));
        sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1);
    }
    return sOutput;
}

string ConvertCelestial(string sLetter)
{
    if (GetStringLength(sLetter) > 1)
        sLetter = GetStringLeft(sLetter, 1);
    string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    int iTrans = FindSubString(sTranslate, sLetter);

    switch (iTrans)
    {
    case 0: return "a";
    case 1: return "p";
    case 2: return "v";
    case 3: return "t";
    case 4: return "el";
    case 5: return "b";
    case 6: return "w";
    case 7: return "r";
    case 8: return "i";
    case 9: return "m";
    case 10: return "x";
    case 11: return "h";
    case 12: return "s";
    case 13: return "c";
    case 14: return "u";
    case 15: return "q";
    case 16: return "d";
    case 17: return "n";
    case 18: return "l";
    case 19: return "y";
    case 20: return "o";
    case 21: return "j";
    case 22: return "f";
    case 23: return "g";
    case 24: return "z";
    case 25: return "k";
    case 26: return "A";
    case 27: return "P";
    case 28: return "V";
    case 29: return "T";
    case 30: return "El";
    case 31: return "B";
    case 32: return "W";
    case 33: return "R";
    case 34: return "I";
    case 35: return "M";
    case 36: return "X";
    case 37: return "H";
    case 38: return "S";
    case 39: return "C";
    case 40: return "U";
    case 41: return "Q";
    case 42: return "D";
    case 43: return "N";
    case 44: return "L";
    case 45: return "Y";
    case 46: return "O";
    case 47: return "J";
    case 48: return "F";
    case 49: return "G";
    case 50: return "Z";
    case 51: return "K";
    default: return sLetter;
    }
    return "";
}//end ConvertCelestial

string ProcessCelestial(string sPhrase)
{
    string sOutput;
    int iToggle;
    while (GetStringLength(sPhrase) > 1)
    {
        if (GetStringLeft(sPhrase,1) == "*")
            iToggle = abs(iToggle - 1);
        if (iToggle)
            sOutput = sOutput + GetStringLeft(sPhrase,1);
        else
            sOutput = sOutput + ConvertCelestial(GetStringLeft(sPhrase, 1));
        sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1);
    }
    return sOutput;
}

string ConvertGoblin(string sLetter)
{
    if (GetStringLength(sLetter) > 1)
        sLetter = GetStringLeft(sLetter, 1);
    string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    int iTrans = FindSubString(sTranslate, sLetter);

    switch (iTrans)
    {
    case 0: return "u";
    case 1: return "p";
    case 2: return "";
    case 3: return "t";
    case 4: return "'";
    case 5: return "v";
    case 6: return "k";
    case 7: return "r";
    case 8: return "o";
    case 9: return "z";
    case 10: return "g";
    case 11: return "m";
    case 12: return "s";
    case 13: return "";
    case 14: return "u";
    case 15: return "b";
    case 16: return "";
    case 17: return "n";
    case 18: return "k";
    case 19: return "d";
    case 20: return "u";
    case 21: return "";
    case 22: return "'";
    case 23: return "";
    case 24: return "o";
    case 25: return "w";

    case 26: return "U";
    case 27: return "P";
    case 28: return "";
    case 29: return "T";
    case 30: return "'";
    case 31: return "V";
    case 32: return "K";
    case 33: return "R";
    case 34: return "O";
    case 35: return "Z";
    case 36: return "G";
    case 37: return "M";
    case 38: return "S";
    case 39: return "";
    case 40: return "U";
    case 41: return "B";
    case 42: return "";
    case 43: return "N";
    case 44: return "K";
    case 45: return "D";
    case 46: return "U";
    case 47: return "";
    case 48: return "'";
    case 49: return "";
    case 50: return "O";
    case 51: return "W";
    default: return sLetter;
    }
    return "";
}//end ConvertGoblin

string ProcessGoblin(string sPhrase)
{
    string sOutput;
    int iToggle;
    while (GetStringLength(sPhrase) > 1)
    {
        if (GetStringLeft(sPhrase,1) == "*")
            iToggle = abs(iToggle - 1);
        if (iToggle)
            sOutput = sOutput + GetStringLeft(sPhrase,1);
        else
            sOutput = sOutput + ConvertGoblin(GetStringLeft(sPhrase, 1));
        sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1);
    }
    return sOutput;
}

string ConvertDraconic(string sLetter)
{
    if (GetStringLength(sLetter) > 1)
        sLetter = GetStringLeft(sLetter, 1);
    string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    int iTrans = FindSubString(sTranslate, sLetter);

    switch (iTrans)
    {
    case 0: return "e";
    case 26: return "E";
    case 1: return "po";
    case 27: return "Po";
    case 2: return "st";
    case 28: return "St";
    case 3: return "ty";
    case 29: return "Ty";
    case 4: return "i";
    case 5: return "w";
    case 6: return "k";
    case 7: return "ni";
    case 33: return "Ni";
    case 8: return "un";
    case 34: return "Un";
    case 9: return "vi";
    case 35: return "Vi";
    case 10: return "go";
    case 36: return "Go";
    case 11: return "ch";
    case 37: return "Ch";
    case 12: return "li";
    case 38: return "Li";
    case 13: return "ra";
    case 39: return "Ra";
    case 14: return "y";
    case 15: return "ba";
    case 41: return "Ba";
    case 16: return "x";
    case 17: return "hu";
    case 43: return "Hu";
    case 18: return "my";
    case 44: return "My";
    case 19: return "dr";
    case 45: return "Dr";
    case 20: return "on";
    case 46: return "On";
    case 21: return "fi";
    case 47: return "Fi";
    case 22: return "zi";
    case 48: return "Zi";
    case 23: return "qu";
    case 49: return "Qu";
    case 24: return "an";
    case 50: return "An";
    case 25: return "ji";
    case 51: return "Ji";
    case 30: return "I";
    case 31: return "W";
    case 32: return "K";
    case 40: return "Y";
    case 42: return "X";
    default: return sLetter;
    }
    return "";
}//end ConvertDraconic

string ProcessDraconic(string sPhrase)
{
    string sOutput;
    int iToggle;
    while (GetStringLength(sPhrase) > 1)
    {
        if (GetStringLeft(sPhrase,1) == "*")
            iToggle = abs(iToggle - 1);
        if (iToggle)
            sOutput = sOutput + GetStringLeft(sPhrase,1);
        else
            sOutput = sOutput + ConvertDraconic(GetStringLeft(sPhrase, 1));
        sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1);
    }
    return sOutput;
}

string ConvertDwarf(string sLetter)
{
    if (GetStringLength(sLetter) > 1)
        sLetter = GetStringLeft(sLetter, 1);
    string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    int iTrans = FindSubString(sTranslate, sLetter);

    switch (iTrans)
    {
    case 0: return "az";
    case 26: return "Az";
    case 1: return "po";
    case 27: return "Po";
    case 2: return "zi";
    case 28: return "Zi";
    case 3: return "t";
    case 4: return "a";
    case 5: return "wa";
    case 31: return "Wa";
    case 6: return "k";
    case 7: return "'";
    case 8: return "a";
    case 9: return "dr";
    case 35: return "Dr";
    case 10: return "g";
    case 11: return "n";
    case 12: return "l";
    case 13: return "r";
    case 14: return "ur";
    case 40: return "Ur";
    case 15: return "rh";
    case 41: return "Rh";
    case 16: return "k";
    case 17: return "h";
    case 18: return "th";
    case 44: return "Th";
    case 19: return "k";
    case 20: return "'";
    case 21: return "g";
    case 22: return "zh";
    case 48: return "Zh";
    case 23: return "q";
    case 24: return "o";
    case 25: return "j";
    case 29: return "T";
    case 30: return "A";
    case 32: return "K";
    case 33: return "'";
    case 34: return "A";
    case 36: return "G";
    case 37: return "N";
    case 38: return "L";
    case 39: return "R";
    case 42: return "K";
    case 43: return "H";
    case 45: return "K";
    case 46: return "'";
    case 47: return "G";
    case 49: return "Q";
    case 50: return "O";
    case 51: return "J";
    default: return sLetter; } return "";
}//end ConvertDwarf

string ProcessDwarf(string sPhrase)
{
    string sOutput;
    int iToggle;
    while (GetStringLength(sPhrase) > 1)
    {
        if (GetStringLeft(sPhrase,1) == "*")
            iToggle = abs(iToggle - 1);
        if (iToggle)
            sOutput = sOutput + GetStringLeft(sPhrase,1);
        else
            sOutput = sOutput + ConvertDwarf(GetStringLeft(sPhrase, 1));
        sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1);
    }
    return sOutput;
}

string ConvertElven(string sLetter)
{
    if (GetStringLength(sLetter) > 1)
        sLetter = GetStringLeft(sLetter, 1);
    string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    int iTrans = FindSubString(sTranslate, sLetter);

    switch (iTrans)
    {
    case 0: return "il";
    case 26: return "Il";
    case 1: return "f";
    case 2: return "ny";
    case 28: return "Ny";
    case 3: return "w";
    case 4: return "a";
    case 5: return "o";
    case 6: return "v";
    case 7: return "ir";
    case 33: return "Ir";
    case 8: return "e";
    case 9: return "qu";
    case 35: return "Qu";
    case 10: return "n";
    case 11: return "c";
    case 12: return "s";
    case 13: return "l";
    case 14: return "e";
    case 15: return "ty";
    case 41: return "Ty";
    case 16: return "h";
    case 17: return "m";
    case 18: return "la";
    case 44: return "La";
    case 19: return "an";
    case 45: return "An";
    case 20: return "y";
    case 21: return "el";
    case 47: return "El";
    case 22: return "am";
    case 48: return "Am";
    case 23: return "'";
    case 24: return "a";
    case 25: return "j";

    case 27: return "F";
    case 29: return "W";
    case 30: return "A";
    case 31: return "O";
    case 32: return "V";
    case 34: return "E";
    case 36: return "N";
    case 37: return "C";
    case 38: return "S";
    case 39: return "L";
    case 40: return "E";
    case 42: return "H";
    case 43: return "M";
    case 46: return "Y";
    case 49: return "'";
    case 50: return "A";
    case 51: return "J";

    default: return sLetter; } return "";
}

string ProcessElven(string sPhrase)
{
    string sOutput;
    int iToggle;
    while (GetStringLength(sPhrase) > 1)
    {
        if (GetStringLeft(sPhrase,1) == "*")
            iToggle = abs(iToggle - 1);
        if (iToggle)
            sOutput = sOutput + GetStringLeft(sPhrase,1);
        else
            sOutput = sOutput + ConvertElven(GetStringLeft(sPhrase, 1));
        sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1);
    }
    return sOutput;
}

string ConvertGnome(string sLetter)
{
    if (GetStringLength(sLetter) > 1)
        sLetter = GetStringLeft(sLetter, 1);
    string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    int iTrans = FindSubString(sTranslate, sLetter);

    switch (iTrans)
    {
//cipher based on English -> Al Baed
    case 0: return "y";
    case 1: return "p";
    case 2: return "l";
    case 3: return "t";
    case 4: return "a";
    case 5: return "v";
    case 6: return "k";
    case 7: return "r";
    case 8: return "e";
    case 9: return "z";
    case 10: return "g";
    case 11: return "m";
    case 12: return "s";
    case 13: return "h";
    case 14: return "u";
    case 15: return "b";
    case 16: return "x";
    case 17: return "n";
    case 18: return "c";
    case 19: return "d";
    case 20: return "i";
    case 21: return "j";
    case 22: return "f";
    case 23: return "q";
    case 24: return "o";
    case 25: return "w";

    case 26: return "Y";
    case 27: return "P";
    case 28: return "L";
    case 29: return "T";
    case 30: return "A";
    case 31: return "V";
    case 32: return "K";
    case 33: return "R";
    case 34: return "E";
    case 35: return "Z";
    case 36: return "G";
    case 37: return "M";
    case 38: return "S";
    case 39: return "H";
    case 40: return "U";
    case 41: return "B";
    case 42: return "X";
    case 43: return "N";
    case 44: return "C";
    case 45: return "D";
    case 46: return "I";
    case 47: return "J";
    case 48: return "F";
    case 49: return "Q";
    case 50: return "O";
    case 51: return "W";
    default: return sLetter; } return "";
}

string ProcessGnome(string sPhrase)
{
    string sOutput;
    int iToggle;
    while (GetStringLength(sPhrase) > 1)
    {
        if (GetStringLeft(sPhrase,1) == "*")
            iToggle = abs(iToggle - 1);
        if (iToggle)
            sOutput = sOutput + GetStringLeft(sPhrase,1);
        else
            sOutput = sOutput + ConvertGnome(GetStringLeft(sPhrase, 1));
        sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1);
    }
    return sOutput;
}

string ConvertHalfling(string sLetter)
{
    if (GetStringLength(sLetter) > 1)
        sLetter = GetStringLeft(sLetter, 1);
    string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    int iTrans = FindSubString(sTranslate, sLetter);

    switch (iTrans)
    {
//cipher based on Al Baed -> English
    case 0: return "e";
    case 1: return "p";
    case 2: return "s";
    case 3: return "t";
    case 4: return "i";
    case 5: return "w";
    case 6: return "k";
    case 7: return "n";
    case 8: return "u";
    case 9: return "v";
    case 10: return "g";
    case 11: return "c";
    case 12: return "l";
    case 13: return "r";
    case 14: return "y";
    case 15: return "b";
    case 16: return "x";
    case 17: return "h";
    case 18: return "m";
    case 19: return "d";
    case 20: return "o";
    case 21: return "f";
    case 22: return "z";
    case 23: return "q";
    case 24: return "a";
    case 25: return "j";

    case 26: return "E";
    case 27: return "P";
    case 28: return "S";
    case 29: return "T";
    case 30: return "I";
    case 31: return "W";
    case 32: return "K";
    case 33: return "N";
    case 34: return "U";
    case 35: return "V";
    case 36: return "G";
    case 37: return "C";
    case 38: return "L";
    case 39: return "R";
    case 40: return "Y";
    case 41: return "B";
    case 42: return "X";
    case 43: return "H";
    case 44: return "M";
    case 45: return "D";
    case 46: return "O";
    case 47: return "F";
    case 48: return "Z";
    case 49: return "Q";
    case 50: return "A";
    case 51: return "J";
    default: return sLetter; } return "";
}

string ProcessHalfling(string sPhrase)
{
    string sOutput;
    int iToggle;
    while (GetStringLength(sPhrase) > 1)
    {
        if (GetStringLeft(sPhrase,1) == "*")
            iToggle = abs(iToggle - 1);
        if (iToggle)
            sOutput = sOutput + GetStringLeft(sPhrase,1);
        else
            sOutput = sOutput + ConvertHalfling(GetStringLeft(sPhrase, 1));
        sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1);
    }
    return sOutput;
}

string ConvertOrc(string sLetter)
{
    if (GetStringLength(sLetter) > 1)
        sLetter = GetStringLeft(sLetter, 1);
    string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    int iTrans = FindSubString(sTranslate, sLetter);

    switch (iTrans)
    {
    case 0: return "ha";
    case 26: return "Ha";
    case 1: return "p";
    case 2: return "z";
    case 3: return "t";
    case 4: return "o";
    case 5: return "";
    case 6: return "k";
    case 7: return "r";
    case 8: return "a";
    case 9: return "m";
    case 10: return "g";
    case 11: return "h";
    case 12: return "r";
    case 13: return "k";
    case 14: return "u";
    case 15: return "b";
    case 16: return "k";
    case 17: return "h";
    case 18: return "g";
    case 19: return "n";
    case 20: return "";
    case 21: return "g";
    case 22: return "r";
    case 23: return "r";
    case 24: return "'";
    case 25: return "m";

    case 27: return "P";
    case 28: return "Z";
    case 29: return "T";
    case 30: return "O";
    case 31: return "";
    case 32: return "K";
    case 33: return "R";
    case 34: return "A";
    case 35: return "M";
    case 36: return "G";
    case 37: return "H";
    case 38: return "R";
    case 39: return "K";
    case 40: return "U";
    case 41: return "B";
    case 42: return "K";
    case 43: return "H";
    case 44: return "G";
    case 45: return "N";
    case 46: return "";
    case 47: return "G";
    case 48: return "R";
    case 49: return "R";
    case 50: return "'";
    case 51: return "M";
    default: return sLetter; } return "";
}

string ProcessOrc(string sPhrase)
{
    string sOutput;
    int iToggle;
    while (GetStringLength(sPhrase) > 1)
    {
        if (GetStringLeft(sPhrase,1) == "*")
            iToggle = abs(iToggle - 1);
        if (iToggle)
            sOutput = sOutput + GetStringLeft(sPhrase,1);
        else
            sOutput = sOutput + ConvertOrc(GetStringLeft(sPhrase, 1));
        sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1);
    }
    return sOutput;
}

string ConvertAnimal(string sLetter)
{
    if (GetStringLength(sLetter) > 1)
        sLetter = GetStringLeft(sLetter, 1);
    string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    int iTrans = FindSubString(sTranslate, sLetter);

    switch (iTrans)
    {
    case 0: return "'";
    case 1: return "'";
    case 2: return "'";
    case 3: return "'";
    case 4: return "'";
    case 5: return "'";
    case 6: return "'";
    case 7: return "'";
    case 8: return "'";
    case 9: return "'";
    case 10: return "'";
    case 11: return "'";
    case 12: return "'";
    case 13: return "'";
    case 14: return "'";
    case 15: return "'";
    case 16: return "'";
    case 17: return "'";
    case 18: return "'";
    case 19: return "'";
    case 20: return "'";
    case 21: return "'";
    case 22: return "'";
    case 23: return "'";
    case 24: return "'";
    case 25: return "'";

    case 26: return "'";
    case 27: return "'";
    case 28: return "'";
    case 29: return "'";
    case 30: return "'";
    case 31: return "'";
    case 32: return "'";
    case 33: return "'";
    case 34: return "'";
    case 35: return "'";
    case 36: return "'";
    case 37: return "'";
    case 38: return "'";
    case 39: return "'";
    case 40: return "'";
    case 41: return "'";
    case 42: return "'";
    case 43: return "'";
    case 44: return "'";
    case 45: return "'";
    case 46: return "'";
    case 47: return "'";
    case 48: return "'";
    case 49: return "'";
    case 50: return "'";
    case 51: return "'";
    default: return sLetter; } return "";
}

string ProcessAnimal(string sPhrase)
{
    string sOutput;
    int iToggle;
    while (GetStringLength(sPhrase) > 1)
    {
        if (GetStringLeft(sPhrase,1) == "*")
            iToggle = abs(iToggle - 1);
        if (iToggle)
            sOutput = sOutput + GetStringLeft(sPhrase,1);
        else
            sOutput = sOutput + ConvertAnimal(GetStringLeft(sPhrase, 1));
        sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1);
    }
    return sOutput;
}

string ProcessCant(string sLetter)
{
    if (GetStringLength(sLetter) > 1)
        sLetter = GetStringLeft(sLetter, 1);

    if (sLetter == "a" || sLetter == "A") return "*shields eyes*";
    if (sLetter == "b" || sLetter == "B") return "*blusters*";
    if (sLetter == "c" || sLetter == "C") return "*coughs*";
    if (sLetter == "d" || sLetter == "D") return "*furrows brow*";
    if (sLetter == "e" || sLetter == "E") return "*examines ground*";
    if (sLetter == "f" || sLetter == "F") return "*frowns*";
    if (sLetter == "g" || sLetter == "G") return "*glances up*";
    if (sLetter == "h" || sLetter == "H") return "*looks thoughtful*";
    if (sLetter == "i" || sLetter == "I") return "*looks bored*";
    if (sLetter == "j" || sLetter == "J") return "*rubs chin*";
    if (sLetter == "k" || sLetter == "K") return "*scratches ear*";
    if (sLetter == "l" || sLetter == "L") return "*looks around*";
    if (sLetter == "m" || sLetter == "M") return "*mmm hmm*";
    if (sLetter == "n" || sLetter == "N") return "*nods*";
    if (sLetter == "o" || sLetter == "O") return "*grins*";
    if (sLetter == "p" || sLetter == "P") return "*smiles*";
    if (sLetter == "q" || sLetter == "Q") return "*shivers*";
    if (sLetter == "r" || sLetter == "R") return "*rolls eyes*";
    if (sLetter == "s" || sLetter == "S") return "*scratches nose*";
    if (sLetter == "t" || sLetter == "T") return "*turns a bit*";
    if (sLetter == "u" || sLetter == "U") return "*glances idly*";
    if (sLetter == "v" || sLetter == "V") return "*runs hand through hair*";
    if (sLetter == "w" || sLetter == "W") return "*waves*";
    if (sLetter == "x" || sLetter == "X") return "*stretches*";
    if (sLetter == "y" || sLetter == "Y") return "*yawns*";
    if (sLetter == "z" || sLetter == "Z") return "*shrugs*";

    return "*nods*";
}

string TranslateCommonToLanguage(int iLang, string sText)
{
    switch(iLang)
    {
        case 1: //Elven
        return ProcessElven(sText); break;
        case 2: //Gnome
        return ProcessGnome(sText); break;
        case 3: //Halfling
        return ProcessHalfling(sText); break;
        case 4: //Dwarf Note: Race 4 is normally Half Elf and Race 0 is normally Dwarf. This is changed.
        return ProcessDwarf(sText); break;
        case 5: //Orc
        return ProcessOrc(sText); break;
        case 6: //Goblin
        return ProcessGoblin(sText); break;
        case 7: //Draconic
        return ProcessDraconic(sText); break;
        case 8: //Animal
        return ProcessAnimal(sText); break;
        case 9: //Thieves Cant
        return ProcessCant(sText); break;
        case 10: //Celestial
        return ProcessCelestial(sText); break;
        case 11: //Abyssal
        return ProcessAbyssal(sText); break;
        case 12: //Infernal
        return ProcessInfernal(sText); break;
        case 99: //1337
        return ProcessLeetspeak(sText); break;
        case 13:
        return ProcessDrow(sText); break;
        default: break;
    }
    return "";
}

int GetDefaultRacialLanguage(object oPC, int iRename)
{
    switch(GetRacialType(oPC))
    {
        case RACIAL_TYPE_DWARF: if (iRename) SetLocalString(oPC, "hls_MyLanguageName", "Dwarven"); return 4; break;
        case RACIAL_TYPE_ELF:
        case RACIAL_TYPE_HALFELF: if (iRename) SetLocalString(oPC, "hls_MyLanguageName", "Elven"); return 1; break;
        case RACIAL_TYPE_GNOME: if (iRename) SetLocalString(oPC, "hls_MyLanguageName", "Gnome"); return 2; break;
        case RACIAL_TYPE_HALFLING: if (iRename) SetLocalString(oPC, "hls_MyLanguageName", "Halfling"); return 3; break;
        case RACIAL_TYPE_HUMANOID_ORC:
        case RACIAL_TYPE_HALFORC: if (iRename) SetLocalString(oPC, "hls_MyLanguageName", "Orc"); return 5; break;
        case RACIAL_TYPE_HUMANOID_GOBLINOID: if (iRename) SetLocalString(oPC, "hls_MyLanguageName", "Goblin"); return 6; break;
        case RACIAL_TYPE_HUMANOID_REPTILIAN:
        case RACIAL_TYPE_DRAGON: if (iRename) SetLocalString(oPC, "hls_MyLanguageName", "Draconic"); return 7; break;
        default: if (GetLevelByClass(CLASS_TYPE_RANGER, oPC) || GetLevelByClass(CLASS_TYPE_DRUID, oPC))
                 {
                    if (iRename) SetLocalString(oPC, "hls_MyLanguageName", "Animal");
                    return 8;
                 }
                 if (GetLevelByClass(CLASS_TYPE_ROGUE, oPC))
                 {
                    if (iRename) SetLocalString(oPC, "hls_MyLanguageName", "Thieves' Cant");
                    return 9;
                 }
                 break;
    }
    return 0;
}

int GetDefaultClassLanguage(object oPC)
{
    if (GetLevelByClass(CLASS_TYPE_RANGER, oPC) || GetLevelByClass(CLASS_TYPE_DRUID, oPC))
        return 8;
    if (GetLevelByClass(CLASS_TYPE_ROGUE, oPC))
        return 9;
    if ((GetSubRace(oPC)=="drow") ||(GetSubRace(oPC)=="DROW")||(GetSubRace(oPC)=="Drow"))
        return 13;

    return 0;
}

int GetIsAlphanumeric(string sCharacter)
{
    if (sCharacter == "a" ||
        sCharacter == "b" ||
        sCharacter == "c" ||
        sCharacter == "d" ||
        sCharacter == "e" ||
        sCharacter == "f" ||
        sCharacter == "g" ||
        sCharacter == "h" ||
        sCharacter == "i" ||
        sCharacter == "j" ||
        sCharacter == "k" ||
        sCharacter == "l" ||
        sCharacter == "m" ||
        sCharacter == "n" ||
        sCharacter == "o" ||
        sCharacter == "p" ||
        sCharacter == "q" ||
        sCharacter == "r" ||
        sCharacter == "s" ||
        sCharacter == "t" ||
        sCharacter == "u" ||
        sCharacter == "v" ||
        sCharacter == "w" ||
        sCharacter == "x" ||
        sCharacter == "y" ||
        sCharacter == "z" ||
        sCharacter == "A" ||
        sCharacter == "B" ||
        sCharacter == "C" ||
        sCharacter == "D" ||
        sCharacter == "E" ||
        sCharacter == "F" ||
        sCharacter == "G" ||
        sCharacter == "H" ||
        sCharacter == "I" ||
        sCharacter == "J" ||
        sCharacter == "K" ||
        sCharacter == "L" ||
        sCharacter == "M" ||
        sCharacter == "N" ||
        sCharacter == "O" ||
        sCharacter == "P" ||
        sCharacter == "Q" ||
        sCharacter == "R" ||
        sCharacter == "S" ||
        sCharacter == "T" ||
        sCharacter == "U" ||
        sCharacter == "V" ||
        sCharacter == "W" ||
        sCharacter == "X" ||
        sCharacter == "Y" ||
        sCharacter == "Z" ||
        sCharacter == "1" ||
        sCharacter == "2" ||
        sCharacter == "3" ||
        sCharacter == "4" ||
        sCharacter == "5" ||
        sCharacter == "6" ||
        sCharacter == "7" ||
        sCharacter == "8" ||
        sCharacter == "9" ||
        sCharacter == "0")
        return TRUE;

    return FALSE;
}

void ParseCommand(object oNPC, object oPC, string sCom)
{
    int iOffset=0;
    if (GetIsDM(oNPC) &&
        (oNPC != oPC))
        return; //DMs can only be affected by their own .commands

    if (!GetIsObjectValid(oNPC))
        {
        SendMessageToPC(oPC, "No current voice command target - no voice targetting commands will function.");
        return;
        }

    if (GetStringLowerCase(GetStringLeft(sCom, 12)) ==".appearance ")
    {
        string sNew = GetStringRight(sCom, GetStringLength(sCom)-12);
        SendMessageToPC(oPC, "Parse command: " + sNew);
        int Appear = AppearType(sNew);

        if (Appear!=-1)
           {SetCreatureAppearanceType(GetLocalObject(oPC, "dmfi_univ_target"), Appear);}
        else
           {FloatingTextStringOnCreature("Invalid Appearance Type", oPC);}


    dmw_CleanUp(oPC);
    return;
    }


    if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".loc")
        {
        SetLocalInt(oPC, "dmfi_dicebag", 2);
        SetCustomToken(20681, "Local");
        SetCampaignInt("dmfi", "dmfi_dicebag", 2, oPC);
        FloatingTextStringOnCreature("Broadcast Mode set to Local", oPC, FALSE); return;
        }
    if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".glo")
        {
        SetLocalInt(oPC, "dmfi_dicebag", 1);
        SetCustomToken(20681, "Global");
        SetCampaignInt("dmfi", "dmfi_dicebag", 1, oPC);
        FloatingTextStringOnCreature("Broadcast Mode set to Global", oPC, FALSE); return;
        }
    if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".pri")
        {
        SetLocalInt(oPC, "dmfi_dicebag", 0);
        SetCustomToken(20681, "Private");
        SetCampaignInt("dmfi", "dmfi_dicebag", 0, oPC);
        FloatingTextStringOnCreature("Broadcast Mode set to Private", oPC, FALSE); return;
        }
     if (GetStringLowerCase(GetStringLeft(sCom, 3)) == ".dm")
        {
        SetLocalInt(oPC, "dmfi_dicebag", 3);
        SetCustomToken(20681, "DM Only");
        SetCampaignInt("dmfi", "dmfi_dicebag", 3, oPC);
        FloatingTextStringOnCreature("Broadcast Mode set to DM Only", oPC, FALSE); return;
        }
    if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".aniy")
        {
        SetLocalInt(oPC, "dmfi_dice_no_animate", 0);
        FloatingTextStringOnCreature("Rolls will show animation", oPC, FALSE); return;
        }
    if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".anin")
        {
        SetLocalInt(oPC, "dmfi_dice_no_animate", 1);
        FloatingTextStringOnCreature("Rolls will NOT show animation", oPC, FALSE); return;
        }

    if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".stre")
       iOffset=  11;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".dext")
       iOffset = 12;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".cons")
       iOffset = 13;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".inte")
       iOffset = 14;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".wisd")
       iOffset = 15;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".char")
       iOffset = 16;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".fort")
       iOffset = 17;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".refl")
       iOffset = 18;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".anim")
       iOffset = 21;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".appr")
       iOffset = 22;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".bluf")
       iOffset =  23;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".conc")
       iOffset = 24;
    else if (GetStringLowerCase(GetStringLeft(sCom, 9)) == ".craft ar")
       iOffset =  25;
    else if (GetStringLowerCase(GetStringLeft(sCom, 9)) == ".craft tr")
       iOffset =  26;
    else if (GetStringLowerCase(GetStringLeft(sCom, 9)) == ".craft we")
       iOffset =  27;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".disa")
       iOffset =  28;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".disc")
       iOffset =  29;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".heal")
       iOffset =  31;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".hide")
       iOffset =  32;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".inti")
       iOffset =  33;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".list")
       iOffset =  34;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".lore")
       iOffset =  35;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".move")
       iOffset =  36;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".open")
       iOffset =   37;
     else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".parr")
       iOffset =  38;
     else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".perf")
       iOffset =  39;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".pers")
       iOffset =  41;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".pick")
       iOffset =  42;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".sear")
       iOffset =  43;
    else if (GetStringLowerCase(GetStringLeft(sCom, 6)) == ".set t")
       iOffset =  44;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".spel")
       iOffset =  45;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".spot")
       iOffset =  46;
     else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".taun")
       iOffset =   47;
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".tumb")
       iOffset =  48;
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".use")
       iOffset =   49;

    if (iOffset!=0)
    {
        if (FindSubString(GetStringLowerCase(sCom), "all") != -1)
            SetLocalInt(oPC, "dmfi_univ_int", iOffset+40);
            else
            SetLocalInt(oPC, "dmfi_univ_int", iOffset);

        SetLocalString(oPC, "dmfi_univ_conv", "dicebag");
        //SetLocalObject(oPC, "dmfi_univ_target", oNPC);
        //should still send last DMFI target
        if (!GetIsObjectValid(GetLocalObject(oPC, "dmfi_univ_target")))
            {
            SetLocalObject(oPC, "dmfi_univ_target", oNPC);
            SendMessageToPC(oPC, "No valid DMFI target:  Transferred to voice widget target");
            }

        ExecuteScript("dmfi_execute", oPC);
        dmw_CleanUp(oPC);
        return;
    }


    if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".set")
    {
        sCom = GetStringRight(sCom, GetStringLength(sCom) - 4);
        while (sCom != "")
        {
            if (GetStringLeft(sCom, 1) == " " ||
                GetStringLeft(sCom, 1) == "[" ||
                GetStringLeft(sCom, 1) == "." ||
                GetStringLeft(sCom, 1) == ":" ||
                GetStringLeft(sCom, 1) == ";" ||
                GetStringLeft(sCom, 1) == "*" ||
                GetIsAlphanumeric(GetStringLeft(sCom, 1)))
                sCom = GetStringRight(sCom, GetStringLength(sCom) - 1);
            else
            {
                SetLocalObject(GetModule(), "hls_NPCControl" + GetStringLeft(sCom, 1), oNPC);
                FloatingTextStringOnCreature("The Control character for " + GetName(oNPC) + " is " + GetStringLeft(sCom, 1), oPC, FALSE);
                return;
            }
        }
        FloatingTextStringOnCreature("Your Control Character is not valid. Perhaps you are using a reserved character.", oPC, FALSE);
        return;
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".ani")
    {
        sCom = GetStringRight(sCom, GetStringLength(sCom) - 4);
        //Parses the characters until there is a space.
        while (GetStringLeft(sCom, 1) != " " && sCom != "")
        {
            sCom = GetStringRight(sCom, GetStringLength(sCom) - 1);
        }
        if (sCom != "" && GetStringLeft(sCom, 1) == " ")
        {
            sCom = GetStringRight(sCom, GetStringLength(sCom) - 1);
            int iCom = StringToInt(sCom);
            AssignCommand(oNPC, ClearAllActions(TRUE));
            AssignCommand(oNPC, ActionPlayAnimation(iCom, 1.0, 99999.0f));
            return;
        }
        return;
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".buf")
    {
        if (FindSubString(GetStringLowerCase(sCom), "low") !=-1)
            {
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectACIncrease(3, AC_NATURAL_BONUS), oNPC, 3600.0f);
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PROT_BARKSKIN), oNPC, 3600.0f);
            AssignCommand(oNPC, ActionCastSpellAtObject(SPELL_RESISTANCE, oNPC, METAMAGIC_ANY, TRUE, 5, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
            AssignCommand(oNPC, ActionCastSpellAtObject(SPELL_GHOSTLY_VISAGE, oNPC, METAMAGIC_ANY, TRUE, 5, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
            AssignCommand(oNPC, ActionCastSpellAtObject(SPELL_CLARITY,  oNPC,METAMAGIC_ANY, TRUE, 5, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
            FloatingTextStringOnCreature("Low Buff applied: " + GetName(oNPC), oPC);   return;
            }
        else if (FindSubString(GetStringLowerCase(sCom), "mid") !=-1)
            {
            AssignCommand(oNPC, ActionCastSpellAtObject(SPELL_LESSER_SPELL_MANTLE, oNPC, METAMAGIC_ANY, TRUE, 10, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
            AssignCommand(oNPC, ActionCastSpellAtObject(SPELL_STONESKIN, oNPC, METAMAGIC_ANY, TRUE, 10, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
            AssignCommand(oNPC, ActionCastSpellAtObject(SPELL_ELEMENTAL_SHIELD,  oNPC,METAMAGIC_ANY, TRUE, 10, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
            FloatingTextStringOnCreature("Mid Buff applied: " + GetName(oNPC), oPC);  return;
            }
         else if (FindSubString(GetStringLowerCase(sCom), "high") !=-1)
            {
            AssignCommand(oNPC, ActionCastSpellAtObject(SPELL_SPELL_MANTLE, oNPC, METAMAGIC_ANY, TRUE, 15, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
            AssignCommand(oNPC, ActionCastSpellAtObject(SPELL_STONESKIN, oNPC, METAMAGIC_ANY, TRUE,15, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
            AssignCommand(oNPC, ActionCastSpellAtObject(SPELL_SHADOW_SHIELD,  oNPC,METAMAGIC_ANY, TRUE, 15, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
            FloatingTextStringOnCreature("High Buff applied: " + GetName(oNPC), oPC);  return;
            }
        else if (FindSubString(GetStringLowerCase(sCom), "epic") !=-1)
            {
            AssignCommand(oNPC, ActionCastSpellAtObject(SPELL_GREATER_SPELL_MANTLE, oNPC, METAMAGIC_ANY, TRUE, 20, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
            AssignCommand(oNPC, ActionCastSpellAtObject(SPELL_SPELL_RESISTANCE, oNPC, METAMAGIC_ANY, TRUE, 20, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
            AssignCommand(oNPC, ActionCastSpellAtObject(SPELL_SHADOW_SHIELD,  oNPC,METAMAGIC_ANY, TRUE, 20, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
            AssignCommand(oNPC, ActionCastSpellAtObject(SPELL_CLARITY,  oNPC,METAMAGIC_ANY, TRUE, 20, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
            FloatingTextStringOnCreature("Epic Buff applied: " + GetName(oNPC), oPC);  return;
            }
        else if (FindSubString(GetStringLowerCase(sCom), "barkskin") != -1)
        {
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectACIncrease(3, AC_NATURAL_BONUS), oNPC, 3600.0f);
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PROT_BARKSKIN), oNPC, 3600.0f);  return;
        }
        else if (FindSubString(GetStringLowerCase(sCom), "elements") != -1)
        {
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDamageResistance(DAMAGE_TYPE_COLD, 20, 40), oNPC, 3600.0f);
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDamageResistance(DAMAGE_TYPE_FIRE, 20, 40), oNPC, 3600.0f);
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDamageResistance(DAMAGE_TYPE_ACID, 20, 40), oNPC, 3600.0f);
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDamageResistance(DAMAGE_TYPE_SONIC, 20, 40), oNPC, 3600.0f);
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDamageResistance(DAMAGE_TYPE_ELECTRICAL, 20, 40), oNPC, 3600.0f);
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PROTECTION_ELEMENTS), oNPC, 3600.0f);  return;
        }
        else if (FindSubString(GetStringLowerCase(sCom), "haste") != -1)
        {
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectHaste(), oNPC, 3600.0f);  return;
        }
        else if (FindSubString(GetStringLowerCase(sCom), "invis") != -1)
        {
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectInvisibility(INVISIBILITY_TYPE_NORMAL), oNPC, 3600.0f);   return;
        }
        else if (FindSubString(GetStringLowerCase(sCom), "unplot") != -1)
        {
            SetPlotFlag(oNPC, FALSE);
            FloatingTextStringOnCreature("The target is set to non-Plot.", oPC, FALSE); return;
        }
        else if (FindSubString(GetStringLowerCase(sCom), "plot") != -1)
        {
            SetPlotFlag(oNPC, TRUE);
            FloatingTextStringOnCreature("The target is set to Plot.", oPC, FALSE);  return;
        }
        else if (FindSubString(GetStringLowerCase(sCom), "stoneskin") != -1)
        {
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDamageReduction(10, DAMAGE_POWER_PLUS_THREE, 100), oNPC, 3600.0f);
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PROT_GREATER_STONESKIN), oNPC, 3600.0f); return;
        }
        else if (FindSubString(GetStringLowerCase(sCom), "trues") != -1)
        {
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectTrueSeeing(), oNPC, 3600.0f); return;
        }
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".dam")
    {
        sCom = GetStringRight(sCom, GetStringLength(sCom) - 4);
        //Parses the characters until there is a space.
        while (GetStringLeft(sCom, 1) != " " && sCom != "")
        {
            sCom = GetStringRight(sCom, GetStringLength(sCom) - 1);
        }
        if (sCom != "" && GetStringLeft(sCom, 1) == " ")
        {
            sCom = GetStringRight(sCom, GetStringLength(sCom) - 1);
            int iCom = StringToInt(sCom);
            ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(iCom, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_NORMAL), oNPC);
            ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_BLOOD_LRG_RED), oNPC);
            FloatingTextStringOnCreature(GetName(oNPC) + " has taken " + sCom + " damage.", oPC, FALSE);
            return;
        }
        return;
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 5)) == ".dism")
    {
        DestroyObject(oNPC);
        FloatingTextStringOnCreature(GetName(oNPC) + " dismissed", oPC, FALSE); return;
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".inv")
    {
        OpenInventory(oNPC, oPC);
        FloatingTextStringOnCreature(GetName(oNPC) + " dismissed", oPC, FALSE); return;
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".dmt")
    {
        SetLocalInt(GetModule(), "dmfi_DMToolLock", abs(GetLocalInt(GetModule(), "dmfi_DMToolLock") -1)); return;
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".dms")
    {
        SetCampaignInt("dmfi", "dmfi_DMSpy", abs(GetCampaignInt("dmfi", "dmfi_DMSpy", oPC) -1), oPC); return;
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".fac")
    {
        if (FindSubString(GetStringLowerCase(sCom), "hostile") != -1)
        {
            ChangeToStandardFaction(oNPC, STANDARD_FACTION_HOSTILE);
            FloatingTextStringOnCreature("Faction set to hostile", oPC, FALSE);
            if (GetIsImmune(oNPC, IMMUNITY_TYPE_BLINDNESS))
            {
            SendMessageToPC(oPC, "Targeted creature is blind immune - no attack will occur until new perception event is fired");
            return;
            }
            else
            {
            effect eInvis =EffectBlindness();
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eInvis, oNPC, 6.1);
            SendMessageToPC(oPC, "Faction Adjusted - will take effect in 6 seconds");
            return;
           }


       }
        else if (FindSubString(GetStringLowerCase(sCom), "commoner") != -1)
        {
            ChangeToStandardFaction(oNPC, STANDARD_FACTION_COMMONER);
            FloatingTextStringOnCreature("Faction set to commoner", oPC, FALSE);
            if (GetIsImmune(oNPC, IMMUNITY_TYPE_BLINDNESS))
            {
            SendMessageToPC(oPC, "Targeted creature is blind immune - no attack will occur until new perception event is fired");
            return;
            }
            else
            {
            effect eInvis =EffectBlindness();
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eInvis, oNPC, 6.1);
            SendMessageToPC(oPC, "Faction Adjusted - will take effect in 6 seconds");
            return;
            }


        }
        else if (FindSubString(GetStringLowerCase(sCom), "defender") != -1)
        {
            ChangeToStandardFaction(oNPC, STANDARD_FACTION_DEFENDER);
            FloatingTextStringOnCreature("Faction set to defender", oPC, FALSE);
            if (GetIsImmune(oNPC, IMMUNITY_TYPE_BLINDNESS))
            {
            SendMessageToPC(oPC, "Targeted creature is blind immune - no attack will occur until new perception event is fired");
            return;
            }
            else
            {
            effect eInvis =EffectBlindness();
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eInvis, oNPC, 6.1);
            SendMessageToPC(oPC, "Faction Adjusted - will take effect in 6 seconds");
            return;
           }
        }
        else if (FindSubString(GetStringLowerCase(sCom), "merchant") != -1)
        {
            ChangeToStandardFaction(oNPC, STANDARD_FACTION_MERCHANT);
            FloatingTextStringOnCreature("Faction set to merchant", oPC, FALSE);
            if (GetIsImmune(oNPC, IMMUNITY_TYPE_BLINDNESS))
            {
            SendMessageToPC(oPC, "Targeted creature is blind immune - no attack will occur until new perception event is fired");
            return;
           }
            else
            {
            effect eInvis =EffectBlindness();
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eInvis, oNPC, 6.1);
            SendMessageToPC(oPC, "Faction Adjusted - will take effect in 6 seconds");
            return;
            }
        }
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".fle")
    {
        AssignCommand(oNPC, ClearAllActions(TRUE));
        AssignCommand(oNPC, ActionMoveAwayFromObject(oPC, TRUE));
        return;
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".fly")
    {
        ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDisappear(), oNPC);
        return;
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".fol")
    {
        sCom = GetStringRight(sCom, GetStringLength(sCom) - 4);
        //Parses the characters until there is a space.
        while (GetStringLeft(sCom, 1) != " " && sCom != "")
        {
            sCom = GetStringRight(sCom, GetStringLength(sCom) - 1);
        }
        if (sCom != "" && GetStringLeft(sCom, 1) == " ")
        {
            sCom = GetStringRight(sCom, GetStringLength(sCom) - 1);
            int iCom = StringToInt(sCom);
            FloatingTextStringOnCreature(GetName(oNPC) + " will follow you for "+sCom+" seconds.", oPC, FALSE);
            AssignCommand(oNPC, ClearAllActions(TRUE));
            AssignCommand(oNPC, ActionForceMoveToObject(oPC, TRUE, 2.0f, IntToFloat(iCom)));
            DelayCommand(IntToFloat(iCom), FloatingTextStringOnCreature(GetName(oNPC) + " has stopped following you.", oPC, FALSE));
            return;
        }
        return;
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".fre")
    {
        FloatingTextStringOnCreature(GetName(oNPC) + " frozen", oPC, FALSE);
        SetCommandable(TRUE, oNPC);
        AssignCommand(oNPC, ClearAllActions(TRUE));
        DelayCommand(0.5f, SetCommandable(FALSE, oNPC));
        return;
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".get")
    {
        sCom = GetStringRight(sCom, GetStringLength(sCom) - 4);
        while (sCom != "")
        {
            if (GetStringLeft(sCom, 1) == " " ||
                GetStringLeft(sCom, 1) == "[" ||
                GetStringLeft(sCom, 1) == "." ||
                GetStringLeft(sCom, 1) == ":" ||
                GetStringLeft(sCom, 1) == ";" ||
                GetStringLeft(sCom, 1) == "*" ||
                GetIsAlphanumeric(GetStringLeft(sCom, 1)))
                sCom = GetStringRight(sCom, GetStringLength(sCom) - 1);
            else
            {
                object oJump = GetLocalObject(GetModule(), "hls_NPCControl" + GetStringLeft(sCom, 1));
                if (GetIsObjectValid(oJump))
                {
                    AssignCommand(oJump, ClearAllActions());
                    AssignCommand(oJump, ActionJumpToLocation(GetLocation(oPC)));
                    return;
                }
                else
                    FloatingTextStringOnCreature("Your Control Character is not valid. Perhaps you are using a reserved character.", oPC, FALSE);
                return;
            }
        }
        FloatingTextStringOnCreature("Your Control Character is not valid. Perhaps you are using a reserved character.", oPC, FALSE);
        return;

    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".got")
    {
        sCom = GetStringRight(sCom, GetStringLength(sCom) - 4);
        while (sCom != "")
        {
            if (GetStringLeft(sCom, 1) == " " ||
                GetStringLeft(sCom, 1) == "[" ||
                GetStringLeft(sCom, 1) == "." ||
                GetStringLeft(sCom, 1) == ":" ||
                GetStringLeft(sCom, 1) == ";" ||
                GetStringLeft(sCom, 1) == "*" ||
                GetIsAlphanumeric(GetStringLeft(sCom, 1)))
                sCom = GetStringRight(sCom, GetStringLength(sCom) - 1);
            else
            {
                object oJump = GetLocalObject(GetModule(), "hls_NPCControl" + GetStringLeft(sCom, 1));
                if (GetIsObjectValid(oJump))
                {
                    AssignCommand(oPC, ClearAllActions());
                    AssignCommand(oPC, ActionJumpToLocation(GetLocation(oJump)));
                }
                else
                    FloatingTextStringOnCreature("Your Control Character is not valid. Perhaps you are using a reserved character.", oPC, FALSE);
                return;
            }
        }
        FloatingTextStringOnCreature("Your Control Character is not valid. Perhaps you are using a reserved character.", oPC, FALSE);
       return;
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".hea")
    {
        sCom = GetStringRight(sCom, GetStringLength(sCom) - 4);
        //Parses the characters until there is a space.
        while (GetStringLeft(sCom, 1) != " " && sCom != "")
        {
            sCom = GetStringRight(sCom, GetStringLength(sCom) - 1);
        }
        if (sCom != "" && GetStringLeft(sCom, 1) == " ")
        {
            sCom = GetStringRight(sCom, GetStringLength(sCom) - 1);
            int iCom = StringToInt(sCom);
            ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(iCom), oNPC);
            ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_HEALING_M), oNPC);
            FloatingTextStringOnCreature(GetName(oNPC) + " has healed " + sCom + " hp.", oPC, FALSE);
            return;
        }
        return;
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".ite")
    {
        sCom = GetStringRight(sCom, GetStringLength(sCom) - 4);
        //Parses the characters until there is a space.
        while (GetStringLeft(sCom, 1) != " " && sCom != "")
        {
            sCom = GetStringRight(sCom, GetStringLength(sCom) - 1);
        }
        if (sCom != "" && GetStringLeft(sCom, 1) == " ")
        {
            sCom = GetStringRight(sCom, GetStringLength(sCom) - 1);
            object oCreate = CreateItemOnObject(sCom, oNPC, 1);
            if (GetIsObjectValid(oCreate))
                FloatingTextStringOnCreature("Item " + GetName(oCreate) + " created.", oPC, FALSE);
            return;
        }
        return;
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".lan") //sets the language of the target
    {
        if (FindSubString(GetStringLowerCase(sCom), "elven") != -1 ||
            FindSubString(GetStringLowerCase(sCom), "elf") != -1)
        {
            SetLocalInt(oNPC, "hls_MyLanguage", 1);
            SetLocalString(oNPC, "hls_MyLanguageName", "Elven");
            FloatingTextStringOnCreature("Language set to Elven", oPC, FALSE);
        }
        else if (FindSubString(GetStringLowerCase(sCom), "gnom") != -1)
        {
            SetLocalInt(oNPC, "hls_MyLanguage", 2);
            SetLocalString(oNPC, "hls_MyLanguageName", "Gnome");
            FloatingTextStringOnCreature("Language set to Gnome", oPC, FALSE);
        }
        else if (FindSubString(GetStringLowerCase(sCom), "halfling") != -1)
        {
            SetLocalInt(oNPC, "hls_MyLanguage", 3);
            SetLocalString(oNPC, "hls_MyLanguageName", "Halfling");
            FloatingTextStringOnCreature("Language set to Halfling", oPC, FALSE);
        }
        else if (FindSubString(GetStringLowerCase(sCom), "dwar") != -1)
        {
            SetLocalInt(oNPC, "hls_MyLanguage", 4);
            SetLocalString(oNPC, "hls_MyLanguageName", "Dwarven");
            FloatingTextStringOnCreature("Language set to Dwarven", oPC, FALSE);
        }
        else if (FindSubString(GetStringLowerCase(sCom), "orc") != -1)
        {
            SetLocalInt(oNPC, "hls_MyLanguage", 5);
            SetLocalString(oNPC, "hls_MyLanguageName", "Orc");
            FloatingTextStringOnCreature("Language set to Orc", oPC, FALSE);
        }
        else if (FindSubString(GetStringLowerCase(sCom), "goblin") != -1)
        {
            SetLocalInt(oNPC, "hls_MyLanguage", 6);
            SetLocalString(oNPC, "hls_MyLanguageName", "Goblin");
            FloatingTextStringOnCreature("Language set to Goblin", oPC, FALSE);
        }
        else if (FindSubString(GetStringLowerCase(sCom), "draconic") != -1)
        {
            SetLocalInt(oNPC, "hls_MyLanguage", 7);
            SetLocalString(oNPC, "hls_MyLanguageName", "Draconic");
            FloatingTextStringOnCreature("Language set to Draconic", oPC, FALSE);
        }
        else if (FindSubString(GetStringLowerCase(sCom), "animal") != -1)
        {
            SetLocalInt(oNPC, "hls_MyLanguage", 8);
            SetLocalString(oNPC, "hls_MyLanguageName", "Animal");
            FloatingTextStringOnCreature("Language set to Animal", oPC, FALSE);
        }
        else if (FindSubString(GetStringLowerCase(sCom), "cant") != -1)
        {
            SetLocalInt(oNPC, "hls_MyLanguage", 9);
            SetLocalString(oNPC, "hls_MyLanguageName", "Thieves' Cant");
            FloatingTextStringOnCreature("Language set to Thieves' Cant", oPC, FALSE);
        }
        else if (FindSubString(GetStringLowerCase(sCom), "celestial") != -1)
        {
            SetLocalInt(oNPC, "hls_MyLanguage", 10);
            SetLocalString(oNPC, "hls_MyLanguageName", "Celestial");
            FloatingTextStringOnCreature("Language set to Celestial", oPC, FALSE);
        }
        else if (FindSubString(GetStringLowerCase(sCom), "abyssal") != -1)
        {
            SetLocalInt(oNPC, "hls_MyLanguage", 11);
            SetLocalString(oNPC, "hls_MyLanguageName", "Abyssal");
            FloatingTextStringOnCreature("Language set to Abyssal", oPC, FALSE);
        }
        else if (FindSubString(GetStringLowerCase(sCom), "infernal") != -1)
        {
            SetLocalInt(oNPC, "hls_MyLanguage", 12);
            SetLocalString(oNPC, "hls_MyLanguageName", "Infernal");
            FloatingTextStringOnCreature("Language set to Infernal", oPC, FALSE);
        }
       else if (FindSubString(GetStringLowerCase(sCom), "drow") != -1)
        {
            SetLocalInt(oNPC, "hls_MyLanguage", 12);
            SetLocalString(oNPC, "hls_MyLanguageName", "Drow");
            FloatingTextStringOnCreature("Language set to Drow", oPC, FALSE);
        }
    return;
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".mut")
    {
        FloatingTextStringOnCreature(GetName(oNPC) + " muted", oPC, FALSE);
        SetLocalInt(oNPC, "dmfi_Mute", 1);
        return;
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".npc")
    {
        sCom = GetStringRight(sCom, GetStringLength(sCom) - 4);
        //Parses the characters until there is a space.
        while (GetStringLeft(sCom, 1) != " " && sCom != "")
        {
            sCom = GetStringRight(sCom, GetStringLength(sCom) - 1);
        }
        if (sCom != "" && GetStringLeft(sCom, 1) == " ")
        {
            sCom = GetStringRight(sCom, GetStringLength(sCom) - 1);
            object oCreate = CreateObject(OBJECT_TYPE_CREATURE, sCom, GetLocation(oNPC));
            if (GetIsObjectValid(oCreate))
                FloatingTextStringOnCreature("NPC " + GetName(oCreate) + " created.", oPC, FALSE);
            return;
        }
        return;
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".pla")
    {
        sCom = GetStringRight(sCom, GetStringLength(sCom) - 4);
        //Parses the characters until there is a space.
        while (GetStringLeft(sCom, 1) != " " && sCom != "")
        {
            sCom = GetStringRight(sCom, GetStringLength(sCom) - 1);
        }
        if (sCom != "" && GetStringLeft(sCom, 1) == " ")
        {
            sCom = GetStringRight(sCom, GetStringLength(sCom) - 1);
            object oCreate = CreateObject(OBJECT_TYPE_PLACEABLE, sCom, GetLocation(oNPC));
            if (GetIsObjectValid(oCreate))
                FloatingTextStringOnCreature("Placeable " + GetName(oCreate) + " created.", oPC, FALSE);
            return;
        }
        return;
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".rem")
    {
        effect eRemove = GetFirstEffect(oNPC);
        while (GetIsEffectValid(eRemove))
        {
            RemoveEffect(oNPC, eRemove);
            eRemove = GetNextEffect(oNPC);
        }
        return;
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".say")
    {
        sCom = GetStringRight(sCom, GetStringLength(sCom) - 5);
        int iCom = StringToInt(sCom);
        if (GetCampaignString("dmfi", "hls206" + IntToString(iCom)) != "")
        {
            AssignCommand(oNPC, SpeakString(GetCampaignString("dmfi", "hls206" + IntToString(iCom))));
        }
        return;
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".tar")
    {
        object oGet = GetFirstObjectInArea(GetArea(oPC));
        if (GetStringLeft(sCom, 5) == ".tar ") sCom = GetStringRight(sCom, GetStringLength(sCom) - 5);
        else if (GetStringLeft(sCom, 8) == ".target ") sCom = GetStringRight(sCom, GetStringLength(sCom) - 8);
        while (GetIsObjectValid(oGet))
        {
            if (FindSubString(GetName(oGet), sCom) != -1)
            {
                SetLocalObject(oPC, "dmfi_VoiceTarget", oGet);
                FloatingTextStringOnCreature("You have targeted " + GetName(oGet) + " with the Voice Widget", oPC, FALSE);
                return;
            }
            oGet = GetNextObjectInArea(GetArea(oPC));
        }
        FloatingTextStringOnCreature("Target not found.", oPC, FALSE);
        return;
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".unf")
    {
        FloatingTextStringOnCreature(GetName(oNPC) + " unfrozen", oPC, FALSE);
        SetCommandable(TRUE, oNPC); return;
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".unm")
    {
        FloatingTextStringOnCreature(GetName(oNPC) + " un-muted", oPC, FALSE);
        DeleteLocalInt(oNPC, "dmfi_Mute"); return;
    }
    else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".vfx")
    {
        sCom = GetStringRight(sCom, GetStringLength(sCom) - 4);
        //Parses the characters until there is a space.
        while (GetStringLeft(sCom, 1) != " " && sCom != "")
        {
            sCom = GetStringRight(sCom, GetStringLength(sCom) - 1);
        }
        if (sCom != "" && GetStringLeft(sCom, 1) == " ")
        {
            sCom = GetStringRight(sCom, GetStringLength(sCom) - 1);
            int iCom = StringToInt(sCom);
            if (GetTag(oNPC) == "dmfi_voice")
                ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(iCom), GetLocation(oNPC), 10.0f);
            else
                ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(iCom), oNPC, 10.0f);
            return;
        }
        return;
    }
}

void TranslateToLanguage(string sSaid, object oShouter)
{
    //Gets the current language that the character is speaking
    int iTranslate;
    if (GetLocalInt(oShouter, "hls_MyLanguage"))
        iTranslate = GetLocalInt(oShouter, "hls_MyLanguage");
    else
        iTranslate = GetDefaultRacialLanguage(oShouter, 1);
    if (!iTranslate) return;
    //Defines language name
    string sLanguageName = GetLocalString(oShouter, "hls_MyLanguageName");

    sSaid = GetStringRight(sSaid, GetStringLength(sSaid)-1);
    //Thieves' Cant character limit of 25
    if (iTranslate == 9 && GetStringLength(sSaid) > 25)
        sSaid = GetStringLeft(sSaid, 25);
    string sSpeak = TranslateCommonToLanguage(iTranslate, sSaid);
    if (GetStringRight(sSaid, 1) == "]")
        sSaid = GetStringLeft(sSaid, GetStringLength(sSaid)-1);
    AssignCommand(oShouter, SpeakString(sSpeak));

    object oEavesdrop = GetFirstObjectInShape(SHAPE_SPHERE, 20.0f, GetLocation(oShouter), FALSE, OBJECT_TYPE_CREATURE);

    while (GetIsObjectValid(oEavesdrop))
    {
                if (GetIsPC(oEavesdrop) && (!GetIsDM(oEavesdrop)))
                {
                //Translate and Send or do Lore check
                if (GetIsObjectValid(GetItemPossessedBy(oEavesdrop, "hlslang_" + IntToString(iTranslate))) ||
                    GetIsObjectValid(GetItemPossessedBy(oEavesdrop, "babelfish")) ||
                    iTranslate == GetDefaultRacialLanguage(oEavesdrop, 0) ||
                    iTranslate == GetDefaultClassLanguage(oEavesdrop))
                        SendMessageToPC(oEavesdrop, GetName(oShouter) + " says in " + sLanguageName + ": " + sSaid);
                else
                {
                    if (d20() + GetSkillRank(SKILL_LORE, oEavesdrop) > 20 && iTranslate != 9)
                        SendMessageToPC(oEavesdrop, GetName(oShouter) + " is speaking in " + sLanguageName);
                }
                }
        oEavesdrop = GetNextObjectInShape(SHAPE_SPHERE, 20.0f, GetLocation(oShouter), FALSE, OBJECT_TYPE_CREATURE);
    }
    //PrintString("<Conv>"+GetName(GetArea(oShouter))+ " " + GetName(oShouter) + " says in " + sLanguageName + ": " + sSaid + " </Conv>");
}


void main()
{

    int nMatch = GetListenPatternNumber();
    object oShouter = GetLastSpeaker();

    if (GetIsDM(oShouter))
        SetLocalInt(GetModule(), "dmfi_Admin" + GetPCPublicCDKey(oShouter), 1);

    if (GetIsDMPossessed(oShouter))
        SetLocalObject(GetMaster(oShouter), "dmfi_familiar", oShouter);

    object oIntruder;
    object oTarget = GetLocalObject(oShouter, "dmfi_VoiceTarget");
    object oMaster = OBJECT_INVALID;
    if (GetIsObjectValid(oTarget))
        oMaster = oShouter;

    int iPhrase = GetLocalInt(oShouter, "hls_EditPhrase");

    object oSummon;

    if (nMatch == 20600 && GetIsObjectValid(oShouter) && GetIsDM(oShouter))
    {
    string sSaid = GetMatchedSubstring(0);

    if (GetTag(OBJECT_SELF) == "dmfi_setting" && GetLocalString(oShouter, "EffectSetting") != "")
        {
            string sPhrase = GetLocalString(oShouter, "EffectSetting");
            SetLocalFloat(oShouter, sPhrase, StringToFloat(sSaid));
            SetCampaignFloat("dmfi", sPhrase, StringToFloat(sSaid), oShouter);
            DeleteLocalString(oShouter, "EffectSetting");
            DelayCommand(0.5, ActionSpeakString("The setting " + sPhrase + " has been changed to " + FloatToString(GetLocalFloat(oShouter, sPhrase))));
            DelayCommand(1.5, DestroyObject(OBJECT_SELF));
            //maybe add a return here
        }
    }

    if (nMatch == 20600 && GetIsObjectValid(oShouter) && GetIsPC(oShouter))
    {
        string sSaid = GetMatchedSubstring(0);

        if (sSaid != GetLocalString(GetModule(), "hls_voicebuffer"))
            SetLocalString(GetModule(), "hls_voicebuffer", sSaid);
        else
            {
            return;
            }
        // DM spy code right at the top - this basically will send the DM what has been spoken anywhere
        if (GetCampaignInt("dmfi", "dmfi_DMSpy"))
            {
                object oTempPC = GetFirstPC();
                while(GetIsObjectValid(oTempPC))
                {
                    if (GetIsDM(oTempPC))
                    {
                        if (GetCampaignInt("dmfi", "dmfi_DMSpy", oTempPC))
                        {
                        if (GetIsPC(GetLocalObject(oTempPC, "dmfi_familiar")))
                            SendMessageToPC(GetLocalObject(oTempPC, "dmfi_familiar"), "(" + GetName(GetArea(oShouter)) + ") " + GetName(oShouter) + ": " + sSaid);
                        else
                            SendMessageToPC(oTempPC, "(" + GetName(GetArea(oShouter)) + ") " + GetName(oShouter) + ": " + sSaid);
                        }
                    }
                oTempPC = GetNextPC();
                }
            }

        PrintString("<Conv>"+GetName(GetArea(oShouter))+ " " + GetName(oShouter) + ": " + sSaid + " </Conv>");
        //if the phrase begins with .MyName, reparse the string as a voice throw
        if (GetStringLeft(sSaid, GetStringLength("." + GetName(OBJECT_SELF))) == "." + GetName(OBJECT_SELF) &&
            (GetLocalInt(GetModule(), "dmfi_Admin" + GetPCPublicCDKey(oShouter)) ||
             GetIsDM(oShouter) || GetIsDMPossessed(oShouter)))

        {
            oTarget = OBJECT_SELF;
            sSaid = GetStringRight(sSaid, GetStringLength(sSaid) - GetStringLength("." + GetName(OBJECT_SELF)));
            if (GetStringLeft(sSaid, 1) == " ") sSaid = GetStringRight(sSaid, GetStringLength(sSaid) - 1);
            sSaid = ":" + sSaid;
            return;
        }

        if (iPhrase)
        {
            SetCustomToken(iPhrase, sSaid);
            SetCampaignString("dmfi", "hls" + IntToString(iPhrase), sSaid);
            DeleteLocalInt(oShouter, "hls_EditPhrase");
            FloatingTextStringOnCreature("Phrase " + IntToString(iPhrase) + " has been recorded", oShouter, FALSE);

            return;
        }

        if (GetStringLeft(sSaid, 1) == "[")
        {
            TranslateToLanguage(sSaid, oShouter);
            return;
        }

        if (GetStringLeft(sSaid, 1) == "*" && !GetLocalInt(oShouter, "hls_emotemute"))
        {
            ParseEmote(sSaid, oShouter);
            return;
        }

        if (GetStringLeft(sSaid, 1) == ":")
        {
            //This "throws" your voice to an object and properly dumps it into the log
            if (GetIsObjectValid(oTarget))
            {
                sSaid = GetStringRight(sSaid, GetStringLength(sSaid)-1);

                if (GetStringLeft(sSaid, 1) == "[")
                    {
                    TranslateToLanguage(sSaid, oTarget);
                    return;
                    }

                if (GetStringLeft(sSaid, 1) == "*")
                    {
                    ParseEmote(sSaid, oTarget);
                    return;
                    }

             AssignCommand(oTarget, SpeakString(sSaid));
             //PrintString("<Conv>"+GetName(GetArea(oTarget))+ " " + GetName(oTarget) + ": " + sSaid + " </Conv>");
             return;
            }
        return;
        }

        if (GetStringLeft(sSaid, 1) == ";" && //Voicethrow ";" prioritizes animal companions
        (GetIsObjectValid(GetMaster(oShouter)) ||
        GetIsObjectValid(GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oShouter)) ||
        GetIsObjectValid(GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oShouter)) ||
        GetIsObjectValid(GetAssociate(ASSOCIATE_TYPE_HENCHMAN, oShouter)) ||
        GetIsObjectValid(GetAssociate(ASSOCIATE_TYPE_SUMMONED, oShouter))))
        {
            if (GetIsObjectValid(GetMaster(oShouter)))
                oSummon = GetMaster(oShouter);
            else if (GetIsObjectValid(GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oShouter)))
                oSummon = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oShouter);
            else if (GetIsObjectValid(GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oShouter)))
                oSummon = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oShouter);
            else if (GetIsObjectValid(GetAssociate(ASSOCIATE_TYPE_HENCHMAN, oShouter)))
                oSummon = GetAssociate(ASSOCIATE_TYPE_HENCHMAN, oShouter);
            else if (GetIsObjectValid(GetAssociate(ASSOCIATE_TYPE_SUMMONED, oShouter)))
                oSummon = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oShouter);

            if (GetIsObjectValid(oSummon))
            {
                sSaid = GetStringRight(sSaid, GetStringLength(sSaid)-1);

                if (GetStringLeft(sSaid, 1) == "[")
                    {
                    TranslateToLanguage(sSaid, oSummon);
                    return;
                    }

                if (GetStringLeft(sSaid, 1) == "*")
                    {
                    ParseEmote(sSaid, oSummon);
                    return;
                    }

                AssignCommand(oSummon, SpeakString(sSaid));
                PrintString("<Conv>"+GetName(GetArea(oSummon))+ " " + GetName(oSummon) + ": " + sSaid + " </Conv>");
                return;
            }
        return;
        }

        if (GetStringLeft(sSaid, 1) == "," && //Voicethrow "," prioritizes summons
        (GetIsObjectValid(GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oShouter)) ||
        GetIsObjectValid(GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oShouter)) ||
        GetIsObjectValid(GetAssociate(ASSOCIATE_TYPE_HENCHMAN, oShouter)) ||
        GetIsObjectValid(GetAssociate(ASSOCIATE_TYPE_SUMMONED, oShouter))))
        {
            if (GetIsObjectValid(GetAssociate(ASSOCIATE_TYPE_SUMMONED, oShouter)))
                oSummon = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oShouter);
            else if (GetIsObjectValid(GetAssociate(ASSOCIATE_TYPE_HENCHMAN, oShouter)))
                oSummon = GetAssociate(ASSOCIATE_TYPE_HENCHMAN, oShouter);
            else if (GetIsObjectValid(GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oShouter)))
                oSummon = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oShouter);
            else if (GetIsObjectValid(GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oShouter)))
                oSummon = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oShouter);

           if (GetIsObjectValid(oSummon))
            {
                sSaid = GetStringRight(sSaid, GetStringLength(sSaid)-1);

                if (GetStringLeft(sSaid, 1) == "[")
                    {
                    TranslateToLanguage(sSaid, oSummon);
                    return;
                    }

                if (GetStringLeft(sSaid, 1) == "*")
                    {
                    ParseEmote(sSaid, oSummon);
                    return;
                    }

                AssignCommand(oSummon, SpeakString(sSaid));
                PrintString("<Conv>"+GetName(GetArea(oSummon))+ " " + GetName(oSummon) + ": " + sSaid + " </Conv>");
                return;
            }
        return;
        }

        if (GetIsObjectValid(GetLocalObject(GetModule(), "hls_NPCControl" + GetStringLeft(sSaid, 1))) && GetLocalInt(GetModule(), "dmfi_Admin" + GetPCPublicCDKey(oShouter)))
        {
            object oControl = GetLocalObject(GetModule(), "hls_NPCControl" + GetStringLeft(sSaid, 1));
            sSaid = GetStringRight(sSaid, GetStringLength(sSaid)-1);

            if (GetStringLeft(sSaid, 1) == "[")
                {
                TranslateToLanguage(sSaid, oControl);
                return;
                }
            if (GetStringLeft(sSaid, 1) == "*")
                {
                ParseEmote(sSaid, oControl);
                return;
                }
            if (GetStringLeft(sSaid, 1) == ".")
                {
                ParseCommand(oControl, oShouter, sSaid);
                return;
                }

                //This "throws" your voice to an object and properly dumps it into the log
                AssignCommand(oControl, SpeakString(sSaid));
                PrintString("<Conv>"+GetName(GetArea(oControl))+ " " + GetName(oControl) + ": " + sSaid + " </Conv>");
                return;
        }

        if (GetStringLeft(sSaid, 1) == "." && GetIsObjectValid(oMaster))
        {
            ParseCommand(oTarget, oMaster, sSaid);
            return;
        }



        }
    }

