Jump to content

Assist Main Tank in Party Mode Questions


ynphea

Recommended Posts

Hello,

I tryed one mouth the robot and it is great !

I try to undestand better the API and the langage, in have some question please, any help will be greatly apreciated :

1 - Main Rotations i saw use directly this line 

if (ObjectManager.Me.Target > 0)

But in a dongeon with multiple enemy units in fight, with target the bot choose ?

2 - If the bot choose an ennemy target, sometimes he circle in the party for exemple healing, how do I make sure that he comes back to his last target ?

3 - How do I manage to select and assist the main tank ?

4 - The bot seems too be very intelligent and don't attack sheeped enemies for exemple ( very nice ! ) can you tell me more about this mechanics, I don't see it in the code ?

Link to comment
Share on other sites

Do you use a specific FC or do you build your own?

1. You have to differentiate between auto  Choosing Targets (handled by the  Product) or you choose manual a Target. Which one is the case?

2. You can store a guid into a Variable or set an FocusTarget or Filter through Enemies and so on. You should be a little bit more specific.

3. This is something which should be handled by the Product (or the  FC if you make your own).

4. Again, this is something the FC you use handles.

 

Overall everything you mentioned is doing (with less effort in C#).

Link to comment
Share on other sites

Hello Talamin, thank you for your fast answer,

I try to build a FC on my own, because I only do party instances of 5, so I use the "Party" Wrobot. And I would like to program our my group teamates works.

I see that in the code you can do 

var targetUnit = new WoWUnit(ObjectManager.GetObjectByGuid(ObjectManager.Me.Target).GetBaseAddress);

to get the current target, or target other monster in the code, but If I put a empty code, the bot still "takes" a target and auto-attack, this is my question. 

2 - So if I undestand well what you call "product" is the basic wrobot motor and I can overwrite this behavious with .cs, is this correct ?

3 - Just for the tank question, how do I check in C# that the WoWPlayer is a tank class ? And I can save it in memory and use it like that 

And furthermore, I use the follow fonctionnality in wowrobot for Parties, it works ok but do you know a more "natural way" so that your party follow you like real player and not like a chain of /follow

Link to comment
Share on other sites

18 minutes ago, ynphea said:

Hello Talamin, thank you for your fast answer,

I try to build a FC on my own, because I only do party instances of 5, so I use the "Party" Wrobot. And I would like to program our my group teamates works.

I see that in the code you can do 

var targetUnit = new WoWUnit(ObjectManager.GetObjectByGuid(ObjectManager.Me.Target).GetBaseAddress);

to get the current target, or target other monster in the code, but If I put a empty code, the bot still "takes" a target and auto-attack, this is my question. 

2 - So if I undestand well what you call "product" is the basic wrobot motor and I can overwrite this behavious with .cs, is this correct ?

3 - Just for the tank question, how do I check in C# that the WoWPlayer is a tank class ? And I can save it in memory and use it like that 

And furthermore, I use the follow fonctionnality in wowrobot for Parties, it works ok but do you know a more "natural way" so that your party follow you like real player and not like a chain of /follow

It depends very much on what expansion you are working on. WOTLK has a definition for a tank, whereas tbc/vanilla doesn't. (In this case you will have to define the tank yourself.
You can use the "help party members" option in advanced settings to make sure that the party begins combat with whatever anyone else in the party is attacking.
So in short, with this option on: If your tank attacks a target, your bot will automatically help the tank.
Target selection is something completely different, which if you don't override it will choose by itself.
In order to change the target manually, you have to "stop" your current combat and restart it with a new target. It's actually not as easy as it sounds. ?

Link to comment
Share on other sites

5 minutes ago, ynphea said:

Ok thanks a lot I undestand better

I am on WOTLK now, so if you could give me the definition for a tank, I will try to override it ?

I don't think wrobot has a way to get it from memory, so you will probably have to get it from lua.
Edit:
https://wowwiki-archive.fandom.com/wiki/API_UnitGroupRolesAssigned
 

string SomeString = Lua.LuaDoString<string>("return UnitGroupRolesAssigned(Unit)");

Where you replace the "Unit" with whatever. (Player, Party1, Raid1, Target etc.)

Edit Edit:
You can iterate over your party members with a for or foreach loop. ?

Edited by Ordush
Link to comment
Share on other sites

So, assuming you use wrotation you can do something like this to get the Tankname:

        public static string LUAGetTankName()
        {
            return Lua.LuaDoString<string>(@"
                            for i = 1, 4 do 
                                local isTank,_,_ = UnitGroupRolesAssigned('party' .. i)
                                if isTank then
                                    name, realm = UnitName('party' .. i)
                                    return name;
                                end
                            end");
        }

With this you get the Tank name.

Then you can use ObjectManager.GetObjectWoWPlayer().FirstOrDefault(p => p.Name == Tankname) and store it in a variable.

With this you have the Basic to Assist the Tank, Ignore the TankTarget and much more. Same goes for every Member in the Group. But be aware that the  LUA only works after you joined the  Dungeon through  Dungeonfinder. If you don´t use Dungeonfinder you have to set the Tank by yourself.

If you need more Help, or have more Questions feel free todo so.

Sometimes it would help more to post the part of the  Code where you struggle, this helps more then describing the things ?

 

Link to comment
Share on other sites

Well finaly i coded this one, seems simpler and works well

 

Quote
    internal WoWPlayer getMainTank()
    {
        List<WoWPlayerpar = new List<WoWPlayer>();
        par = Party.GetParty();
 
        if (par.Count() > 0)
        {
            foreach (WoWPlayer player in par)
            {
                if (player.WowClass == WoWClass.Warrior)
                    _mainTank = player;
            }
        }
        return _mainTank;
    }

 

Still have one problem, how to dynamicaly change the target in fight to the _mainTank now ? For exemple the tank changes target mid fight.

@Ordush you said 

Quote

 you have to "stop" your current combat and restart it with a new target. It's actually not as easy as it sounds. ?

So is this even possible after all ? Or how do I stop the current combat

Link to comment
Share on other sites

13 hours ago, ynphea said:

Well finaly i coded this one, seems simpler and works well

 

 

Still have one problem, how to dynamicaly change the target in fight to the _mainTank now ? For exemple the tank changes target mid fight.

@Ordush you said 

So is this even possible after all ? Or how do I stop the current combat

The above code will only work if you have a warrior tank and no other warriors, but i guess you already know that. ?

I can't remember the details.
Maybe it's Fight.StartFight(SOME GUID?);
Everything I am writing here I am doing by brain, since I am not home to check.
I seem to recall it being a it more irritating than just doing Fight.StartFight(); But I might be wrong. ?
 

wManager.Events.FightEvents.OnFightLoop += (unit, cancelable) =>
{
  
}

I think this is the event you need.

Edited by Ordush
Link to comment
Share on other sites

On 5/26/2021 at 7:28 PM, ynphea said:

Well finaly i coded this one, seems simpler and works well

 

 

Still have one problem, how to dynamicaly change the target in fight to the _mainTank now ? For exemple the tank changes target mid fight.

@Ordush you said 

So is this even possible after all ? Or how do I stop the current combat

As Ordush said, you only will be able to Assist the "Tank" if he is a Warrior and only one Warrior. If it is your own preset group you should be fine.

If you want to handle Target switching in Combat, it would be the best to add it to the OnFightLoop like Ordush said too. Take a look in the Fightclass Section, there you find some examples how to handle Combat MidFight. Alternatively you can check in your FC Pulse if the Target of your Tank is the same as yours, and if not then change it.

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