Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function TMW.CNDT.Env.GetInterruptSpell(rangeCheck)
- local lclass,eclass,index=UnitClass("player")
- if index==1 then
- return "Pummel"
- elseif index==2 then
- return "Rebuke"
- elseif index==3 then
- if GetSpecialization()==3 then --Survival
- return "Muzzle"
- else
- return "Counter Shot"
- end
- elseif index==4 then
- return "Kick"
- elseif index==5 then
- if GetSpecialization()==1 then --Discipline
- if rangeCheck then
- return nil
- else
- return "Psychic Scream"
- end
- else
- return "Silence"
- end
- elseif index==6 then
- return "Mind Freeze"
- elseif index==7 then
- return "Wind Shear"
- elseif index==8 then
- return "Counterspell"
- elseif index==9 then
- if rangeCheck then
- local pet=UnitCreatureFamily("pet")
- if pet=="Doomguard" or pet=="Felhunter" then
- local spec=GetSpecialization()
- if spec==1 then --Affliction
- return "Agony"
- elseif spec==2 then --Demonology
- return "Shadow Bolt"
- else
- return "Chaos Bolt"
- end
- end
- else
- local pet=UnitCreatureFamily("pet")
- if pet=="Doomguard" then
- return 171138 --Shadow Lock
- elseif pet=="Felhunter" then
- return 19647 --Spell Lock
- end
- end
- elseif index==10 then
- return "Spear Hand Strike"
- elseif index==11 then
- if GetSpecialization()==1 then --Balance
- return "Solar Beam"
- else
- local form=GetShapeshiftForm()
- if form==1 or form==2 then
- return "Skull Bash"
- end
- end
- elseif index==12 then
- return "Consume Magic"
- end
- return nil
- end
- function TMW.CNDT.Env.InterruptReady()
- local spell=TMW.CNDT.Env.GetInterruptSpell(false)
- if spell==nil then
- return false
- else
- local start,dur=GetSpellCooldown(spell)
- return dur~=nil and dur<0.5
- end
- end
- function TMW.CNDT.Env.InterruptInRange(unit)
- local spell=TMW.CNDT.Env.GetInterruptSpell(true)
- if spell==nil then
- return true
- else
- local range=IsSpellInRange(spell,unit)
- return range~=nil and range==1
- end
- end
- function TMW.CNDT.Env.InterruptOutOfRange(unit)
- local spell=TMW.CNDT.Env.GetInterruptSpell(true)
- if spell==nil then
- return false
- else
- local range=IsSpellInRange(spell,unit)
- return range~=nil and range==0
- end
- end
- function TMW.CNDT.Env.EnoughTimeLeft(unit)
- local name, _, _, _, _, endTime, _, _, _ = UnitCastingInfo(unit)
- if not name then
- name, _, _, _, _, endTime, _, _ = UnitChannelInfo(unit)
- end
- return endTime ~= nil and GetTime() * 1000 < endTime - 500
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement