Ordush 185 Posted November 19, 2017 Share Posted November 19, 2017 Hey yall. Do you know if it is possible to check for an array of buffs in C#? And if so, how? Like if you wanna check for Polymorph, Hex, Freezing Trap etc.? Link to comment https://wrobot.eu/forums/topic/7721-objectmanagertargethavebuff-array/ Share on other sites More sharing options...
Apexx 60 Posted November 19, 2017 Share Posted November 19, 2017 private static List<string> MagicEffects = new List<string>(); MagicEffects.Add("Amplify Magic"); MagicEffects.Add("Avenging Wrath"); MagicEffects.Add("Barkskin"); MagicEffects.Add("Bloodlust"); MagicEffects.Add("Dampen Magic"); MagicEffects.Add("Divine Favor"); MagicEffects.Add("Earth Shield"); MagicEffects.Add("Fade"); MagicEffects.Add("Fel Domination"); MagicEffects.Add("Hand of Protection"); MagicEffects.Add("Heroism"); MagicEffects.Add("Ice Barrier"); MagicEffects.Add("Innervate"); MagicEffects.Add("Lightning Shield"); MagicEffects.Add("Mana Shield"); MagicEffects.Add("Nether Protection"); MagicEffects.Add("Pain Suppression"); MagicEffects.Add("Power Infusion"); MagicEffects.Add("Power Word: Shield"); MagicEffects.Add("Prayer of Mending"); MagicEffects.Add("Presence of Mind"); MagicEffects.Add("Regrowth"); MagicEffects.Add("Rejuvenation"); MagicEffects.Add("Renew"); MagicEffects.Add("Sacrifice"); MagicEffects.Add("Thorns"); MagicEffects.Add("Water Shield"); foreach(string effect in MagicEffects) { if (ObjectManager.Target.HaveBuff(new Spell(effect).Ids)) { _spellName.Launch(); Logging.WriteDebug("*** Dispelled " + effect + " from " + ObjectManager.Target.Name + " ***"); Thread.Sleep(SpellManager.GlobalCooldownTimeLeft() + Usefuls.Latency); return true; } } Could try that.. sith500 1 Link to comment https://wrobot.eu/forums/topic/7721-objectmanagertargethavebuff-array/#findComment-35277 Share on other sites More sharing options...
Ordush 185 Posted November 19, 2017 Author Share Posted November 19, 2017 19 minutes ago, Apexx said: private static List<string> MagicEffects = new List<string>(); MagicEffects.Add("Amplify Magic"); MagicEffects.Add("Avenging Wrath"); MagicEffects.Add("Barkskin"); MagicEffects.Add("Bloodlust"); MagicEffects.Add("Dampen Magic"); MagicEffects.Add("Divine Favor"); MagicEffects.Add("Earth Shield"); MagicEffects.Add("Fade"); MagicEffects.Add("Fel Domination"); MagicEffects.Add("Hand of Protection"); MagicEffects.Add("Heroism"); MagicEffects.Add("Ice Barrier"); MagicEffects.Add("Innervate"); MagicEffects.Add("Lightning Shield"); MagicEffects.Add("Mana Shield"); MagicEffects.Add("Nether Protection"); MagicEffects.Add("Pain Suppression"); MagicEffects.Add("Power Infusion"); MagicEffects.Add("Power Word: Shield"); MagicEffects.Add("Prayer of Mending"); MagicEffects.Add("Presence of Mind"); MagicEffects.Add("Regrowth"); MagicEffects.Add("Rejuvenation"); MagicEffects.Add("Renew"); MagicEffects.Add("Sacrifice"); MagicEffects.Add("Thorns"); MagicEffects.Add("Water Shield"); foreach(string effect in MagicEffects) { if (ObjectManager.Target.HaveBuff(new Spell(effect).Ids)) { _spellName.Launch(); Logging.WriteDebug("*** Dispelled " + effect + " from " + ObjectManager.Target.Name + " ***"); Thread.Sleep(SpellManager.GlobalCooldownTimeLeft() + Usefuls.Latency); return true; } } Could try that.. Cheers will try it out tomorrow. :) Link to comment https://wrobot.eu/forums/topic/7721-objectmanagertargethavebuff-array/#findComment-35278 Share on other sites More sharing options...
Icesythe7 0 Posted November 20, 2017 Share Posted November 20, 2017 3 hours ago, Ordush said: @Apexx I figured why this method doesn't work well. It sure does work cross language, but you won't be able to rank check with this. If you have rank 1 of an ability, it will never do nil no matter what ID you use, be it rank 1 or rank 5 of a spell. Reason this has a consequence: Say i want it to buy mats for buffs. Then i won't be able to specify what mats to buy based on what rank is available. could just use the wow api to do it all Link to comment https://wrobot.eu/forums/topic/7721-objectmanagertargethavebuff-array/#findComment-35394 Share on other sites More sharing options...
Ordush 185 Posted November 20, 2017 Author Share Posted November 20, 2017 Just now, Icesythe7 said: could just use the wow api to do it all what wow api would that be? If you are talking about IsSpellKnown then i can't. Since that is not in TBC. Or are you talking about some other function in the wow api? Link to comment https://wrobot.eu/forums/topic/7721-objectmanagertargethavebuff-array/#findComment-35396 Share on other sites More sharing options...
Icesythe7 0 Posted November 20, 2017 Share Posted November 20, 2017 Maybe im not understanding correctly what exactly are you trying to do Link to comment https://wrobot.eu/forums/topic/7721-objectmanagertargethavebuff-array/#findComment-35398 Share on other sites More sharing options...
Ordush 185 Posted November 20, 2017 Author Share Posted November 20, 2017 LOL I just realized i posted in the wrong forum hahaha nevermind lol The method he posted obviously works fine, he is just using list instead of array. My question was simply if i could use array when checking for buffs. His answer lead me to the short answer which is no. And the long answer is: Yes if you do a foreach and check every buff 1 buff at a time. Sorry Icesythe lol Link to comment https://wrobot.eu/forums/topic/7721-objectmanagertargethavebuff-array/#findComment-35399 Share on other sites More sharing options...
Icesythe7 0 Posted November 20, 2017 Share Posted November 20, 2017 1 minute ago, Ordush said: LOL I just realized i posted in the wrong forum hahaha nevermind lol The method he posted obviously works fine, he is just using list instead of array. My question was simply if i could use array when checking for buffs. His answer lead me to the short answer which is no. And the long answer is: Yes if you do a foreach and check every buff 1 buff at a time. Sorry Icesythe lol np lol Link to comment https://wrobot.eu/forums/topic/7721-objectmanagertargethavebuff-array/#findComment-35400 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