Jump to content

What does IsSpellUsable check for?


Ordush

Recommended Posts

Hey all
i've begun rewritting my fightclases to C#.
I am using IsSpellUsable which is all nice and good.
I've looked in the dll, which is obviously obfusticated.
I can't seem to find heads and toe on what IsSpellUsable does?
I know that it checks if you have cooldown on spell, and i'm guessing that it checks if target is in line of sight.
Does it also check if you are already casting something?
Because i for some spells like frost bolt etc. you don't want to wait with casting till you are not casting, due to the lag making you able to cast faster if you spam the button. :)
Also what about launch? CastSpellByName ?

Edited by Ordush
Link to comment
Share on other sites

Hello, WRobot method "IsSpellUsable" check if spell is not gray in action bar (mana, cooldown, usable on target, ...: https://wow.gamepedia.com/API_IsUsableSpell and https://wow.gamepedia.com/API_GetSpellCooldown ).

if it is not a spell at cast on self, you need to check if target is in "line of sight" and target distance:

var notInLineOfSight = TraceLine.TraceLineGo(ObjectManager.ObjectManager.Target.Position);
var isGoodDistance  = spell.IsDistanceGood;

 

Link to comment
Share on other sites

4 hours ago, Droidz said:

Hello, WRobot method "IsSpellUsable" check if spell is not gray in action bar (mana, cooldown, usable on target, ...: https://wow.gamepedia.com/API_IsUsableSpell and https://wow.gamepedia.com/API_GetSpellCooldown ).

if it is not a spell at cast on self, you need to check if target is in "line of sight" and target distance:


var notInLineOfSight = TraceLine.TraceLineGo(ObjectManager.ObjectManager.Target.Position);
var isGoodDistance  = spell.IsDistanceGood;

 

Ah cool.
@Droidz The most important thing for me was just to know whether or not  it was trying to cast while casting.
(UnitCastingInfo("player") == nil) :)

Link to comment
Share on other sites

  • 1 month later...
On 27.12.2017 at 3:32 AM, Coleman said:

How does it work without the spell on the action bar?

In vanilla, it doesn't, because you can only check for IsUsableAction. For TBC onwards, there is IsUsableSpell

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...