• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Singular programming

    Discussion in 'Honorbuddy Forum' started by kicko, Jan 29, 2013.

    1. kicko

      kicko New Member

      Joined:
      Jan 8, 2013
      Messages:
      15
      Likes Received:
      0
      Trophy Points:
      0
      I am tweaking singular a bit,
      I have a question,
      What hapends if you try to cast a spell than does not exist in your class?

      Code:
      public static Composite CreateInterruptSpellCast(UnitSelectionDelegate onUnit)
              {
                  return
                      new Decorator(
                      // If the target is casting, and can actually be interrupted, AND we've waited out the double-interrupt timer, then find something to interrupt with.
                          ret => onUnit != null && onUnit(ret) != null && onUnit(ret).IsCasting && onUnit(ret).CanInterruptCurrentSpellCast
                      /* && PreventDoubleInterrupt*/,
                          new PrioritySelector(
                              Spell.Cast("Rebuke", onUnit),
                              Spell.Cast("Avenger's Shield", onUnit),
                              Spell.Cast("Hammer of Justice", onUnit),
      		                       
                             
      
                              Spell.Cast("Kick", onUnit),
                              Spell.Cast("Gouge", onUnit, ret => !onUnit(ret).IsBoss() && !onUnit(ret).MeIsSafelyBehind), // Can't gouge bosses.
      
                              Spell.Cast("Counterspell", onUnit),
      
                              Spell.Cast("Wind Shear", onUnit),
      
                              Spell.Cast("Pummel", onUnit),
      
                              Spell.Cast("Spear Hand Strike", onUnit), 
      
                              // AOE interrupt
                              Spell.Cast("Disrupting Shout", onUnit),
                              // Gag Order only works on non-bosses due to it being a silence, not an interrupt!
                              Spell.Cast("Heroic Throw", onUnit, ret => TalentManager.IsSelected(7) && !onUnit(ret).IsBoss()),
      
                              Spell.Cast("Silence", onUnit),
      
                              Spell.Cast("Silencing Shot", onUnit),
      
                              // Can't stun most bosses. So use it on trash, etc.
                              Spell.Cast("Bash", onUnit, ret => !onUnit(ret).IsBoss()),
                              Spell.Cast("Skull Bash (Cat)", onUnit, ret => StyxWoW.Me.Shapeshift == ShapeshiftForm.Cat),
                              Spell.Cast("Skull Bash (Bear)", onUnit, ret => StyxWoW.Me.Shapeshift == ShapeshiftForm.Bear),
                              Spell.Cast("Mighty Bash", onUnit, ret => !onUnit(ret).IsBoss() && onUnit(ret).IsWithinMeleeRange ),
                              Spell.Cast("Solar Beam", onUnit, ret => StyxWoW.Me.Shapeshift == ShapeshiftForm.Moonkin),
      
                              Spell.Cast("Strangulate", onUnit),
                              Spell.Cast("Mind Freeze", onUnit),
      
      
                              // Racials last.
                              Spell.Cast("Arcane Torrent", onUnit),
                      // Don't waste stomp on bosses. They can't be stunned 99% of the time!
                              Spell.Cast("War Stomp", onUnit, ret => !onUnit(ret).IsBoss() && onUnit(ret).Distance < 8),
                              Spell.Cast("Quaking Palm", onUnit)
      
                              ));
              }
      
      Code above does not provide Wind Shear for shamans
      when it is called in Elemental.cs with
      Code:
       Helpers.Common.CreateInterruptSpellCast(ret => StyxWoW.Me.CurrentTarget),
       
    2. Stormchasing

      Stormchasing Community Developer

      Joined:
      Jan 15, 2011
      Messages:
      4,029
      Likes Received:
      48
      Trophy Points:
      48
      u could test it by adding a non supported spell :)
      but it should ignore it, cause singular checks with CanCast if a spell is castable and this should return false for the class (example: rebuke is a palaind spell not a shaman one)
       

    Share This Page