• Visit Rebornbuddy
  • Ability activation question

    Discussion in 'Community Developer Forum' started by Teo, Aug 22, 2015.

    1. Teo

      Teo Member

      Joined:
      Oct 6, 2012
      Messages:
      35
      Likes Received:
      1
      Trophy Points:
      8
      I have been looking at the API and am wondering, what is the difference between Me.AbilityActivate and AbilityManager.Cast (other than the passed parameters being different)?

      Are there spells/abilities that are meant to work with one but not the other?
       
    2. alltrueist

      alltrueist Active Member

      Joined:
      Dec 10, 2012
      Messages:
      1,424
      Likes Received:
      16
      Trophy Points:
      38
      It looks like AbilityActivate just returns a bool (true,false), so I'm guessing AbilityActivate tells the bot if the ability successfully activated.
       
    3. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      Or can be activated
       
    4. willz916

      willz916 Member Legendary

      Joined:
      Jan 22, 2014
      Messages:
      303
      Likes Received:
      2
      Trophy Points:
      18
      trying to figure out how to cast a spell once every certain amount of seconds? the ability has no cd
       
    5. alltrueist

      alltrueist Active Member

      Joined:
      Dec 10, 2012
      Messages:
      1,424
      Likes Received:
      16
      Trophy Points:
      38
      Code:
      Spell.DoT("Spell Name, "debuff name", float time)
      You need the spell name, leave the debuff name blank, and use the float time in milliseconds.
       
    6. willz916

      willz916 Member Legendary

      Joined:
      Jan 22, 2014
      Messages:
      303
      Likes Received:
      2
      Trophy Points:
      18
      well the ability is a CastOnGround ability...
       
      Last edited: Nov 5, 2015
    7. alltrueist

      alltrueist Active Member

      Joined:
      Dec 10, 2012
      Messages:
      1,424
      Likes Received:
      16
      Trophy Points:
      38
      Why don't you be more specific about what you're trying to do then?
       
    8. willz916

      willz916 Member Legendary

      Joined:
      Jan 22, 2014
      Messages:
      303
      Likes Received:
      2
      Trophy Points:
      18
      trying to use the ability plasma probe on my target every 9 seconds
       
    9. alltrueist

      alltrueist Active Member

      Joined:
      Dec 10, 2012
      Messages:
      1,424
      Likes Received:
      16
      Trophy Points:
      38
      That's a DoT ability, right? So all you have to do is check for the debuff to be missing and cast it then:

      Code:
      Spell.CastonGround("Plasma Probe", ret => !Me.CurrentTarget.HasDebuff("whatever the debuff is named"))
       
    10. willz916

      willz916 Member Legendary

      Joined:
      Jan 22, 2014
      Messages:
      303
      Likes Received:
      2
      Trophy Points:
      18
      the ability dosent give a debuff like that its just an aoe... i wish i could show you....
       
    11. willz916

      willz916 Member Legendary

      Joined:
      Jan 22, 2014
      Messages:
      303
      Likes Received:
      2
      Trophy Points:
      18
      its kind of like a shammy fire aoe totem but has no cd, no debuff and it stays up for 9 seconds also how do i put an open on the cr?
       
    12. alltrueist

      alltrueist Active Member

      Joined:
      Dec 10, 2012
      Messages:
      1,424
      Likes Received:
      16
      Trophy Points:
      38
      Can you screenshot it?
       
    13. alltrueist

      alltrueist Active Member

      Joined:
      Dec 10, 2012
      Messages:
      1,424
      Likes Received:
      16
      Trophy Points:
      38
      Okay I just respeced to Engineering to see what the hell is going on. Yeah, this is difficult. There's no way to track when it's out. Here is what I'm think as a quick fix:
      The Plasma Probe puts a debuff on the target that lasts 45 seconds. Each tick of the probe refreshes that debuff. We could try tracking the debuff and whenever its time left is less than 42 seconds we refresh the probe. That's cludgy as shit, and I'm not sure how it would work in a group (when someone else is applying the same debuff), but it should work fine solo for now.

      Longer term, we'll need to write a Spell.DoTonGround function :/

      EDIT: it also puts a slow on the target while it's in range. Maybe that's easier to track?
       
    14. alltrueist

      alltrueist Active Member

      Joined:
      Dec 10, 2012
      Messages:
      1,424
      Likes Received:
      16
      Trophy Points:
      38
      How does this look?

      Code:
      public override Composite SingleTarget
      		{
      			get
      			{
      				return new LockSelector(
      					//Movement
      					CombatMovement.CloseDistance(Distance.Melee),
      
      					//Low Energy
      					new Decorator(ret => Me.EnergyPercent < 60,
      						new LockSelector(
      							Spell.Cast("Rifle Shot", ret => !Me.IsInCover())
      							)),
      
      					//Rotation
      					Spell.Cast("Distraction", ret => Me.CurrentTarget.IsCasting && !DefaultCombat.MovementDisabled),
      					Spell.Cast("Series of Shots"),
                          Spell.Cast("Explosive Probe"),
                          Spell.Cast("EMP Discharge", ret => Me.CurrentTarget.HasDebuff("Interrogation Probe")),
      					Spell.CastOnGround("Plasma Probe", ret => !Me.CurrentTarget.HasDebuff("Slowed")),
      					Spell.DoT("Interrogation Probe", "Interrogation Probe"),
      					Spell.DoT("Corrosive Dart", "Corrosive Dart"),
      					Spell.Cast("Takedown", ret => Me.CurrentTarget.HealthPercent <= 30),
                          Spell.Cast("Snipe")
      					);
      			}
      		}
      
      		public override Composite AreaOfEffect
      		{
      			get
      			{
      				return new Decorator(ret => Targeting.ShouldAoe,
      					new LockSelector(
                              Spell.CastOnGround("Plasma Probe", ret => !Me.CurrentTarget.HasDebuff("Slowed")),
                              Spell.CastOnGround("Orbital Strike"),
      						Spell.Cast("Fragmentation Grenade")
      						));
      			}
      		}
      Also, when did they start allowing you to use Snipe outside of cover? I guess that shows how much I play an IA :D
       
    15. willz916

      willz916 Member Legendary

      Joined:
      Jan 22, 2014
      Messages:
      303
      Likes Received:
      2
      Trophy Points:
      18
      On my phone right now I will give you my cr in about an hour and a half I was moding the cr before I left for class lol
       
    16. willz916

      willz916 Member Legendary

      Joined:
      Jan 22, 2014
      Messages:
      303
      Likes Received:
      2
      Trophy Points:
      18
      this is the coding ive come up with so far it still needs the "Plasma Probe" also still need to put in the opener not sure how to do that part

      Code:
      using Buddy.BehaviorTree;
      using DefaultCombat.Core;
      using DefaultCombat.Helpers;
      
      namespace DefaultCombat.Routines
      {
      	internal class Engineering : RotationBase
      	{
      		public override string Name
      		{
      			get { return "Sniper Engineering"; }
      		}
      
      		public override Composite Buffs
      		{
      			get
      			{
      				return new PrioritySelector(
      					Spell.Buff("Coordination")
      					);
      			}
      		}
      
      		public override Composite Cooldowns
      		{
      			get
      			{
      				return new LockSelector(
      					Spell.Buff("Escape"),
      					Spell.Buff("Shield Probe", ret => Me.HealthPercent <= 50),
      					Spell.Buff("Evasion", ret => Me.HealthPercent <= 30),
      					Spell.Buff("Adrenaline Probe", ret => Me.EnergyPercent <= 50),
      					Spell.Buff("Laze Target"),
      					Spell.Cast("Target Acquired")
      					);
      			}
      		}
      
      		public override Composite SingleTarget
      		{
      			get
      			{
      				return new LockSelector(
      
      
      					//Movement
      					CombatMovement.CloseDistance(Distance.Melee),
      
      
      					//Low Energy
      					new Decorator(ret => Me.EnergyPercent < 60,
      						new LockSelector(
                                  Spell.Buff("Laze Target"),
      							Spell.Cast("Series of Shots")
      							)),
      
      					//Rotation
      					Spell.Cast("Distraction", ret => Me.CurrentTarget.IsCasting && !DefaultCombat.MovementDisabled),
      					Spell.Buff("Crouch", ret => !Me.IsInCover() && !Me.IsMoving),
                          Spell.Buff("Target Aquired"),
      					Spell.Cast("Series of Shots", ret => Me.IsInCover()),
                          Spell.Cast("Takedown", ret => Me.CurrentTarget.HealthPercent <= 30),
                          Spell.Cast("Fragmentation Grenade", ret => !Me.CurrentTarget.HasDebuff("Energy Overides")),
                          Spell.CastOnGround("Plasma Probe", ret => !Me.CurrentTarget.HasDebuff("Slowed")),
                          Spell.Cast("Explosive Probe"),
                          Spell.Cast("EMP Discharge"),
      					Spell.DoT("Interrogation Probe", "", 15000),
                          Spell.Cast("Orbital Strike"),
      					Spell.DoT("Corrosive Dart", "", 12000),
                          Spell.Cast("Fragmentation Grenade")
      					);
      			}
      		}
      
      		public override Composite AreaOfEffect
      		{
      			get
      			{
      				return new Decorator(ret => Targeting.ShouldAoe,
      					new LockSelector(
      						Spell.CastOnGround("Orbital Strike"),
      						Spell.CastOnGround("Plasma Probe"),
      						Spell.Cast("Fragmentation Grenade")
      						));
      			}
      		}
      	}
      }
      
       
      Last edited: Nov 5, 2015
    17. alltrueist

      alltrueist Active Member

      Joined:
      Dec 10, 2012
      Messages:
      1,424
      Likes Received:
      16
      Trophy Points:
      38
      What was wrong with the one I posted?
       
    18. willz916

      willz916 Member Legendary

      Joined:
      Jan 22, 2014
      Messages:
      303
      Likes Received:
      2
      Trophy Points:
      18
      lol nothing i was just posting my crappy coding lol cause i was working on it
       
    19. lyvewyre

      lyvewyre Member

      Joined:
      Jan 3, 2013
      Messages:
      418
      Likes Received:
      12
      Trophy Points:
      18
      Nothing from what I can tell jumping in on this. Frag grenade only ability seems to be missing from rotation though, maybe a few more conditions such as cover for series of shots is different. But the double implementation of frag grenade in the rotation as well as preference for Orbital Strike in AoE. Mechanically same though.
       
    20. willz916

      willz916 Member Legendary

      Joined:
      Jan 22, 2014
      Messages:
      303
      Likes Received:
      2
      Trophy Points:
      18
      it is missing the "Fragmentation Grenade"
       

    Share This Page