How do I add buffs and debuffs to a hero

I want to modify the hero's stats by adding buffs when they get a kill for example increased strength and debuffs when the hero is killed somewhat like how silencer steals intelligence and if the buff/debuff goes back down to the default value remove the buff icon instead of showing a plus 0 strength. Also can I set a custom icon for the buffs?

Comments

  • Posts: 858

    The buff will inherit the icon of it's parent abiliy

    here's an example of modifier stack count that works like huskar's burning spears

    if not caster:HasModifier("modifier_reaper_gods_eye") then
                            abil:ApplyDataDrivenModifier(caster,caster, "modifier_reaper_gods_eye", {})
                        end
                        caster:SetModifierStackCount("modifier_reaper_gods_eye", caster, caster:GetModifierStackCount("modifier_reaper_gods_eye", caster) + 1)
    
                        Timers:CreateTimer(abil:GetLevelSpecialValueFor("stack_duration", abil:GetLevel() - 1), function()
                            caster:SetModifierStackCount("modifier_reaper_gods_eye", caster, caster:GetModifierStackCount("modifier_reaper_gods_eye", caster) - 1)
                            if caster:GetModifierStackCount("modifier_reaper_gods_eye", caster) < 1 then
                                caster:RemoveModifierByName("modifier_reaper_gods_eye")
                            end
                        end)
    

    this link will help you for adding strength and whatnot http://moddota.com/forums/discussion/14/datadriven-ability-breakdown-documentation

    MAKE CUSTOM GAMES GREAT AGAIN

    Finished-
    kv checker - https://arhowk.github.io
    panorama video series - https://moddota.com/forums/discussion/2021/inclusive-panorama-tutorial-quest-box

    My pet project This Cursed World/Crestfallen (name pending)
    https://moddota.com/forums/discussion/986/this-cursed-world-rpg#latest

  • Posts: 14

    Thank you great resource and the modifier section seems to cover what I need for the most part. Would I be able to just create 2 modifiers one for a debuff and one for a buff that are set to the action onHeroKill and onDeath that when the game starts I set them onto all the heroes and they will automatically apply and than for each time they are triggered increase the stack count?