Skip to content

OnMonsterHit Poisons for PCs

I'd like to use some of the poisons that seem to be only available as OnMonsterHit: Poison properties.

How do you add say Deathblade or Nightshade poisons to PC weapons using poison vials?

Comments

  • MelkiorMelkior Member Posts: 216
    edited December 2022
    You'd have to write a script for adding those poison effects to PC weapons (or to a PC for a monk without gloves).
    There are functions to create the poison effects and to apply them to objects.
    As I understand it, applying the poison effect to an object makes that object inflict poison on-hit while applying the effect directly to a creature causes the ill-effects of the poison to that target (although I could be totally wrong).
    effect ePoisonDB=EffectPoison(POISON_DEATHBLADE);
    effect ePoisonNS=EffectPoison(POISON_NIGHTSHADE);
    
    // Assuming you already have the player's character in object variable oPC
    // Apply temporary poison effect to player skin
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY,ePoisonDB,GetItemInSlot(INVENTORY_SLOT_CARMOR,oPC),30.0f);
    // Apply temporary poison effect to player gloves
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY,ePoisonNS,GetItemInSlot(INVENTORY_SLOT_ARMS,oPC),30.0f);
    
  • TerrorbleTerrorble Member Posts: 183
    Melkior, I was excited about the approach, but it doesn't work for creating an OnHit property that will apply any of the poisons in poison.2da (e.g. Deathblade or Nightshade) to a player weapon. :/ But, it helped me get to a solution, so :)

    (I didn't test to see what happens if you apply it to the CARMOR or ARMS slots since I just wanted it for coating weapons. So, maybe I missed out on something easier.)

    I wrote a script that allowed my poison vial, with Cast Spell: Unique whatever, to apply the EffectPoison(POISON_NIGHTSHADE) to creatures or weapons. It works when used on a creature just like you'd expect. If they fail the DC listed in poison.2da, they get poisoned and suffer the effects. Using it on a weapon did nothing: you have to apply an ItemProperty.

    The only item property functions for poison are OnHit or OnMonsterHit. The first only has options for the poisons that do basic 1d2 stat damage, and the second only works on creature weapons.

    So the workaround is to apply OnHitCastSpell. I used the spell Poison. I edited its spell script so that if it's being cast from a weapon to apply EffectPoison(POISON_NIGHTSHADE) from within the spell script.

    tl;dr

    Applying EffectPoison(POISON_NIGHTSHADE) to a weapon doesn't do anything.
    There are no item property functions that allow you to add any of the poisons in poison.2da to a player weapon.
    But you can add the OnHitCastSpell item property to a weapon, then have the spell script apply EffectPoison(POISON_NIGHTSHADE) to the target.
  • MelkiorMelkior Member Posts: 216
    I delved a little deeper and you're quite right. I wonder if it's possible to edit a 2DA file to add those poisons as properties which can be applied to weapons? Anyway, thanks for sharing your work-around.
Sign In or Register to comment.