jiraiyasm reacted to
Talamin in correct code for debuff
August 23, 2021
Add something like this, but you should think about moving all the casting checks into one Function and do the Checks only once.
if (Corruption.IsSpellUsable && Corruption.KnownSpell && Corruption.IsDistanceGood && SpellManager.GlobalCooldownTimeLeft() == 0 && !ObjectManager.Target.Rooted && ObjectManager.Me.HaveBuff("Life Tap"))
{
if(!DebuffCheckOwner("Corruption")
{
Corruption.Launch();
return;
}
}
public static bool DebuffCheckOwner(Spell spell, bool owner = true)
{
List<Aura> DebuffList = ObjectManager.Target.GetAllBuff();
Aura aura = null;
if (owner)
{
aura = DebuffList.FirstOrDefault(s => s.GetSpell.Name == spell.Name && s.Owner == ObjectManager.Me.Guid);
if (aura != null)
{
return true;
}
}
return false;
}