Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
Returns the current spell haste percentage for a unit.
spellHastePercent = UnitSpellHaste(unit)
Arguments[]
- unit
- string : UnitId
Returns[]
- spellHastePercent
- number - The spell haste percent for the queried unit. Will return 0 if no valid unitId is provided.
Example[]
Prints the current spell haste percentage modifier for the targeted unit:
/dump UnitSpellHaste("target") > 13.515724182129
You can use this function to get the non-modified cast time of a spell:
local spellId = 2060 --Greater Heal local castTimeWithHaste = select(7,GetSpellInfo(spellId)) local spellHasteModifier = 1-UnitSpellHaste("player")/100 local castTimeWithoutHaste = floor(castTimeWithHaste/spellHasteModifier/100)/10 print(castTimeWithoutHaste)
This should print 2.5 for Greater Heal.