#include "inc_item_tools"

void main()
    {
    object oItem = GetItemActivated();
    string sTag = GetTag (oItem);
    object oPC = GetItemActivator();
    object oTarget = GetItemActivatedTarget();
    location lLoc = GetItemActivatedTargetLocation();
    location lLoc2;
    int iType = GetBaseItemType(oItem);
    int i,iTemp,iTemp2,iAnim,iPassed,iSkill,iRoll;
    effect eTemp,eTemp2;
    object oTemp;
    string sResRef;
    talent tTalent;
    float fTemp;
    if (GetIsDM(oPC))
        {
        if (sTag == "DMCleaner")
            {
            SetItemCursedFlag(oTarget,FALSE);
            SetPlotFlag(oTarget,FALSE);
            DestroyObject(oTarget);
            return;
            }
        else if (sTag == "DMBanWand")
            {
            oTemp = GetObjectByTag("DeathCheater");
            AssignCommand(oTarget,ClearAllActions(TRUE));
            AssignCommand(oTarget,JumpToLocation(GetLocation(oTemp)));
            return;
            }
        }
    switch (iType)
        {
        // Weapons
        case BASE_ITEM_ARROW:
        case BASE_ITEM_BASTARDSWORD:
        case BASE_ITEM_BATTLEAXE:
        case BASE_ITEM_BOLT:
        case BASE_ITEM_BULLET:
        case BASE_ITEM_CLUB:
        case BASE_ITEM_DAGGER:
        case BASE_ITEM_DART:
        case BASE_ITEM_DIREMACE:
        case BASE_ITEM_DOUBLEAXE:
        case BASE_ITEM_GREATAXE:
        case BASE_ITEM_GREATSWORD:
        case BASE_ITEM_GRENADE:
        case BASE_ITEM_HALBERD:
        case BASE_ITEM_HANDAXE:
        case BASE_ITEM_HEAVYCROSSBOW:
        case BASE_ITEM_HEAVYFLAIL:
        case BASE_ITEM_KAMA:
        case BASE_ITEM_KATANA:
        case BASE_ITEM_KUKRI:
        case BASE_ITEM_LIGHTCROSSBOW:
        case BASE_ITEM_LIGHTFLAIL:
        case BASE_ITEM_LIGHTHAMMER:
        case BASE_ITEM_LIGHTMACE:
        case BASE_ITEM_LONGBOW:
        case BASE_ITEM_LONGSWORD:
        case BASE_ITEM_MORNINGSTAR:
        case BASE_ITEM_QUARTERSTAFF:
        case BASE_ITEM_RAPIER:
        case BASE_ITEM_SCIMITAR:
        case BASE_ITEM_SCYTHE:
        case BASE_ITEM_SHORTBOW:
        case BASE_ITEM_SHORTSPEAR:
        case BASE_ITEM_SHORTSWORD:
        case BASE_ITEM_SHURIKEN:
        case BASE_ITEM_SICKLE:
        case BASE_ITEM_SLING:
        case BASE_ITEM_THROWINGAXE:
        case BASE_ITEM_TWOBLADEDSWORD:
        case BASE_ITEM_WARHAMMER:
            {
            ExecuteScript("mod_act_weapons",oPC);
            break;
            }
        case BASE_ITEM_AMULET:
        case BASE_ITEM_RING:
            {
            ExecuteScript("mod_act_jewelry",oPC);
            break;
            }
        case BASE_ITEM_ARMOR:
        case BASE_ITEM_HELMET:
        case BASE_ITEM_LARGESHIELD:
        case BASE_ITEM_SMALLSHIELD:
        case BASE_ITEM_TOWERSHIELD:
            {
            ExecuteScript("mod_act_armor",oPC);
            break;
            }
        case BASE_ITEM_BELT:
        case BASE_ITEM_BOOTS:
        case BASE_ITEM_BRACER:
        case BASE_ITEM_CLOAK:
        case BASE_ITEM_GLOVES:
            {
            ExecuteScript("mod_act_clothes",oPC);
            break;
            }

        // Wizard Stuff
        case BASE_ITEM_MAGICROD:
        case BASE_ITEM_MAGICSTAFF:
        case BASE_ITEM_MAGICWAND:
            {
            ExecuteScript("mod_act_wiz",oPC);
            break;
            }
        // Misc
        case BASE_ITEM_MISCLARGE:
        case BASE_ITEM_MISCMEDIUM:
            {
            ExecuteScript("mod_act_med",oPC);
            break;
            }
        case BASE_ITEM_MISCSMALL:
            {
            ExecuteScript("mod_act_small",oPC);
            break;
            }
        case BASE_ITEM_MISCTALL:
        case BASE_ITEM_MISCTHIN:
            {
            ExecuteScript("mod_act_thin",oPC);
            break;
            }
        case BASE_ITEM_MISCWIDE:
            {}
        // Potions
        case BASE_ITEM_POTIONS:
            {
            ExecuteScript("mod_act_potion",oPC);
            break;
            }
        case BASE_ITEM_BOOK:
            {
            ExecuteScript("mod_act_book",oPC);
            break;
            }
        // As of this writing these types do nothing.
        case BASE_ITEM_CBLUDGWEAPON:
        case BASE_ITEM_CPIERCWEAPON:
        case BASE_ITEM_CREATUREITEM:
        case BASE_ITEM_CSLASHWEAPON:
        case BASE_ITEM_CSLSHPRCWEAP:
        case BASE_ITEM_GEM:
        case BASE_ITEM_GOLD:
        case BASE_ITEM_HEALERSKIT:
        case BASE_ITEM_KEY:
        case BASE_ITEM_LARGEBOX:
        case BASE_ITEM_SCROLL:
        case BASE_ITEM_SPELLSCROLL:
        case BASE_ITEM_THIEVESTOOLS:
        case BASE_ITEM_TORCH:
        case BASE_ITEM_TRAPKIT:
            {}
        };
    }
