November 19, 20178 yr 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.?
November 19, 20178 yr 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..
November 19, 20178 yr Author 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. :)
November 20, 20178 yr 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
November 20, 20178 yr Author 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?
November 20, 20178 yr Author 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
November 20, 20178 yr 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
Create an account or sign in to comment