Jump to content

counter spelling non target enemy


Recommended Posts

Hello guys, topic explains what I'm trying to accomplish. I tried to find an example but I couldn't.

I've a shadow priest and I'm using wrobot for battleground. I've made a fight class using wrobot editor, works well except there is no condition to use spell on non-target enemy.

like pqr if you have good profile it could reflect the cyclone, or sw:death the polymorph, silence the cast. 

I've zero coding experience, so any suggestions?

 

 

Link to comment
Share on other sites

Could use a function like this:

private static WoWUnit InterruptableUnit(float distance)
{
    return ObjectManager.GetWoWUnitAttackables(distance).Where(x =>
                                                                x.InCombat &&
                                                                x.HasTarget &&
                                                                x.IsCast &&
                                                                x.CanInterruptCasting &&
                                                                (((x.CastingTimeLeft / 1000) / x.CastingSpell.CastTime) * 100) < 70 &&
                                                                !MarsWrathEnhancerShamanSetting.CurrentSetting.DontInterruptList.Any(ObjectManager.Target.CastingSpell.Name.Contains) &&
                                                                !TraceLine.TraceLineGo(ObjectManager.Me.Position, x.Position, CGWorldFrameHitFlags.HitTestSpellLoS)).OrderBy(x => x.GetDistance).FirstOrDefault();
}

and implement it it similar to this:

if (InterruptableUnit(20f) != null && WindShear.IsSpellUsable && WindShear.KnownSpell)
        {
            ObjectManager.Me.FocusGuid = InterruptableUnit(20f).Guid;
            WindShear.Launch(false, true, false, "focus");
            return;
        }  

There are obviously things you'd need to change but the first function would check if there are any interruptable targets within a certain distance where there spell cast is above 70% completion. The second bit of code is what you would have in the combat rotation. It assigns the WoWUnit found by the function to your focus and the launches the spell on your focus target.

Link to comment
Share on other sites

@Mike Mail no, but same script would work for warrior, for mage and priest as well. as Shadow Priest I need it against polymorph. if someone around polying me, the char should stop doing whatever doing and use Shadow Word: Death. playing in war.mane v3.3.5a

once I got that script we can rename spells to other interrupts by different classes. I think this is most important script missing in wrobot as pvp mechanics. it could be a lot easier if there was an condition for that, anyway could you can write and tell me how to use your script step by step? I'm new to wrobot ?

 

ps. this site makes me eager to learn some coding, I've started to learn basics python, then I'll start c# thank to you guys. 

Link to comment
Share on other sites

8 hours ago, Marsbar said:

Could use a function like this:


private static WoWUnit InterruptableUnit(float distance)
{
    return ObjectManager.GetWoWUnitAttackables(distance).Where(x =>
                                                                x.InCombat &&
                                                                x.HasTarget &&
                                                                x.IsCast &&
                                                                x.CanInterruptCasting &&
                                                                (((x.CastingTimeLeft / 1000) / x.CastingSpell.CastTime) * 100) < 70 &&
                                                                !MarsWrathEnhancerShamanSetting.CurrentSetting.DontInterruptList.Any(ObjectManager.Target.CastingSpell.Name.Contains) &&
                                                                !TraceLine.TraceLineGo(ObjectManager.Me.Position, x.Position, CGWorldFrameHitFlags.HitTestSpellLoS)).OrderBy(x => x.GetDistance).FirstOrDefault();
}

and implement it it similar to this:


if (InterruptableUnit(20f) != null && WindShear.IsSpellUsable && WindShear.KnownSpell)
        {
            ObjectManager.Me.FocusGuid = InterruptableUnit(20f).Guid;
            WindShear.Launch(false, true, false, "focus");
            return;
        }  

There are obviously things you'd need to change but the first function would check if there are any interruptable targets within a certain distance where there spell cast is above 70% completion. The second bit of code is what you would have in the combat rotation. It assigns the WoWUnit found by the function to your focus and the launches the spell on your focus target.

@Marsbar I didn't get this. one of this scripts supposed to interrupt casting of non-targeted enemy? if yes, how do I add it to my wrobot?

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...