Jump to content

Need help with poison weapon mod.


Arcane51388

Recommended Posts

I am making a weapon mod that adds a dagger to the game that when you apply poisons to the weapon the base damage increases. So normally it would have a base value of 4 same as Iron Daggers. But when poison is applies to it, the base damage doubles, maybe triples. Is this possible? Maybe with scripting? I tries a couple things already that did not seem to work. Any help or knowledge would be appreciated.
Link to comment
Share on other sites

I'd guess that this would have to be scripted.

 

Problem is I can't think of any suitable events for detecting when poison is applied to the weapon*. Nor can I think of how to remove any effects once the poison expires, which will be complicated because the player may have the 'Concentrated Poison' perk to make poisons do twice as many hits.

 

Also if you could detect the weapon being poisoned, you can't boost the player's skill in the use of the weapon to do more damage, because they could poison the blade and swap it for another weapon and still benefit from the perk you gave them. I guess that bit could be handled with 'OnUnequipped' in the script on the weapon.

 

Hopefully someone else can help.

 

* edit: maybe 'OnMagicEffectApply' ? I've never used it. If you can check in this event if the magic effect (poison) 'HasForm' and make a formlist of all the magic effects that relate to poisons, such as 'AlchDamagehealth' , you could then add a perk to the player. When the item is unequipped, you could check for any perk just given to the player and remove it.

 

If the 'OnMagicEffectApply' event works for this, that still leaves an issue around the player still doing increased damage after the poison wears off. I'd guess you want it to last no longer than that. I suppose you could just add the perk for a set time and remove it after that time elapsed. Putting all that together you'd have a weapon that 'did' more damage for a time after poison was applied. when it was unequipped, the extra damage is removed. That way the player can't apply poison to your dagger, or whatever, and then pull out a dragonbone dagger and do more damage with that.

Link to comment
Share on other sites

As cumbrianlad said, this is difficult because I don't know of a way to detect when the weapon loses it's poison status. Because of this, I would just use a timer so the damage buff lasts like 60 seconds or so. Here's how I would do it.

 

Make a new spell ability and add the ability to the actor whenever your dagger is equipped, and remove it when it's unequipped.

 

Put this script on your dagger:

 

Scriptname MyDaggerScript extends ObjectReference 

Spell Property PoisonDamageAbility Auto 
Weapon Property MyDagger Auto

Event OnEquipped(Actor akActor) 
    akActor.AddSpell(PoisonDamageAbility) 
EndEvent

Event OnUnequipped(Actor akActor)
    akActor.RemoveSpell(PoisonDamageAbility)
    MyDagger.SetBaseDamage(4)
EndEvent 

Then, on your Spell Ability's magic effect, put this script:

 

Scriptname MyDaggerAbilityScript extends ActiveMagicEffect 

Weapon Property MyDagger Auto 

Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference) 
    If akBaseObject as Potion 
        If (akBaseObject as Potion).IsPoison()
            MyDagger.SetBaseDamage(8)
            RegisterForSingleUpdate(60) ;updates in 60 seconds
        Endif 
    Endif 
EndEvent 

Event OnUpdate()
    MyDagger.SetBaseDamage(4)
EndEvent

Note, this does require SKSE. Name the scripts something more unique. Also I haven't tested this so I'm not sure it works. I'm not sure if the OnObjectEquipped event applies to poisons but I think it does.

 

Link to comment
Share on other sites

Seems like dylbill and i are agreed on this, save that dylbill added the script behind my idea... I'm not great with scripts, so thanks for that, dylbill!

 

Unless anyone else has any other ideas, I guess this is your only way.

 

dylbill, I see the logic. I know this isn't the OP's concern, but why does it require SKSE? Just curious.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...