ModDota / BugTracker

Listing bugs for Dota 2 Custom Games
9 stars 1 forks source link

Manacosts modifier property only works with positive values #106

Open Shushishtok opened 7 years ago

Shushishtok commented 7 years ago

Hello, The modifier property MODIFIER_PROPERTY_MANACOST_PERCENTAGE/GetModifierPercentageManacost only takes positive values. It does nothing at all to skills' mana cost when returning negative values. I work with lua based abilities and modifiers.

Examples: Let's assume I have a skill that requires 1000 mana. returning 10 on that modifier reduces the mana cost of a skill by 10% to 900. returning 100 on that modifier reduces the mana cost of a skill by 100% to 0. returning 150 on that modifier reduces the mana cost of a skill by 150% to -500. (which means you actually gain mana for casting in this state).

On the other end, returning -10 keeps the usual mana cost of a skill, instead of reducing it by -10%, which should turn it into 1100 mana. However, it stays at the original mana cost which is 1000. The result is the same for any negative number returned by this modifier.

Although there are some workarounds such as CastFilter calculating the actual mana cost and returning an error when you try casting a spell that is calculated above your current mana, or spending 150% of the mana when casting the spell, none of those actually update the UI which can cause confusions on why a skill refuses to be cast.

Best regards! Shush