I was writing a custom ability with aghanim scepter upgrade for it. Scepter supposed to lower its CD. So I use a special value to store the scepter cooldowns:
"02"
{
"var_type" "FIELD_INTEGER"
"cooldown_scepter" "90 60 30"
}
and the ability's GetCooldown() function is:
ability_classname:GetCooldown(num)
if self:GetCaster():HasScepter() then
return self:GetLevelSpecialValueFor("cooldown_scepter", num)
end
return self.BaseClass.GetCooldown(self, num)
end
Then if I got scepter on this hero, console keep spewing error message about GetLevelSpecialValueFor() is a nil value and should not be called. In game the cooldown works fine -- it has 90/60/30 cooldown after ability being used. But the UI cannot display its cooldown on ability tooltip anymore.
"02"
{
"var_type" "FIELD_INTEGER"
"cooldown_scepter" "90 60 30"
}
and the ability's GetCooldown() function is:
ability_classname:GetCooldown(num)
if self:GetCaster():HasScepter() then
return self:GetLevelSpecialValueFor("cooldown_scepter", num)
end
return self.BaseClass.GetCooldown(self, num)
end
Then if I got scepter on this hero, console keep spewing error message about GetLevelSpecialValueFor() is a nil value and should not be called. In game the cooldown works fine -- it has 90/60/30 cooldown after ability being used. But the UI cannot display its cooldown on ability tooltip anymore.
Comment