Jump to content

Cast buff on nearby, friendly players (not in party)


Recommended Posts

How do I cast Mark of the Wild, Fortitude or any other buff on a nearby, friendly player that isn't in my party? Is there a spell condition that I do not see? I re-read the entire list twice. I see "Hostile Unit Near" and "Hostile Unit Near Target" but I desire OPPOSITE. 

Link to comment
Share on other sites

  • 1 year later...

Is this still not possible? Has it by any odd random chance been integrated? Perhaps with macro or option that I overlooked?

Link to comment
Share on other sites

Untested but, c# condition:

ObjectManager.GetObjectWoWPlayer().Where(x => x.PlayerFaction == ObjectManager.Me.PlayerFaction && !x.HaveBuff("Mark of the Wild") && x.GetDistance2D < 40).Count() > 0

Not Spell is C# Code - True in spell settings:

Interact.InteractGameObject(ObjectManager.GetObjectWoWPlayer().Where(x => x.PlayerFaction == ObjectManager.Me.PlayerFaction && !x.HaveBuff("Mark of the Wild") && x.GetDistance2D < 40).FirstOrDefault().GetBaseAddress);
SpellManager.CastSpellByNameLUA("Mark of the Wild");

Again.. completely untested. Might work for you.

Also you'd want to add another condition to make sure you only do this out of combat.

 

Edit: As a side note, I saw that in the fightclass editor there is a Optional General Setting called Additional C# code we could add a function in there which can be used in the conditions/spells and make it more clean.

We could add:

public List<WoWPlayer> GetUnbuffedFriendlies(string buffname)
    {
        return ObjectManager.GetObjectWoWPlayer().Where(x => x.PlayerFaction == ObjectManager.Me.PlayerFaction && !x.HaveBuff(buffname) && x.GetDistance2D < 40).ToList();
    }

Then in the condition and spell we can do things like - Condition:

GetUnbuffedFriendlies("Mark of the Wild").Count() > 0

and spell:

Interact.InteractGameObject(GetUnbuffedFriendlies("Mark of the Wild").FirstOrDefault().GetBaseAddress);
SpellManager.CastSpellByNameLUA("Mark of the Wild");

Once again though... its all sudo code and is untested...

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