• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • CR for only interrupt?

    Discussion in 'Honorbuddy Forum' started by lexmosti, May 16, 2013.

    1. lexmosti

      lexmosti New Member

      Joined:
      Jul 10, 2012
      Messages:
      26
      Likes Received:
      0
      Trophy Points:
      1
      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: May 16, 2013
    2. Hyperbot

      Hyperbot New Member

      Joined:
      May 18, 2013
      Messages:
      11
      Likes Received:
      0
      Trophy Points:
      0
      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
       
    3. nomnomnom

      nomnomnom Well-Known Member

      Joined:
      Feb 18, 2011
      Messages:
      1,506
      Likes Received:
      73
      Trophy Points:
      48
      Its easy to do, will make when i have a few mins spare pc time.
       
    4. lexmosti

      lexmosti New Member

      Joined:
      Jul 10, 2012
      Messages:
      26
      Likes Received:
      0
      Trophy Points:
      1
      Thank you so much. I will be very appreciated. It is going to be life saver :)
       
    5. raphus

      raphus Administrator Staff Member Moderator Buddy Core Dev

      Joined:
      Jun 17, 2010
      Messages:
      2,094
      Likes Received:
      492
      Trophy Points:
      83
      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: May 18, 2013
    6. lexmosti

      lexmosti New Member

      Joined:
      Jul 10, 2012
      Messages:
      26
      Likes Received:
      0
      Trophy Points:
      1

      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:
       

      Attached Files:

    7. raphus

      raphus Administrator Staff Member Moderator Buddy Core Dev

      Joined:
      Jun 17, 2010
      Messages:
      2,094
      Likes Received:
      492
      Trophy Points:
      83
      using Styx.WoWInternals;

      at this to the top
       
    8. raphus

      raphus Administrator Staff Member Moderator Buddy Core Dev

      Joined:
      Jun 17, 2010
      Messages:
      2,094
      Likes Received:
      492
      Trophy Points:
      83
      you need to add

      using System.Linq;

      aswell
       
    9. lexmosti

      lexmosti New Member

      Joined:
      Jul 10, 2012
      Messages:
      26
      Likes Received:
      0
      Trophy Points:
      1
      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:
       

      Attached Files:

    10. greaver77

      greaver77 New Member

      Joined:
      Dec 23, 2010
      Messages:
      67
      Likes Received:
      0
      Trophy Points:
      0
      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
       

    Share This Page