SKrnPride Posted August 14, 2016 Share Posted August 14, 2016 I have made up a modded character that is basically a copy paste of Wigfrid's life on attack passive. I would like to know which values determine how much on attack recovery she gets back. Heres the code for reference: Spoiler local function onattack(inst, data) local victim = data.target if not inst.components.health:IsDead() and IsValidVictim(victim) then local total_health = victim.components.health:GetMaxWithPenalty() local damage = data.weapon ~= nil and data.weapon.components.weapon.damage or inst.components.combat.defaultdamage local percent = (damage <= 0 and 0) or (total_health <= 0 and math.huge) or damage / total_health --math and clamp does account for 0 and infinite cases local delta = math.clamp(victim.components.combat.defaultdamage * .25 * percent, .33, 2) --decay stored battleborn if inst.battleborn > 0 then local dt = GetTime() - inst.battleborn_time - BATTLEBORN_STORE_TIME if dt >= BATTLEBORN_DECAY_TIME then inst.battleborn = 0 elseif dt > 0 then local k = dt / BATTLEBORN_DECAY_TIME inst.battleborn = Lerp(inst.battleborn, 0, k * k) end end --store new battleborn inst.battleborn = inst.battleborn + delta inst.battleborn_time = GetTime() --consume battleborn if enough has been stored if inst.battleborn > BATTLEBORN_TRIGGER_THRESHOLD then inst.components.health:DoDelta(inst.battleborn, false, "battleborn") inst.components.sanity:DoDelta(inst.battleborn) inst.battleborn = 0 end end end Link to comment https://forums.kleientertainment.com/forums/topic/69537-which-values-change-in-mods/ Share on other sites More sharing options...
Mobbstar Posted August 14, 2016 Share Posted August 14, 2016 local delta = math.clamp(victim.components.combat.defaultdamage * .25 * percent, .33, 2 This is the line you are looking for. Lower or raise all numbers a little. You should consider adjusting BATTLEBORN_TRIGGER_THRESHOLD as well. Link to comment https://forums.kleientertainment.com/forums/topic/69537-which-values-change-in-mods/#findComment-803405 Share on other sites More sharing options...
SKrnPride Posted August 14, 2016 Author Share Posted August 14, 2016 Thank you good sir Link to comment https://forums.kleientertainment.com/forums/topic/69537-which-values-change-in-mods/#findComment-803455 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