void GiveDMFI(object oPC, string sResRef)
{
    //note: for DMFI items, tag and resref are identical

    object oItem = GetItemPossessedBy(oPC, sResRef);
    if (!GetIsObjectValid(oItem))
        CreateItemOnObject(sResRef, oPC);
}

void main()
{
    object oPC = GetPCSpeaker();
    int iLanguageFlag = FALSE;

    //PC Autofollow Widget
    GiveDMFI(oPC, "dmfi_pc_follow");

    //PC Dicebag
    GiveDMFI(oPC, "dmfi_pc_dicebag");

    //PC Emote Wand
    GiveDMFI(oPC, "dmfi_pc_emote");

    //Book of Player Voice Commands
    GiveDMFI(oPC, "dmfi_playerbook");

    //Abyssal
    if (GetSubRace(oPC) == "Abyssal") GiveDMFI(oPC, "hlslang_11");
    if (
            (GetAlignmentGoodEvil(oPC) == ALIGNMENT_EVIL && GetAlignmentLawChaos(oPC) == ALIGNMENT_CHAOTIC) &&
            (GetLevelByClass(CLASS_TYPE_CLERIC, oPC)!=0) || (GetLevelByClass(CLASS_TYPE_BLACKGUARD, oPC)!=0)
       ) GiveDMFI(oPC, "hlslang_11");

    //Animal
    if (
            (GetLevelByClass(CLASS_TYPE_DRUID, oPC)!=0) ||
            (GetLevelByClass(CLASS_TYPE_RANGER, oPC)!=0)
       ) GiveDMFI(oPC, "hlslang_8");

    //Celestial
    if (GetSubRace(oPC) == "Celestial" || GetSubRace(oPC) == "Aasimar") GiveDMFI(oPC, "hlslang_10");
    if (
            (GetAlignmentGoodEvil(oPC) == ALIGNMENT_GOOD) &&
            ( (GetLevelByClass(CLASS_TYPE_CLERIC, oPC)!=0) || (GetLevelByClass(CLASS_TYPE_PALADIN, oPC)!=0) )
       ) GiveDMFI(oPC, "hlslang_10");

    //Draconic
    if (
            (GetLevelByClass(CLASS_TYPE_DRAGONDISCIPLE, oPC)!=0) ||
            (GetLevelByClass(CLASS_TYPE_DRAGON_DISCIPLE, oPC)!=0)
       )GiveDMFI(oPC, "hlslang_7");

    //Drow
    if (GetSubRace(oPC) == "Drow") GiveDMFI(oPC, "hlslang_13");

    //Dwarven
    if (GetRacialType(oPC) == RACIAL_TYPE_DWARF) GiveDMFI(oPC, "hlslang_4");

    //Elven
    if (
            (GetRacialType(oPC) == RACIAL_TYPE_ELF) ||
            (GetRacialType(oPC) == RACIAL_TYPE_HALFELF)
       ) GiveDMFI(oPC, "hlslang_1");

    //Gnome
    if (GetRacialType(oPC) == RACIAL_TYPE_GNOME) GiveDMFI(oPC, "hlslang_2");

    //Goblin
    if (GetSubRace(oPC) == "Goblin") GiveDMFI(oPC, "hlslang_6");

    //Halfling
    if (GetRacialType(oPC) == RACIAL_TYPE_HALFLING) GiveDMFI(oPC, "hlslang_3");

    //Infernal
    if (GetSubRace(oPC) == "Infernal" || GetSubRace(oPC) == "Tiefling") GiveDMFI(oPC, "hlslang_12");
    if (
            (GetAlignmentGoodEvil(oPC) == ALIGNMENT_EVIL && GetAlignmentLawChaos(oPC) != ALIGNMENT_CHAOTIC) &&
            (GetLevelByClass(CLASS_TYPE_CLERIC, oPC)!=0) || (GetLevelByClass(CLASS_TYPE_BLACKGUARD, oPC)!=0)
       ) GiveDMFI(oPC, "hlslang_12");

    //Orc
    if (GetRacialType(oPC) == RACIAL_TYPE_HALFORC) GiveDMFI(oPC, "hlslang_5");

    //Thieves' Cant
    if (
       (GetLevelByClass(CLASS_TYPE_ROGUE, oPC)!=0) ||
       (GetLevelByClass(CLASS_TYPE_BARD, oPC)!=0) ||
       (GetLevelByClass(CLASS_TYPE_SHADOWDANCER, oPC)!=0)
       ) GiveDMFI(oPC, "hlslang_9");
}
