Tutorials » Combat Rotation » Step 4: Buffs
In the Buffs() method, you can create a list of buffs and conditions.
You can also use this method for other purposes, such as crafting food and drink,
enchanting items, or other tasks.
This is the most direct way to add buffs. With one condition each.
In this case, Mayo would only buff if Arcane Intellect or Frost Armor is no longer active.
public async Task<Dictionary<object, List<Func<bool>>>> Buffs()
{
var Buffs = new Dictionary<object, List<Func<bool>>>();
// By name
Buffs.Add("Arcane Intellect", new()
{
() => !GC.OM.Me.HasAura("Arcane Intellect"),
});
// By ID (Frost Armor, Rank 3)
Buffs.Add(7301, new()
{
() => !GC.OM.Me.HasAura(7301),
});
return Buffs;
}
Further information on the functions shown in this example:
Manager → ObjectManager → Models → IUnit → HasAura
Additional actions can also be added.
In this case, a macro would be executed when your health is less than or equal to 30%.
public async Task<Dictionary<object, List<Func<bool>>>> Buffs()
{
if (GC.OM.Me.CurrentHealthInPercent <= 30)
await GC.SM.CastMacroAsync(new()
{
"/run print(\"My health is low!\")",
"/run print(\"Heal me <3\")",
});
var Buffs = new Dictionary<object, List<Func<bool>>>();
// By name
Buffs.Add("Arcane Intellect", new()
{
() => !GC.OM.Me.HasAura("Arcane Intellect"),
});
// By ID (Frost Armor, Rank 3)
Buffs.Add(7301, new()
{
() => !GC.OM.Me.HasAura(7301),
});
return Buffs;
}
Another example of how to enchant a weapon.
public async Task<Dictionary<object, List<Func<bool>>>> Buffs()
{
var MainHandWeapon = GC.OM.GetEquippedItem(Constants.EquipSlot.MainHand);
if (MainHandWeapon != null && !MainHandWeapon.HasPoison)
await GC.SM.CastMacroAsync(new()
{
"/use Deadly Poison IX",
"/use 16",
});
var Buffs = new Dictionary<object, List<Func<bool>>>();
// ...
return Buffs;
}
Further information on the functions shown in this example:
Manager → ObjectManager → Models → IUnit → CurrentHealthInPercent
Manager → SpellManager → Cast Macro → CastMacroAsync
Manager → ObjectManager → Models → IUnit → HasAura
Manager → ObjectManager → Items → GetEquippedItem
Core → Constants → Item → EquipSlot
Manager → ObjectManager → Models → IItem → HasPoison
Casting items is also possible.
In this case, we would use a Healthstone when our health is less than or equal to 30%.
public async Task<Dictionary<object, List<Func<bool>>>> Buffs()
{
if (GC.OM.Me.CurrentHealthInPercent <= 30)
{
var Healthstone = GC.OM.GetBagItem("Healthstone");
if (Healthstone != null)
await GC.SM.CastItemAsync(Healthstone);
}
var Buffs = new Dictionary<object, List<Func<bool>>>();
// ...
return Buffs;
}
Further information on the functions shown in this example:
Manager → ObjectManager → Models → IUnit → CurrentHealthInPercent
Manager → ObjectManager → Items → GetBagItem
Manager → SpellManager → Cast Item → CastItemAsync
What does GC.OM.Me mean?
| Abbreviation | Meaning |
|---|---|
| GC | GameClient |
| OM | ObjectManager |
| Me | Your character |
Via GC.OM.Me you can access all the attributes of your character.
More about Me you can find here: Manager → ObjectManager → Me