iMod 99 Posted October 26, 2016 Share Posted October 26, 2016 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 https://wrobot.eu/forums/topic/4247-dk-debuff-bug-since-update/ Share on other sites More sharing options...
Pasterke 98 Posted October 26, 2016 Share Posted October 26, 2016 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; } iMod 1 Link to comment https://wrobot.eu/forums/topic/4247-dk-debuff-bug-since-update/#findComment-19667 Share on other sites More sharing options...
iMod 99 Posted October 27, 2016 Author Share Posted October 27, 2016 Thanks i was hoping that i dont need to change my methods but thanks for the hint about the auras. Link to comment https://wrobot.eu/forums/topic/4247-dk-debuff-bug-since-update/#findComment-19675 Share on other sites More sharing options...
iMod 99 Posted October 27, 2016 Author Share Posted October 27, 2016 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 https://wrobot.eu/forums/topic/4247-dk-debuff-bug-since-update/#findComment-19677 Share on other sites More sharing options...
iMod 99 Posted October 27, 2016 Author Share Posted October 27, 2016 Well failure detected... stacks is not working anymore after the update. Reported. Link to comment https://wrobot.eu/forums/topic/4247-dk-debuff-bug-since-update/#findComment-19680 Share on other sites More sharing options...
Droidz 2742 Posted October 27, 2016 Share Posted October 27, 2016 Seem works, can you give me spell names Link to comment https://wrobot.eu/forums/topic/4247-dk-debuff-bug-since-update/#findComment-19682 Share on other sites More sharing options...
iMod 99 Posted October 27, 2016 Author Share Posted October 27, 2016 34 minutes ago, Droidz said: Seem works, can you give me spell names 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 https://wrobot.eu/forums/topic/4247-dk-debuff-bug-since-update/#findComment-19683 Share on other sites More sharing options...
iMod 99 Posted October 27, 2016 Author Share Posted October 27, 2016 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 https://wrobot.eu/forums/topic/4247-dk-debuff-bug-since-update/#findComment-19684 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now