pixelpuppet Posted November 30, 2014 Share Posted November 30, 2014 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") thenlocal delta = (data.inst.components.combat.defaultdamage) * 0.25 inst.components.health:DoDelta(delta, false, "battleborn") inst.components.sanity:DoDelta(delta) 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 end local fx = SpawnPrefab("wathgrithr_spirit") fx.Transform:SetPosition(data.inst:GetPosition():Get()) fx.Transform:SetScale(s,s,s) end) end endend Link to comment https://forums.kleientertainment.com/forums/topic/45089-winfrig-health-regain-help/ Share on other sites More sharing options...
Mobbstar Posted November 30, 2014 Share Posted November 30, 2014 (edited) 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. Edited November 30, 2014 by Mobbstar Link to comment https://forums.kleientertainment.com/forums/topic/45089-winfrig-health-regain-help/#findComment-576315 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now