How to show enemy gold/hp/mp

I am creating a hero light yagami from death note, and one of his spells called "shinigami eyes" allows yagami to see all the enemies gold,hp and mp.

I know that bounty hunters ultimate does this with gold, but i think the spellibrary does not have this feature in it.

So how is this effect done i whonder, because as far as i know, all textual hud information is inside addon_english.txt and i didn't know it could be altered programatically


  • edited February 2018 Posts: 186

    use a lua modifier with MODIFIER_PROPERTY_TOOLTIP

    function modifier_display_gold:OnTooltip()
        if IsServer() then
            return self:GetParent():GetGold()

    and then in addon_english

    "DOTA_Tooltip_modifier_display_gold_Description" "this hero has %MODIFIER_PROPERTY_TOOLTIP% gold"

    you can do that with any modifier property, and MODIFIER_PROPERTY_TOOLTIP is for whatever weird stuff you wanna display that isnt done with a modifier property.

    more detail on how that works here:

  • Posts: 329

    Thank you so much!

  • edited February 2018 Posts: 329


    can't get the value to appear, what am i doing wrong here?

    --apply modifier that shows gold, hp and mp
    enemy:AddNewModifier(caster, ability, "modifier_yagami_eyes_lua", {duration = duration})
    MODIFIER LUA FILE(modifer_yagami_eyes_lua.lua)
    modifier_yagami_eyes_lua = class({})
    function modifier_yagami_eyes_lua_tooltip:DeclareFunctions()
        local funcs = { MODIFIER_PROPERTY_TOOLTIP, }
        return funcs
    function modifier_yagami_eyes_lua_tooltip:OnTooltip(params)
        --if IsServer() then
            return self:GetParent():GetGold()
    "DOTA_Tooltip_modifier_yagami_eyes_lua"             "yagami sees ur lifespan"
    "DOTA_Tooltip_modifier_yagami_eyes_lua_Description" "this hero has %MODIFIER_PROPERTY_TOOLTIP% gold"

    if its not visible in the screenshot it says : "this hero has gold"

  • Posts: 186

    my bad. needs to be



    also GetGold is actually a server only function. meaning the function doesnt exist on the client, hence the usage of IsServer() in my code.

    if you want to their gold amount to be displayed in the tooltip you need to send that info from server to client.

    simplest ways to do this are to just use modifier stacks, or if you dont want to use stacks, you could use a custom net table.


    stack count method:

    in an OnIntervalThink function you could do

    if IsServer() then

    and in your OnTooltip function

    return self:GetStackCount()
  • Posts: 329

    Arigato DankBud-sama, someting i should also mention , i made an error in this code

    function modifier_yagami_eyes_lua_tooltip:DeclareFunctions()

    the _tooltip should be removed

    alos u forgot to put parentheses behind


    but it works now! :D one more question, is it possible to show multiple values with this method?

  • You can use multiple modifiers