What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

CR for only interrupt?

lexmosti

New Member
Joined
Jul 10, 2012
Messages
26
Reaction score
0
Hello guys. I'm playing as elemental shaman and I'm wondering if is it possible to create a CR that only interrupts automaticly using 'Wind Shear" and "Solar Beam"(from druids symbiosis) if I'm in the range of the mobs?Supported for Tyreal, Lazyraider or Raidbot? How can I write that? It would be very helpful for me in raids.
 
Last edited:
I know I'm bad...but sometimes I load pqr interrupt /hides. while running an HB cr. Unless the cr has a built in interrupt then I use that. Or I just manually do it :D
 
Its easy to do, will make when i have a few mins spare pc time.
 
This should work for any class and with any spell that can interrupt.

Code:
using System.Linq;
using Styx;
using Styx.TreeSharp;
using Styx.WoWInternals.WoWObjects;
using Action = Styx.TreeSharp.Action;
using Styx.CommonBot;
using Styx.CommonBot.Routines;
using Styx.WoWInternals;

namespace Interrupter
{
    public class Interrupter : CombatRoutine
    {
        public override string Name
        {
            get { return "Interrupter"; }
        }


        public override WoWClass Class
        {
            get { return StyxWoW.Me.Class; }
        }

        private WoWSpell _iSpell;


        public override Composite CombatBehavior
        {
            get
            {
                return
                    new PrioritySelector(
                        ctx => ObjectManager.GetObjectsOfType<WoWUnit>(true).OrderBy(u => u.DistanceSqr).FirstOrDefault(u => u.IsCasting && u.CanInterruptCurrentSpellCast),
                        new Decorator(
                            ret => ret != null,
                            new PrioritySelector(
                                new Decorator(
                                    ret =>
                                        {
                                            _iSpell =
                                                SpellManager.Spells.Values.FirstOrDefault(
                                                    s =>
                                                    !s.Cooldown &&
                                                    (s.SpellEffect1.EffectType == WoWSpellEffectType.InterruptCast ||
                                                     s.SpellEffect2.EffectType == WoWSpellEffectType.InterruptCast ||
                                                     s.SpellEffect3.EffectType == WoWSpellEffectType.InterruptCast));


                                            if (_iSpell == null)
                                                return false;


                                            return SpellManager.CanCast(_iSpell, (WoWUnit)ret, true, false);
                                        },
                                    new Action(ret => SpellManager.Cast(_iSpell, (WoWUnit)ret)))
                                )
                            )
                        );
            }
        }
    }
}
 
Last edited:
This should work for any class and with any spell that can interrupt.

Code:
using Styx;
using Styx.TreeSharp;
using Styx.WoWInternals.WoWObjects;
using Action = Styx.TreeSharp.Action;
using Styx.CommonBot;
using Styx.CommonBot.Routines;


namespace Interrupter
{
    public class Interrupter : CombatRoutine
    {
        public override string Name
        {
            get { return "Interrupter"; }
        }


        public override WoWClass Class
        {
            get { return StyxWoW.Me.Class; }
        }

        private WoWSpell _iSpell;


        public override Composite CombatBehavior
        {
            get
            {
                return
                    new PrioritySelector(
                        ctx => ObjectManager.GetObjectsOfType<WoWUnit>(true).OrderBy(u => u.DistanceSqr).FirstOrDefault(u => u.IsCasting && u.CanInterruptCurrentSpellCast),
                        new Decorator(
                            ret => ret != null,
                            new PrioritySelector(
                                new Decorator(
                                    ret =>
                                        {
                                            _iSpell =
                                                SpellManager.Spells.Values.FirstOrDefault(
                                                    s =>
                                                    !s.Cooldown &&
                                                    (s.SpellEffect1.EffectType == WoWSpellEffectType.InterruptCast ||
                                                     s.SpellEffect2.EffectType == WoWSpellEffectType.InterruptCast ||
                                                     s.SpellEffect3.EffectType == WoWSpellEffectType.InterruptCast));


                                            if (_iSpell == null)
                                                return false;


                                            if (SpellManager.CanCast(_iSpell, (WoWUnit) ret, true, false))
                                                return true;
                                        },
                                    new Action(ret => SpellManager.Cast(_iSpell, (WoWUnit)ret)))
                                )
                            )
                        );
            }
        }
    }
}


Thank you for your help. It says:
"Compiler Error: c:\Users\**\Desktop\HB\Routines\Interrupter\Interrupter.cs(24,17) : error CS0246: The type or namespace name 'WoWSpell' could not be found (are you missing a using directive or an assembly reference?)"
Also I couldn't able to select Interrupter at the starting of the HB, it didn't show up as combat routine. This is how i put in my HB Combat Routine folder and I added log also:
 

Attachments

using Styx.WoWInternals;

at this to the top
 
you need to add

using System.Linq;

aswell
 
CR loaded without any problem. But when i choose a bot base and hit the start, it didn't interrupt targets. Even if the target is selected. I tried with Lazy Raider, Tyreal, Combat Bot, Raid Bot in raid finder.

Here is a log:
 

Attachments

Does anyone know how to get this to work still interested in this aswell just a cc or plugin that works to interrupt for you using your spells or pummle. I tried the above with combat bot and nothing happens. Any help with this ? I have looked all over the forums and so far everyone that has anything posted does not work
 
Back
Top