Adds a function (SCDF) and slash command (/scdf) for use in macros for canceling druid forms. It will not cancel a form if the GCD is in effect, you would be incapable of casting/using an ability immediately, or if you do not have enough mana to recast the form you are leaving.
The function has two optional parameters. The first is a number denoting a form to NOT cancel if you're already in it (default is 0 for caster form). The second parameter indicates to skip the check of available mana. Values other than nil, false, or 0 will stop the mana check (default is nil).
The slash command basically works the same as the function with the added benefit of taking macro conditionals:
/scdf -- Cancel form unconditionally, same as /scdf 0 0 or /run SCDF()
/scdf 0 1 -- Cancel form ingnoring mana, same as /run SCDF(0, 1)
/scdf 1 -- Equivalent to /scdf [noform:1] or /run SCDF(1)
/scdf [noflying] -- Cancel form only if not flying
The function/slash command work independant of the autoUnshift and autoDismountFlying CVar settings (most similar addons/scripts don't work properly when these are changed).
Sample macros:
Drop form to heal self while being hit
#showtooltip
/scdf [noflying]
/castsequence [noform,target=player] reset=combat/12 Barkskin, Regrowth, Rejuvenation, Lifebloom, Lifebloom, Lifebloom
Oh Crap!
#showtooltip
/scdf [noflying] 1
/stopmacro [noform:0/1]
/cast [mod:alt,form:1] Challenging Roar; [form:1] Growl; Dire Bear Form
Stealth
#showtooltip [form:3] Prowl; Shadowmeld
/cancelaura [mod:alt] Prowl
/stopmacro [combat] [stealth] [mod:alt]
/cast [form:3] Prowl; [noform] Shadowmeld
/stopmacro [noform]
/scdf [form:4]
/cast [noform] Cat Form
Travel fast
#showtooltip
/scdf [flying] 5; [stealth] 3; [mod:alt] 0 1; [swimming] 2; [flyable] 5; [outdoors] 4; 3
/stopmacro [form]
/cast [swimming] Aquatic Form; [flyable,nocombat] Swift Flight Form; [outdoors] Travel Form; Cat Form
Use a healthstone while tanking
#showtooltip
/scdf [noflying]
/stopmacro [form]
/use Master Healthstone
/cast Dire Bear Form
WARNING: Addons that automatically swap weapons on a form change will trigger the GCD so make sure that part is disabled when using macros similar to the one above or you will likely die using it while tanking.