[CF 1548] Getting spell cost in lua comparison?
tmw-issue-import opened this issue ยท 2 comments
Sorry if this isn't the right place to put this, the lack of forums now sucks :s
Looking through \TellMeWhen\Components\Core\Conditions\Categories\spells.lua for a way to get spell cost, I'm not sure if its still possible to do this somehow in a lua conditional?
I'm trying to work out whether the cost of two spells combined is greater than current fury cost, when both spells have a potentially variable cost. In this specific case only one has a variable cost but it would be useful to be able to do both.
(GetSpellPowerCost("Chaos Strike")) + (GetSpellPowerCost("Blade Dance")) <= UnitPower("player")
I tried GetSpellPowerCost and GetSpellCost but neither seem to work. UnitPower("player") does work, so I'm assuming that I'm misunderstanding the cost aspect or that it's not possible anymore?
Posted by CurseForge user user_976011 | Imported from CurseForge issue #1548 | Raw
TMW.GetSpellCost is the function you're looking for. Its a wrapper around GetSpellPowerCost that tries a best-attempt interpretation of the complex data that GetSpellPowerCost returns.
(TMW.GetSpellCost("Chaos Strike")) + (TMW.GetSpellCost("Blade Dance")) <= UnitPower("player")
Posted by CurseForge user Cybeloras