Jump to content

DK Debuff Bug since update


Recommended Posts

Hello, i try to detec if the target has frostfever from me and everything was fine until the update.


Pseudocode:
if(!ObjectManager.Me.TargetObject.BuffCastedByAll(FrostFever.Name).Contains(ObjectManager.Me.Guid))
{
        use spell....
}

resul = it is spamming frostfever

Thanks in advance, iMod

Link to comment
Share on other sites

Try that :

 

public static bool myDebuffExists(String debuff)
    {
         var auras = ObjectManager.Target.GetAllBuff();
        foreach(var a in auras)
        {
            string aura = a.ToString();
            if (aura.Contains(debuff) && (aura.Contains(ObjectManager.Me.Guid.ToString()) || aura.Contains(ObjectManager.Me.Guid128.ToString()))) return true;
        }
        return false;
    }

 

Link to comment
Share on other sites

i wrote a small method for it, may it helps someone. Not tested yet but should work in the theory.

        /// <summary>
        /// Determines if the given target has the buff with the given conditions
        /// </summary>
        /// <param name="spell">The spell you want to check</param>
        /// <param name="target">The target you want to check</param>
        /// <param name="buffTimeLeft">Recast if buff time is under the given time</param>
        /// <param name="stacks">How much stacks you want at the target</param>
        /// <param name="owner">Flag that determines if we need to be the owner</param>
        /// <returns>Returns true if the target has the spell on it with the given conditions otherwise false</returns>
        public static bool HasBuff(Spell spell, WoWUnit target, int buffTimeLeft = 0, int stacks = 0, bool owner = true)
        {
            // Get target auras
            List<Aura> auraList = target.GetAllBuff();

            // Get aura
            Aura aura = null;
            if(owner)
            {
                // Set
                aura = auraList.SingleOrDefault(s => s.GetSpell.Id == spell.Id && s.Owner == ObjectManager.Me.Guid);
            }
            else
            {
                // Set
                aura = auraList.FirstOrDefault(s => s.GetSpell.Id == spell.Id);
            }

            // Any found?
            if (aura != null)
            {
                // Validate
                if (aura.TimeLeftSeconde > buffTimeLeft || aura.Stack >= stacks)
                {
                    // Return
                    return true;
                }
            }

            // Return
            return false;
        }

My brain is fked up a bit, so i can be possible that the conditions are not 100% right.

Link to comment
Share on other sites

34 minutes ago, Droidz said:

Seem works, can you give me spell names

ApplicationFrameHost_2016-10-27_14-10-14.png

SpellName: Frost Fever
I'll check that later again and report.
Stange now it works for some reasons.... sorry for the trouble -.-
You can delete the post.

Link to comment
Share on other sites

I have no clue why my old method stoped working but i found a mistake in the new one and the problem is solved now.
Thanks for your time. If you want you can delete the thread.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...