Jump to content

ObjectManager.Target.HaveBuff Array


Ordush

Recommended Posts

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..

Link to comment
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
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...