Guide of creating a rotation in YourRaidingBuddy 1.0 Reborn
First off we are going to devide this into 2 sections, one for normal casting(damage / buff spells) and one for Healing spells.
Section Normal Casting ::
Now, we have 2 different types of casting.
We have
and we have
For things that have 0 Gcd and 0 Cooldown (Stuff that can be casted right after a combo generally without any cooldown)
We use NoneGcdCast. This applies to certain Ninja abilities like Trick Attack for example
In a combat routine, we use something called bools to check the requirement before casting the actual spell. You can use if's if you want to, so I'll give two examples for using CastSpell with and without bool.
In YourRaidingBuddy we currently use these functions ::
- HasAura
- Actionmanager.LastSpell.Name
- AuraBook
- DataManager.GetSpellData
Ok, let's say we have Ninja as testing class and we will use it's abilities as a testing playground for the rest of the guide.
LastSpell Usage
Actionmanager.LastSpell.Name :: We have Spinning Edge as filler combo and it's our main combo generator. So let's say the bot has recently casted Spinning Edge as combo, we then use the following -->
Code:
await Spell.CastSpell("Gust Slash", () => Actionmanager.LastSpell.Name == "Spinning Edge");
Here we cast Gust Slash after using Spinning Edge Generator as combo. The Actionmanager will always have the last casted combo in it's directory, so use it wisely. I will be adding a LastSpell casted later on in the future, which logs the latest spell even non-combo spells.
Let's move on to HasAura ! -->
Let's say we want to find the Debuff Aura from Shadow Fang, we will use AuraBook examples here.
Now, since I'm currently using
Code:
private static LocalPlayer Me { get { return Core.Player; } }
We don't need to use Core.Player.CurrentTarget, but Me.CurrentTarget instead. However, the HasAura from RebornBuddy only applies to LocalPlayer and not the target. So thanks Endos for the HasAura extension method so we can use HasAura for CurrentTarget as well.
Code:
await Spell.CastSpell("Shadow Fang", () => !Me.CurrentTarget.HasAura(AuraBook.ShadowFang));
But! Since we also need to check the Debuff Timer (Clipping at 4 seconds) we need to add this as well
Then the Code will look something like
Code:
await Spell.CastSpell("Shadow Fang", () => !Me.CurrentTarget.HasAura(AuraBook.ShadowFang, 4000));
Here we check if the CurrentTarget is missing Shadow Fang debuff OR if the timer of the debuff is under 4000 Milliseconds(4 seconds).
Now if we wanted to check "Suiton" Aura on ourselves it would look something like this ::
Code:
Me.HasAura(AuraBook.Suiton)
To use it in an actual cast, it would look something like
Code:
await Spell.CastSpell("Spell Name", () => Me.HasAura(AuraBook.Suiton));
Using DataManager to get Cooldown and other stuff
We first need to create a function -->
Code:
private static readonly SpellData Jugulate = DataManager.GetSpellData(2251);
Here we use SpellData to create a function called Jugulate which is then collected data from the DataManaget.GetSpellData(ActionID).
The name Jugulate can be anything, it's just an example to give throughout this guide.
Ok! Now that we can retrive the data from the DataManager we can use the Jugulate in certain Spell Casts like
Code:
await Spell.CastSpell("Aeolian Edge", () => Jugulate.Cooldown.TotalSeconds <= 30 && Spell.LastCombo == Combo.GustSlash);
Here we collect the Time Remaining of the Jugulate cooldown, so as long as it's under 30 seconds and we have Gust Slash Combo, the Aeolian Edge will be casted.
Please note that the DataManager contains many things, like Cost of the spell, radius of the spell, range of the spell and so on. So whatever you decide to use it on, it's up to you!