#include "inc_itemprop002"

void main()
{
    object oPC = GetPCSpeaker();

    //Transfer gold
    int iValue = GetLocalInt(oPC, "MODIFY_VALUE");
    int iDiff = GetLocalInt(oPC, "MODIFY_DIFF");
    if (iDiff == 1)
        TakeGoldFromCreature(iValue, oPC, TRUE);
    else if (iDiff == -1)
        GiveGoldToCreature(oPC, iValue);

    //Modify item
    object oItem = GetLocalObject(oPC, "MODIFY_ITEM");
    itemproperty ip = GetNewProperty(oItem);

    if ( GetIsItemPropertyValid(ip))
        CustomAddProperty(oItem, ip);

    object oAnvil = GetNearestObjectByTag("pAnvilOfWonder");
    effect eEffect = EffectVisualEffect(VFX_IMP_LIGHTNING_S);
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oAnvil, 1.0);

}