Demonbuddy for Season 16 released, updates.buddyauth.com !
  • Visit Rebornbuddy
  • Visit Demonbuddy

Black Mage rotations?

Discussion in 'Combat Routines' started by MrCanadian, Jul 1, 2015.

  1. goldenlion

    goldenlion New Member

    Joined:
    Oct 20, 2013
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    0
    Enochian isn't hard to code - if (Enochian <5) Enochian.

    Raging Strikes and Leyline would ideally be casted just after an Enochian is cast.
    Sharpcast after a Fire III.
    Unsure how to code those, though.

    How can i fetch the Aura IDs for you? albeit, Firestarter aura is already in UltimaCR does simply:
    Core.Player.HasAura("Firestarter"))
     
  2. Cloud30000

    Cloud30000 New Member

    Joined:
    May 9, 2015
    Messages:
    298
    Likes Received:
    7
    Trophy Points:
    0
    It's all relatively easy once you know what RB and C# is capable of. You need to start with suedo-code and lay out the conditions for everything, in similar fasion to what you've already done. Here is what you have so far:

    if (LastSpellCast == Enochian) cast(Raging Strikes); //Raging Strikes will only cast right after an Enochian
    if (LastSpellCast == FireIII) cast(Sharpcast); //Sharpcast will only cast right after a FireIII
    if (EnochianCooldown>=10) && (AstralFireIIIAura>=4) && mana>2000) cast(Fire IV) //Fire4 will only cast when remaining Enochian Cooldown is atleast 10 seconds, and Astral Fire 3 aura has atleast 4 seconds, and mana is over 2000
    if (EnochianCooldown>=10) && (AstralFireIIIAura<4) && HasAura(Firestarter)) cast(Fire III) //Fire3 will only cast when remaining Enochian Cooldown is atleast 10 seconds, and Astral Fire 3 aura has less then 4 seconds, and Firestarter aura is procced
    if (EnochianCooldown>=10) && (AstralFireIIIAura<4) && mana>2000) cast(Fire I) //Fire1 will only cast when remaining Enochian Cooldown is atleast 10 seconds, and Astral Fire 3 aura has less then 4 seconds, and mana is over 2000
    if ((EnochianCooldown<10 || Mana<=2000) && !Umbral Ice ) cast(Blizzard III) //Blizzard3 will only cast when remaining Enochian Cooldown is under 10 seconds or mana is no more then 2000, and Umbral Ice aura is not active
    if ((EnochianCooldown<10 || Mana<=2000) && Umbral Ice) cast(Blizzard IV) //Blizzard4 will only cast when remaining Enochian Cooldown is under 10 seconds or mana is no more then 2000, and Umbral Ice aura is active
     
  3. goldenlion

    goldenlion New Member

    Joined:
    Oct 20, 2013
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    0
    Uh, actually i'm a C#\Java programmer by day job.
    I just need to set up intellisense and some the rest of the API.

    Okay, i found mostly everything i needed; As far i understand the structure of UltimaCR; the 'master' list is in Rotations.BlackMage, where the wall of if
    Code:
    (await) Spell()) return true; 
    casts the first spell which itself returns a Task and not a false.

    So, the entire rotation has to be formulated as a stateless priority list?
     
  4. Someone88

    Someone88 Member

    Joined:
    Jun 24, 2010
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    If you guys would get this to work it would mean the world to me. I'd appreciate it with a small donation if I can go at least into dungeons at level 60. (it must not be raids)
     
  5. Cloud30000

    Cloud30000 New Member

    Joined:
    May 9, 2015
    Messages:
    298
    Likes Received:
    7
    Trophy Points:
    0

    Here is the first experimental build based on input from Valpsjuk and you. It will try to run each rotation for 50 seconds, then timeout and restart the appropriate rotation. Core rotation also exits if Enochian and Sharpcast are off cooldown

    Ultima\Ultima.cs
    View attachment Ultima.cs

    Ultima\Spells\Spell.cs:
    View attachment Spell.cs

    Ultima\Rotations\Behaviors\Combat\BlackMage.cs
    View attachment BlackMage.cs

    Ultima\Rotations\Methods\BlackMage.cs
    View attachment BlackMage.cs

    You need to select Single Target mode in Ultima in order to use the routine. Also, be sure to select Quelling Strikes and Raging Strikes as cross-class skills for this rotation.

    Keep in mind that my black mage is level 40, and I know very little about the class and mechanics, so my testing is extremely limited.
     
  6. Cloud30000

    Cloud30000 New Member

    Joined:
    May 9, 2015
    Messages:
    298
    Likes Received:
    7
    Trophy Points:
    0
    It doesn't have to be, but that is how Ultima is organized. That particular setup seems to allow it to be the most compatible and universal to all levels and situations, without being specialized for any specific one.

    This is how I would experiment with your rotation (it can be cleaned up and incorporated into the rest of the Ultima style if it proves effective):

    Ultima\Spells\Spell.cs:
    View attachment Spell.cs

    Ultima\Rotations\Behaviors\Combat\BlackMage.cs
    View attachment BlackMage.cs

    Ultima\Rotations\Methods\BlackMage.cs
    View attachment BlackMage.cs
     
  7. Someone88

    Someone88 Member

    Joined:
    Jun 24, 2010
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    Wow, I really need to test this tomorrow. Thanks a lot!
     
  8. goldenlion

    goldenlion New Member

    Joined:
    Oct 20, 2013
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    0
    <waitforupdate>
    Here's a semi-working version.
    The main issue is that i can't stop the bot from firing a spell twice, even with specific checks on LastSpell.
    Do we have a transient, or a "Last spell QUEUED", rather than spell successfully casted?
     
  9. Cloud30000

    Cloud30000 New Member

    Joined:
    May 9, 2015
    Messages:
    298
    Likes Received:
    7
    Trophy Points:
    0
    no, but it is easy to add. Just declare it the same way that LastSpell is declared and set it at the beginning of Cast() instead of the end.

    BTW, your code tries to run your routine, then the normal Single/Smart routine right afterwards. You should change the normal Smart and Single routines to 'else if' to prevent that.
     
  10. goldenlion

    goldenlion New Member

    Joined:
    Oct 20, 2013
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    0
    puu.sh/jpXoT/df17b727e3.rar
    Okay, single targets (No Leyline \ Sharpcast \ Thunder yet) is working. Getting blizzard IV not to double cast was an incredible hassle, and the thing that worked ended up being a hard timer, of all things.
    Still lag sensitive, even if i tried to put as many checks as possible - lag means LastSpell doesn't work, and my workaround, LastSpellQueued, doesn't either.
     
  11. Someone88

    Someone88 Member

    Joined:
    Jun 24, 2010
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    Dude, thank you so much for your attempt. But since I live in euorpea the lag issue is huge. Damn!
     
  12. Eklipse

    Eklipse New Member

    Joined:
    Dec 13, 2014
    Messages:
    208
    Likes Received:
    0
    Trophy Points:
    0
    can an await coroutine not be used here ?
     
  13. goldenlion

    goldenlion New Member

    Joined:
    Oct 20, 2013
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    0
    I tried, but it didn't work. I was using:
    await Couroutine.Wait(5000, ()=> TimeLeftOnEnochian > 15)
    (TimeLeftOnEnochian returns Core.Player.GetAuraByName("Enochian").TimeLeft; with a 0 if aura doesn't exist.)

    The current checks are:
    if (LastSpellWas(MySpells.BlizzardIV)) return false;

    plus a timer of 2.5s that starts when BlizzardIV is casted, and doesn't allow any BlizzardIV cast to commence while it's on.
    Code chunk:
    Code:
            private async Task<bool> BlizzardIV()
            {
                if (!blizzardTimer.IsFinished) return false;
                if (LastSpellWas(MySpells.BlizzardIV)) return false;
                if (Ultima.lastQueuedSpell.Name == MySpells.BlizzardIV.Name) return false;
    
                if (UmbralAura && 
                    Core.Player.HasAura("Enochian", true, 4000) && 
                    !Core.Player.HasAura("Enochian", true, 14000) )
                {
    
                    if (await MySpells.BlizzardIV.Cast())
                    {
                        blizzardTimer.Reset();
                    }
                    return true;
                }
                return false;
            }
    I've tried most things i could think of - I'm going to need some input from someone more knowledgeable than me, i fear.
     
  14. Cloud30000

    Cloud30000 New Member

    Joined:
    May 9, 2015
    Messages:
    298
    Likes Received:
    7
    Trophy Points:
    0
    Have you tried:

    Code:
    if (await MySpells.BlizzardIV.Cast())
                    {
                        await CoRoutine.Wait(6000, () => LastSpell == BlizzardIV);
                    }
     
  15. Eklipse

    Eklipse New Member

    Joined:
    Dec 13, 2014
    Messages:
    208
    Likes Received:
    0
    Trophy Points:
    0
    ya this is the exact same thing I was thinking, I tried using your most recent update cloud and my game keep crashing the second I engage something and im' in single target mode any idea ? I"ve replaced all 4 files.
     
  16. goldenlion

    goldenlion New Member

    Joined:
    Oct 20, 2013
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    0
    i'll try within the night.
    Still, i'm in europe, and the double-B4 thing isn't very common. It's one refresh in ten or so - it's much better than old rotations.

    Also, for some reason, in dungeons it never double-B4'd, while on the dummy it's a common occurence.
     
  17. Cloud30000

    Cloud30000 New Member

    Joined:
    May 9, 2015
    Messages:
    298
    Likes Received:
    7
    Trophy Points:
    0
    Could you post the log? I can't test it myself until I get my BLM up to 60

    I've updated that post with a version that adds a 100ms delay in between spell cast attempts, in case that is what is causing the crash:

    Ultima\Rotations\Methods\BlackMage.cs
    **Later version now in original and latest post**

    Also, be sure to select Quelling Strikes and Raging Strikes as cross-class skills for this rotation.
     
  18. Eklipse

    Eklipse New Member

    Joined:
    Dec 13, 2014
    Messages:
    208
    Likes Received:
    0
    Trophy Points:
    0
    View attachment CrashLog.txt
     
  19. Cloud30000

    Cloud30000 New Member

    Joined:
    May 9, 2015
    Messages:
    298
    Likes Received:
    7
    Trophy Points:
    0
    Thanks; I can't tell what went wrong from the log, so I'll need to find a way to test it out myself.
     
  20. mumitroll

    mumitroll Member

    Joined:
    Mar 23, 2015
    Messages:
    74
    Likes Received:
    1
    Trophy Points:
    8
    Did anyone do more testing with this routine? Was on the run for a few days and didn't check it myself yet
     

Share This Page