Jump to content

Gestion du focus ?


Recommended Posts

Bonjour

J'ai une nouvelle question concernant cette mine a merveilles qu'est Wrobot.

Je voulais en savoir un peu plus concernant la gestion des focus.

Est-t-il possible d'envoyer un sort sur une cible qu on a en focus a la façon des macros du style 

/cast [@focus] Intimidating Shout

Ceci façon csharp car j'imagine qu'en fightclass creator c'est pas possible.

De meme est-il possible de controler son etat a savoir HaveBuff ou IsCast.

Merci encore :)

Link to comment
Share on other sites

	wManager.Wow.Helpers.Lua.RunMacroText("/cast [@focus] Intimidating Shout");

comme ça ?

 

bool testBuff = wManager.Wow.ObjectManager.ObjectManager.Me.HaveBuff("spellname");

bool cast = wManager.Wow.ObjectManager.ObjectManager.Me.IsCast;

 

Link to comment
Share on other sites

1 hour ago, Syna said:

wManager.Wow.Helpers.Lua.RunMacroText("/cast [@focus] Intimidating Shout");

Ok ca marche :) (Je l'utilisais deja comme ca mais je pensais qu'il y avait une ecriture en C sharp)

 

1 hour ago, Syna said:

bool testBuff = wManager.Wow.ObjectManager.ObjectManager.Me.HaveBuff("spellname");

bool cast = wManager.Wow.ObjectManager.ObjectManager.Me.IsCast;

Mais c'est pour tester mon etat, pas celui du focus ?

Link to comment
Share on other sites

oui du coup je pense qu'il faut passer par du lua peut être,

utiliser :

http://wow.gamepedia.com/API_UnitAura

en indiquant "focus" comme unitid

http://wow.gamepedia.com/UnitId

 

je peux me tromper j'viens de débarquer sur wrobot je connais pas toutes les ficelles ;) mais avec le lua tu peux avoir tes résultats

RunMacroText("/run local............. return ..............)

 

 

Link to comment
Share on other sites

Pour lancer un sort sur les focus:

        // lua id: http://wow.gamepedia.com/UnitId
        var intimidatingShout = new Spell("Intimidating Shout");
        if (intimidatingShout.KnownSpell && intimidatingShout.IsSpellUsable)//...
        {
            intimidatingShout.Launch(intimidatingShout.CastTime > 0, true, false, "focus");
            // Si vous voulez gérer manuellement le lancement utiliser: SpellManager.CastSpellByNameOn(intimidatingShout.NameInGame, "focus");
        }

Pour obtenir le focus (en objet "WowUnit"), ajouter cette methode dans votre code:

static WoWUnit GetFocus()
    {
        uint offsetFocus = 0xEAEF10; // offset wow 6.2.3.20886

        var unit = new WoWUnit(0);
        try
        {
            var focusGuid = wManager.Wow.Memory.WowMemory.Memory.ReadInt128(wManager.Wow.Memory.WowMemory.Memory.RebaseAddress(offsetFocus));
            if (focusGuid.IsNotZero())
            {
                var obj = ObjectManager.GetObjectByGuid(focusGuid);
                if (obj.Type == WoWObjectType.Player || obj.Type == WoWObjectType.Unit)
                    unit = new WoWUnit(obj.GetBaseAddress);
            }
        }
        catch (Exception e)
        { }

        return unit;
    }

Et vous pouvez utiliser le code comme ca par exemple:

var focus = GetFocus();

        if (focus.IsValid)
        {
            var intimidatingShout = new Spell("Intimidating Shout");
            if (intimidatingShout.KnownSpell &&
                intimidatingShout.IsSpellUsable &&
                focus.GetDistance < intimidatingShout.MaxRange + focus.CombatReach &&
                !focus.HaveBuff("Intimidating Shout"))
            {
                intimidatingShout.Launch(intimidatingShout.CastTime > 0, true, false, "focus");
            }
        }

 

PS: Je vais rajouter le focus directement dans WRobot dans les prochaines maj.

Link to comment
Share on other sites

Je viens de l'ajouter à l'API (attendre la prochaine mise à jour).

var guid = wManager.Wow.ObjectManager.ObjectManager.Me.FocusGuid;
var wowUnitObj = wManager.Wow.ObjectManager.ObjectManager.Me.FocusObj;

 

Link to comment
Share on other sites

  • 1 year later...

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