#include "x2_inc_itemprop"

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;
            }
        int iBaseItemType = GetBaseItemType(GetItemActivatedTarget());
        if( (iBaseItemType) != (BASE_ITEM_BASTARDSWORD ||
                            BASE_ITEM_BATTLEAXE ||
                            BASE_ITEM_CLUB ||
                            BASE_ITEM_DAGGER ||
                            BASE_ITEM_DIREMACE ||
                            BASE_ITEM_DOUBLEAXE ||
                            BASE_ITEM_DWARVENWARAXE ||
                            BASE_ITEM_GREATAXE ||
                            BASE_ITEM_GREATSWORD ||
                            BASE_ITEM_HALBERD ||
                            BASE_ITEM_HANDAXE ||
                            BASE_ITEM_HEAVYFLAIL ||
                            BASE_ITEM_KAMA ||
                            BASE_ITEM_KATANA ||
                            BASE_ITEM_KUKRI ||
                            BASE_ITEM_LIGHTFLAIL ||
                            BASE_ITEM_LIGHTMACE ||
                            BASE_ITEM_LONGSWORD ||
                            BASE_ITEM_MORNINGSTAR ||
                            BASE_ITEM_QUARTERSTAFF ||
                            BASE_ITEM_RAPIER ||
                            BASE_ITEM_SCIMITAR ||
                            BASE_ITEM_SCYTHE ||
                            BASE_ITEM_SHORTSPEAR ||
                            BASE_ITEM_SHORTSWORD ||
                            BASE_ITEM_SICKLE ||
                            BASE_ITEM_TRIDENT ||
                            BASE_ITEM_TWOBLADEDSWORD ||
                            BASE_ITEM_WARHAMMER ||
                            BASE_ITEM_WHIP ||
                            BASE_ITEM_HEAVYCROSSBOW ||
                            BASE_ITEM_LIGHTCROSSBOW ||
                            BASE_ITEM_LONGBOW ||
                            BASE_ITEM_SHORTBOW ||
                            BASE_ITEM_SLING))
                {
                SendMessageToPC(oPC, "This item property can only be added to weapons!");
                return;
                }


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

    // Apply haste to the item.
    itemproperty ipAcid = ItemPropertyDamageBonus(DAMAGE_TYPE_ACID, DAMAGE_BONUS_1d8);
    IPSafeAddItemProperty(oTarget, ipAcid, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE);

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