#include "x2_inc_itemprop"
//#include "dm_inc_forge"
void main()
{
    object oPC = GetItemActivator();
    object oTarget = GetItemActivatedTarget();

        if ((GetObjectType(GetItemActivatedTarget())!= OBJECT_TYPE_ITEM)){
            SendMessageToPC(oPC, "This item cannot be used in this manner!");
            return;}
        if (GetIsInCombat(oPC)){
            SendMessageToPC(oPC, "This item cannot be used in combat!");
            return;}
       // if (dmIsMaxLevel(oTarget)){
       //     SendMessageToPC(oPC, "The target item is already too powerful.");
       //     return;}


    // Some sound/visual on the PC to indicate use.
    effect eVFX = EffectVisualEffect(VFX_FNF_DISPEL);
    AssignCommand(oPC, PlaySound("sim_cntmantle"));
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oPC, 1.5);

    // Apply haste to the item.
    itemproperty ipHaste = ItemPropertyHaste();
    IPSafeAddItemProperty(oTarget, ipHaste, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE);

    // Only items that have been modified can be renamed.
    //SetLocalInt(oTarget, "bVulcNameAllowed", 1);

    // Everything's done, tell the PC.
    SendMessageToPC(oPC, "The haste property has been successfully added.");
}
