• Visit Rebornbuddy
  • Black Mage routine issues

    Discussion in 'Rebornbuddy Forum' started by DroidFanBoyJP, Jan 1, 2014.

    1. DroidFanBoyJP

      DroidFanBoyJP Member

      Joined:
      Aug 13, 2011
      Messages:
      515
      Likes Received:
      0
      Trophy Points:
      16
      Code:
      using System;
      using System.Collections.Generic;
      using System.Linq;
      using System.Text;
      using System.Threading.Tasks;
      using ff14bot;
      using ff14bot.Enums;
      using ff14bot.Managers;
      using ff14bot.Navigation;
      using Kupo;
      using TreeSharp;
      using Action = TreeSharp.Action;
      
      namespace Kupo.Rotations
      {
      	class BlackMage : KupoRoutine
      	{
      		public override ClassJobType[] Class
      		{
      			get { return new[] {  ClassJobType.BlackMage }; }
      		}
      		public override int PullRange
      		{
      			get { return 20; }
      		}
      
              protected override Composite CreatePreCombatBuffs()
              {
                  return SummonChocobo();
              }
      
              protected override Composite CreateRest()
              {
                  return DefaultRestBehavior(r => Core.Player.CurrentManaPercent);
              }
      
      
      
      
              private string[] PullSpells = new[] { "Thunder II", "Thunder" };
              private string _BestPullSpell;
              private string BestPullSpell
              {
                  get
                  {
                      if (string.IsNullOrEmpty(_BestPullSpell))
                      {
                          foreach (var spell in PullSpells)
                          {
                              if (Actionmanager.HasSpell(spell))
                              {
                                  _BestPullSpell = spell;
                                  return spell;
                              }
                          }
                          _BestPullSpell = "Blizzard";
                          return "Blizzard";
                      }
                      else
                      {
                          return _BestPullSpell;
                      }
                  }
              }
      
      
      
      
              protected override Composite CreatePull()
              {
                  return new PrioritySelector(
                      r => Actionmanager.InSpellInRangeLOS(BestPullSpell, Core.Target),
                      new Decorator(r => (r as SpellRangeCheck?) == SpellRangeCheck.ErrorNotInRange, new Action(r => Navigator.MoveTo(Core.Target.Location))),
                      //new Decorator(r => (r as SpellRangeCheck?) == SpellRangeCheck.ErrorNotInRange, new Action(r => Navigator.MoveTo(Core.Target.Location))),
                      Apply(BestPullSpell, r => (r as SpellRangeCheck?) == SpellRangeCheck.Success || (r as SpellRangeCheck?) == SpellRangeCheck.ErrorNotInFront)
                  );
      
      
              }
      
      
      
      		protected override Composite CreateCombatBuffs()
      		{
      			return new PrioritySelector(
      				//Dem deepz
      				Apply("Raging Strikes"),
      				Apply("Swiftcast")
      			);
      		}
      		protected override Composite CreateHeal()
      		{
      			return new PrioritySelector(
      				Apply("Manaward", r => Core.Player.CurrentHealthPercent <= 80),
      				Apply("Manawall", r => Core.Player.CurrentHealthPercent <= 80),
      				Cast("Physick", r => Core.Player.CurrentHealthPercent <= 40, r => Core.Player)
      			);
      		}
      		protected override Composite CreateCombat()
      		{
      			return new PrioritySelector(
      				//Need to check for insta procs first and foremost
      				Cast("Thunder III", r => Core.Player.HasAura("Thundercloud")),
      				Cast("Fire III", r => Core.Player.HasAura("Firestarter")),
      				
      				//If we're low on mana we need to make sure we get it back
                      Cast("Blizzard III", r => Core.Player.CurrentMana < 638 && Core.Player.ClassLevel >= 38),
      				Cast("Blizzard", r => Core.Player.CurrentManaPercent <= 10 && Core.Player.ClassLevel < 38),
                      Cast("Convert", r => Core.Player.CurrentMana < 79 && Core.Player.ClassLevel >= 30), //79 Mana is how much Blizzard III is with AstralFire ... don't want to be stuck with no mana
      
      				Apply("Thunder II", r => Core.Player.ClassLevel >= 22 && !Core.Target.HasAura("Thunder")),
      				Apply("Thunder", r => Core.Player.ClassLevel < 22),
      
                      Cast("Fire III", r => Core.Player.ClassLevel >= 34 && !Core.Player.HasAura("Astral Fire III") && Core.Player.CurrentMana > 638),
      				//Bread and butter Fire spam
      				Cast("Fire")
      			);
      		}
      	}
      }







      Wanting to learn to edit these on my own, to make it do what I want it to do. But for now, what would the command be, and where would I put it, to cast Transpose once it hits a certain mana level. It's doing just fine, but it's not casting Blizzard at all, and I suspect it's because the things I'm killing are such low level, that it kills them, and ends up low on mana (at the rest spot), and won't target anything to cast Blizzard, and then waits on mana, and goes back to normal Fire rotation. Also, it's casting Fire 3 twice in a row, because it doesn't wait long enough to see if Fire 3 buff is on the target.
       
    2. Exmortem

      Exmortem Community Developer

      Joined:
      Mar 28, 2010
      Messages:
      799
      Likes Received:
      16
      Trophy Points:
      18
      It's not casting Blizzard at all because Blizzard is only set to cast if you're below level 38, i'm assuming you're 50. Also, I guess that also means Convert isn't firing off because that would solve your mana issue as well, maybe try switching Convert from a Cast to an Apply. I don't play a BLM so I don't really know the rotation, but I guess you could put this somewhere and maybe it would save you going OOM, if this doesn't work just play with it a little...

      Code:
      Apply("Transpose", r => Core.Player.CurrentManaPercent < 5 && Core.Player.HasAura("Astral Fire") || Core.Player.HasAura("Astral Fire II") || Core.Player.HasAura("Astral Fire III"), r => Core.Player),
      
      That just says that it'll cast Transpose when mana percent is below 5 AND the player has Astral Fire OR Astral Fire II OR Astral Fire III.

      Sometimes spells work as Apply and some work as Cast, switch things around if it doesn't seem to work.

      Hope it helps.
       
    3. exaccuss

      exaccuss Active Member

      Joined:
      Nov 10, 2013
      Messages:
      1,021
      Likes Received:
      6
      Trophy Points:
      38
      Sometimes for me it uses transpose even when well above 5% mp remaining.. is there any way to make it so it ONLY uses it at 5% or below?
       
    4. Exmortem

      Exmortem Community Developer

      Joined:
      Mar 28, 2010
      Messages:
      799
      Likes Received:
      16
      Trophy Points:
      18
      I don't know why it would use Transpose over 5% mana if the code I put up there is the only Transpose you have in your routine.
       
    5. nekoramen

      nekoramen Member

      Joined:
      Dec 1, 2013
      Messages:
      38
      Likes Received:
      3
      Trophy Points:
      8
      Use parentheses.
      I'm guessing the compiler read
      as "Is my mana less than 5 percent and do I have Astral Fire OR do I have Astral Fire II or III".
       
    6. exaccuss

      exaccuss Active Member

      Joined:
      Nov 10, 2013
      Messages:
      1,021
      Likes Received:
      6
      Trophy Points:
      38
      Ok thanks for that, seems to work great. Is there anyway for the bot to cast Flare when X amount of enemies are in range?

      i tried to set it as Cast("Flare", r => Core.Player.ClassLevel >= 50 && (Core.Player.HasAura("Astral Fire") || Core.Player.HasAura("Astral Fire II") || Core.Player.HasAura("Astral Fire III")),

      but didnt work lol

      EDIT: Managed to get it to work.
       
    7. exaccuss

      exaccuss Active Member

      Joined:
      Nov 10, 2013
      Messages:
      1,021
      Likes Received:
      6
      Trophy Points:
      38
      I have noticed that it tends to cast fire III two times in a row before doing fire spam. Is that normal? I was under the impression it would use fire III to get the UF3 stack, then spam fire.
       
    8. Exmortem

      Exmortem Community Developer

      Joined:
      Mar 28, 2010
      Messages:
      799
      Likes Received:
      16
      Trophy Points:
      18
      I think sometimes the bot will start casting a spell before the last spell it cast hits its target, i'm not quite sure but that's what it seems to me. So if you cast Fire III, the bot will evaluate what to cast next but since your Fire III hasn't hit target yet you don't have Astral Fire III so the bot tries to cast Fire III again, if that makes sense. I don't know if that's what happens.



      Totally right, i'm still learning as well.
       
    9. exaccuss

      exaccuss Active Member

      Joined:
      Nov 10, 2013
      Messages:
      1,021
      Likes Received:
      6
      Trophy Points:
      38
      Hmm yeah that sounds about right. I have noticed on other profiles sometimes if a buff is still casting, the next action will be cast too quickly sometimes resulting in it not working properly. Can it be changed?
       
    10. nekoramen

      nekoramen Member

      Joined:
      Dec 1, 2013
      Messages:
      38
      Likes Received:
      3
      Trophy Points:
      8
      Currently writing a BLM rotation for my relic but seriously, BLM is the hardest to get right.

      Sort of; use Apply.

      Cast is basically trying to cast it every tick(about 35ms) if it met the condition; that's why it's casting it twice.

      There's a function in Apply that prevent skills from being cast twice in a row while it waits to see if the buff is being applied or not. The problem with this is there's a beat where it waits for the aura before trying to cast the next skills in line.
       
    11. stewiethecat

      stewiethecat Member

      Joined:
      Feb 4, 2011
      Messages:
      454
      Likes Received:
      0
      Trophy Points:
      16
      my blm is 38, the issues i am seeing are just spams fire 3 and does not use fire, even after astral fire 3 buff.
      it reapplies thunder 2 just fine, but does not use thunder cloud procs.

      hope to see this updated as i would like to level my blm to 50 at some point, thanks to the creator...
       

      Attached Files:

    12. exaccuss

      exaccuss Active Member

      Joined:
      Nov 10, 2013
      Messages:
      1,021
      Likes Received:
      6
      Trophy Points:
      38
      This one works just fine for me.
       

      Attached Files:

    13. exaccuss

      exaccuss Active Member

      Joined:
      Nov 10, 2013
      Messages:
      1,021
      Likes Received:
      6
      Trophy Points:
      38
      Also if anyone can help, i cant get it to activate manaward/manawall. Is there something i am missing?

      Apply("Manaward", r => Core.Player.CurrentHealthPercent <= 80),
      Apply("Manawall", r => Core.Player.CurrentHealthPercent <= 80),
       
    14. stewiethecat

      stewiethecat Member

      Joined:
      Feb 4, 2011
      Messages:
      454
      Likes Received:
      0
      Trophy Points:
      16
      Thanks exaccuss this works fine for now, but seems to cast fire 3, fire, then another fire 3 when astrall fire 3 is still up,
      also would be nice if it cast scathe while on the move, heres my log

      [21:47:54.590 N] Applying Fire III
      [21:47:57.688 D] DoAction Spell 152 0x4003A2C6
      [21:47:57.722 N] Casting Fire
      [21:48:01.301 D] DoAction Spell 141 0x4003A2C6
      [21:48:01.335 N] Casting Fire
      [21:48:03.922 D] DoAction Spell 141 0x4003A2C6
      [21:48:03.956 N] Casting Fire
      [21:48:06.545 N] Applying Fire III
       

      Attached Files:

    15. nekoramen

      nekoramen Member

      Joined:
      Dec 1, 2013
      Messages:
      38
      Likes Received:
      3
      Trophy Points:
      8
      What level are you currently?

      If you use exaccuss's rotation he only put Astral Fire III as a condition. You only get Astral Fire III at level 40.
       
    16. nekoramen

      nekoramen Member

      Joined:
      Dec 1, 2013
      Messages:
      38
      Likes Received:
      3
      Trophy Points:
      8
      Not sure but it might be because it's an on self skill. Like flash etc you might need to specify r => Core.Player as the target.
       
    17. stewiethecat

      stewiethecat Member

      Joined:
      Feb 4, 2011
      Messages:
      454
      Likes Received:
      0
      Trophy Points:
      16
      okay i see, i am only level 38, so that's probably the issue
       

    Share This Page