[Papyrus] Modifing damage from script

Post » Tue Jun 19, 2012 7:20 pm

So, how can I increase weapon/spell damage and AR/magic resistance from a script?
I can't do these with perks as my method involves massive calculations.
Looking forward for your help, thanks.
Templar
User avatar
JD FROM HELL
 
Posts: 3473
Joined: Thu Aug 24, 2006 1:54 am

Post » Tue Jun 19, 2012 10:39 pm

http://www.creationkit.com/Actor_Value

And the functions:

ref.setAV
ref.modAV

For instance, modify unarmed damage (fist dmg)

player.modAV("UnarmedDamage", 10.1)

To increase player's fist dmg by 10.1 pts. Be careful using setAV, as this potentially damage base' actor value, which will affect other mods as well.
User avatar
Marcia Renton
 
Posts: 3563
Joined: Fri Jan 26, 2007 5:15 am

Post » Wed Jun 20, 2012 5:16 am

I think I will use
Game.GetPlayer().setAV("xyz", Game.GetPlayer().GetBaseAV("xyz") + value)
As this method proved to be really useful.
Also, because of your help, which I want to thank you, my attribute and class system is nearly ready.
Thanks once more.
User avatar
Kelli Wolfe
 
Posts: 3440
Joined: Thu Aug 23, 2007 7:09 am

Post » Wed Jun 20, 2012 1:40 am

Np, Good luck

A little tip thou, you could try to create a quest with referenceAlias, and use ModAv instead on the referenceAlias.
This way, you don't have to worry about the after match, as the referenceAlias will reset the actor to original state when the Quest ends. :)
User avatar
Jennifer May
 
Posts: 3376
Joined: Thu Aug 16, 2007 3:51 pm

Post » Wed Jun 20, 2012 6:14 am

@ the tip
I want the change to be constant on NPCs.
And the script on the player will run on every lvl up.
Thanks for the luck wish. :)

Edit:
Also there is the problem with modAV that it applies bonus like an enchant/potion(only problematic w/ skill or health/stamina/magicka).
User avatar
Margarita Diaz
 
Posts: 3511
Joined: Sun Aug 12, 2007 2:01 pm


Return to V - Skyrim