Jump to content

Mouseover ?


Lord

Recommended Posts

Hey ! 

Is it possible to add something in a fightclass so the wrotation use mouseover to heal ? 
Thanks

Link to comment
Share on other sites

  • 4 weeks later...

Hello, it is possible. Here's an c# example:

        if (wManager.Statistics.RunningTimeInSec() < 2)
        {
            robotManager.Helpful.Logging.Write("Register OnEventsLuaWithArgs");
            wManager.Wow.Helpers.EventsLuaWithArgs.OnEventsLuaWithArgs += delegate (LuaEventsId id, List<string> args)
            {
                if (id == LuaEventsId.UPDATE_MOUSEOVER_UNIT)
                {
                    string name = Lua.LuaDoString("name = UnitName('mouseover')", "name");
                    int minHealth = 110; //cast heal spells if your mouseover target drops under this value
                    int maxrange = 40; //general range for heal spells
                    WoWUnit unit = wManager.Wow.ObjectManager.ObjectManager.GetObjectWoWPlayer().SingleOrDefault(i => i.Name == name);

                    if (unit != null
                        && unit.IsValid
                        && unit.IsAlive
                        && unit.GetDistance < maxrange
                        && unit.HealthPercent < minHealth
                        && !TraceLine.TraceLineGo(ObjectManager.Me.Position, unit.Position, CGWorldFrameHitFlags.HitTestSpellLoS))
                    {
                        //here you can add more conditions which spell should be cast

                        robotManager.Helpful.Logging.Write("cast heal on mouseover");
                        wManager.Wow.Helpers.SpellManager.CastSpellByNameOn("Flash Heal", "mouseover");

                        //here you can start a thread which checks whether you are still mouse over the unit & cast more heals
                    }

                }
            };
            System.Threading.Thread.Sleep(2000);
        }

 

and the example how it can be implemented in fightclass: mouseover heal example.xml

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