Skip to content

On Activate Poison Damage.

Is there a way to add poison damage to a weapon via on activate item? I know this script does not compile because after writing it i realized there is no CONST_ONHIT_POISON
void main()
{
    // Get the player character who activated the item
    object oPC = GetItemActivator();

    // Get the weapon in the player's right hand
    object oWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC);

    // If no weapon is found, exit the script
    if (oWeapon == OBJECT_INVALID)
    {
        return;
    }

    // Create an "On Hit: Poison" property
    itemproperty ipPoison = ItemPropertyOnHitProps(IP_CONST_ONHIT_POISON, 1);

    // Apply the poison property to the weapon for 600 seconds (10 minutes)
    AddItemProperty(DURATION_TYPE_TEMPORARY, ipPoison, oWeapon, 600.0f);
}

Comments

  • ForSeriousForSerious Member Posts: 466
    edited September 16
    I found this in X2_S2_PoisonWp. The default poison weapon script from using poison items.
    Looks like you'll need:
    itemproperty ip = ItemPropertyOnHitProps(IP_CONST_ONHIT_ITEMPOISON,nSaveDC,nPoisonType);
    They use
    #include "x2_inc_itemprop"
    IPSafeAddItemProperty(oTarget, ip,IntToFloat(nDuration),X2_IP_ADDPROP_POLICY_KEEP_EXISTING,TRUE,TRUE);
    But you can probably do it your way.
  • TheTinmanTheTinman Member Posts: 74
    Thank you very much ForSerious. I had tried almost everything to make it work.
Sign In or Register to comment.