Jump to content

winfrig health regain help

Recommended Posts

im a noob at modding, but i've been fooling around with editing .tex files and prefab files for existing characters (making copies of the original files before hand of course) and i was wondering if anyone here could tell me how i'd go about decreasing or increasing the amount of health wigfrid regains after killing something? its a bit different than editing health/sanity/hunger. i think this is the block i need to edit in some way, or am i wrong


local function onkill(inst, data)
if data.cause == inst.prefab 
and not data.inst:HasTag("prey") 
and not data.inst:HasTag("veggie") 
and not data.inst:HasTag("structure") then
local delta = (data.inst.components.combat.defaultdamage) * 0.25
        inst.components.health:DoDelta(delta, false, "battleborn")
        if math.random() < .1 and not data.inst.components.health.nofadeout then
        local time = data.inst.components.health.destroytime or 2
        inst:DoTaskInTime(time, function()
        local s = medScale
        if data.inst:HasTag("smallcreature") then
        s = smallScale
    elseif data.inst:HasTag("largecreature") then
    s = largeScale
        local fx = SpawnPrefab("wathgrithr_spirit")
Link to comment
Share on other sites

local delta = (data.inst.components.combat.defaultdamage) * 0.25


This line takes a fourth of the opponents attack strenght, to heal wäthgrithr with it later. If you change the .25 to something higher, she'll heal more, if you set it to something less, she'll heal less.


EDIT: The "DoDelta" bit actually heals her (you could set the value to something negative to damage her). Everything after that is for the looks.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

  • Create New...