• Visit Rebornbuddy
  • Help with adding an enemy check to a spell

    Discussion in 'Combat Routines' started by digitalHaze, Dec 12, 2015.

    1. digitalHaze

      digitalHaze New Member

      Joined:
      Nov 22, 2015
      Messages:
      12
      Likes Received:
      0
      Trophy Points:
      1
      Im looking to add an enemy check to orbital strike and Plasma probe.

      the Spells in question are written as follows:

      Spell.CastOnGround("Orbital Strike"),
      Spell.DoTGround("Plasma Probe", 8500),


      Im looking to add an enemy check. Something like this:

      Me.CurrentTarget.WeakOrGreater()

      The reason is because I always end up spamming my friends during a run if I accidentally target them. Problem only seems to occur with these two spells. Every way ive tried so far refuses to compile. Anybody know the correct way to add the check to these two spells?
       
    2. digitalHaze

      digitalHaze New Member

      Joined:
      Nov 22, 2015
      Messages:
      12
      Likes Received:
      0
      Trophy Points:
      1
      Looking though the files it seems there is no WeakOrGreater() but there is a c.IsHostile.

      Still unable to get those spells to compile even using c.IsHostile. Any ideas?
       
    3. Teo

      Teo Member

      Joined:
      Oct 6, 2012
      Messages:
      35
      Likes Received:
      1
      Trophy Points:
      8
      Correct way is:
      Code:
      Spell.CastOnGround("Orbital Strike", ret => Me.CurrentTarget.StrongOrGreater()),
      and
      Code:
      Spell.DoTGround("Plasma Probe", 9000, ret => Me.CurrentTarget.StrongOrGreater()),
       
    4. pindleskin

      pindleskin Community Developer

      Joined:
      Oct 24, 2012
      Messages:
      1,124
      Likes Received:
      2
      Trophy Points:
      38
      Code:
      public static bool WeakOrGreater(this TorCharacter unit)
              {
                  if (unit != null) if (unit.Toughness >= CombatToughness.Weak) return true;
                  return false;
              }
      
      You can add this in Extensions.cs below StrongOrGreat() and then call it. I didn't test it though but it should work.

      You can also use any other of this enum values -> http://docs.buddywing.com/html/T_Buddy_Swtor_CombatToughness.htm
      There is also a "Player" enum there. Maybe you need that?

      also c.IsHostile should be ->
      Code:
      Spell.CastOnGround("Orbital Strike", ret => Me.CurrentTarget.IsHostile);
       
      Last edited: Dec 13, 2015
    5. digitalHaze

      digitalHaze New Member

      Joined:
      Nov 22, 2015
      Messages:
      12
      Likes Received:
      0
      Trophy Points:
      1
      Thanks guys. Worked like a charm!
       

    Share This Page