Jump to content

Lockem

Members
  • Posts

    17
  • Joined

  • Last visited

Posts posted by Lockem

  1. Hey all, 

    I've been working on a very customized fightclass with lots of custom movement and stuff... Long story short, all my code functions perfect when testing in WRotation with 'Manage Character Movement' off, but has weird quirks when using it with Quester (due to WRobot attempting to manage fight movement)... I've since explored ways of 'pausing' a fight (which semi-works), but it just causes other little quirks. Anyway,  I just saw that Fight.FightStart() has a parameter to control whether or not the bot manages movement in fight. I had the idea to trigger my own FightStart (with no movement management) on OnFightStart, but that causes a loop. Any ideas how I could basically 'replace' the default FightStart with my own with the proper params?

    Thanks a lot.

  2. So after some more research / tweaking I'm about 99.9% sure I've fixed my double Immolate problem for good...

    private bool ImmoCast;
    
    // Immolate
    if (!GcdActive
        && Immolate.KnownSpell
        && Immolate.IsSpellUsable
        && Immolate.IsDistanceGood
        && !ObjectManager.Me.IsCast
        && !ObjectManager.Target.HaveBuff("Immolate"))
        {
        ImmoCast = true;
    
        if (ImmoCast == true)
        {
        Immolate.Launch(true, false);
        Thread.Sleep(SpellManager.GetSpellCooldownTimeLeft(61304)); <-- This seemed to be the key part to fixing it. I originally had a 3500ms sleep...
        ImmoCast = false;							that obviously caused other problems, this sleep if for the remaining GCD.
        }
    }

    This post was a good read... specifically the comments by @reapler

     

  3. Just wanted to give you guys an update...

    @Seminko Using the OnFightLoop for targeting worked perfectly!

    As for immolate being double cast, it seems to be a pretty common problem with heals and some spells with a cast time... The best solution I could find was adding a timer + delay to Immolate. If you can think of a better way of doing this I would love to know.

    Again, thanks for all the help!

  4. Quote
    
    if (!ObjectManager.Target.HaveBuff("Immolate"))
    {
        Immolate.Launch();
        while (!ObjectManager.Target.HaveBuff("Immolate"))
        {
            Thread.Sleep(50);
        }
        Thread.Sleep(Usefuls.Latency + 1200);
        return;
    }

    This fixes the problem completely. Weird... thanks!

    Still curious why the problem occurred in the first place. Also, my target switching is a little 'jittery'... mind giving me an example of how OnFightLoop would work for target switching?

  5.  UPDATE: I'm 95% sure this problem only occurs when the bot is fighting a single mob... I could fix it by doing a count and adding a separate single target dot rotation, but I'd rather not, and I'm curious as to why this is happening.

     

    For testing purposes I removed dotRotation() and just made the dots the only thing in my combat rotation. The problem still happens... It seriously seems like the bot is checking for immolate while immolate is being cast and so it "pre-casts" it.

    Things I've tried:

    • tweaking latency in General Settings (I normally have 90ms)
    • limiting my framerate to 64fps
    • removing all sleeps
    • adding sleeps
    • adding a timer to immolate 

    Where I'm calling CombatRotation()  

    Spoiler
    
    internal void Rotation()
        {
            Logging.Write("[My fightclass] Is started.");
            while (_isLaunched)
            {
                try
                {
                    if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && !ObjectManager.Me.IsDeadMe)
                    {
                        if (Fight.InFight || Conditions.IsAttackedAndCannotIgnore)
                        {
                            MovementManager.Face(wManager.Wow.ObjectManager.ObjectManager.Target);
                            PetAggro();
                            CombatRotation();
                        }
                        else
                        {
                            if (ObjectManager.Target.Reaction != Reaction.Friendly && ObjectManager.Target.IsAttackable && ObjectManager.Target.GetDistance <= Range)
                            {
                                CombatRotation();
                            }
    
                            PetManager();
                            BuffRotation();
                            Healthstone();                      
                        }
                    }
                }
                catch (Exception e)
                {
                    Logging.WriteError("[My fightclass] ERROR: " + e);
                }
    
                Thread.Sleep(100);
            }
            Logging.Write("[My fightclass] Is now stopped.");
        }

     

    My new mult-dot code (I wanted to be able to use .Count) - The Immolate double cast still exists.

    Spoiler
    
       internal void CombatRotation()
        {
            List<WoWUnit> unitsToDot = ObjectManager.GetObjectWoWUnit();
    
            unitsToDot = unitsToDot.Where(u => u.IsAttackable
                                            && u.GetDistance <= Range
                                            && u.Reaction != Reaction.Friendly
                                            && u.HealthPercent >= 15
                                            && (!u.HaveBuff("Corruption") || !u.HaveBuff("Curse of Agony") || !u.HaveBuff("Immolate")))
                                        .OrderBy(u => u.Guid).ToList();
    
            foreach (WoWUnit unit in unitsToDot)
            {
                if (ObjectManager.Me.Target != unit.Guid)
                {
                    Interact.InteractGameObject(unit.GetBaseAddress);
                }
    
                if (!ObjectManager.Target.HaveBuff("Corruption"))
                {
                    Corruption.Launch();
                    Thread.Sleep(Usefuls.Latency + 1200);
                    return;
                }
                if (!ObjectManager.Target.HaveBuff("Curse of Agony"))
                {
                    CurseofAgony.Launch();
                    Thread.Sleep(Usefuls.Latency + 1200);
                    return;
                }
                if (!ObjectManager.Target.HaveBuff("Immolate") && !ObjectManager.Me.IsCast)
                {
                    Immolate.Launch(true);
                    Thread.Sleep(Usefuls.Latency + 1200);
                    return;
                }
    
                return;
            }
    
            if (DrainSoul.KnownSpell && !ObjectManager.Target.HaveBuff("Drain Soul") &&
                ItemsManager.GetItemCountByNameLUA("Soul Shard") < 5 && ObjectManager.Target.HealthPercent < 15)
            {
                DrainSoul.Launch(true);
            }
            if (DrainLife.KnownSpell && ObjectManager.Me.HealthPercent <= 60)
            {
                DrainLife.Launch(true);
            }
        }

     

     

  6. Quote

    Basically:

    1. Does it have Corruption
      1. no
      2. cast it
    2. Does it have CoA
      1. no
      2. cast it
    3. Does it have Immolate
      1. no
      2. cast it
    4. Loop for that specific mob ended, whether the immolate has been successfully cast or not
    5. Switching targets

    Not exactly...  it will make sure it actually puts immolate up, It's just that it always double casts it even if its on the target. It seems like its looping through dotRotation() while casting the immolate and it thinks it still needs immolate.

  7. Yes, it loops through all targets attacking me or my pet, applies all 3 dots to each of them and then moves on with the rotation. The problem is it always double casts Immolate...

    like this:

    Corruption > CoA > Immolate x2 > Switch targets > Corruption > CoA > Immolate x2 > Rest of rotation.

    Immolate.Launch() is how I'm casting.

  8. Having some problems with the below chunk of code... I'm trying to make a dot rotation that will tab between each target and apply my dots (This part works!). My problem is that no matter what I do it seems to want to double cast Immolate... I've tried adding a timer for it, !ObjectManager.Me.IsCast and various sleeps. I'm kind of a C# noob... so excuse any obvious mistakes.

    Thanks,

    Spoiler
    
    // Pull Rotation...
    
    internal void dotRotation()
        {
            IEnumerable<WoWUnit> unitsToDot = ObjectManager.GetObjectWoWUnit().Where(u => u.IsTargetingMeOrMyPet && (!u.HaveBuff("Corruption") || !u.HaveBuff("Curse of Agony") || !u.HaveBuff("Immolate")));
    
            foreach (WoWUnit unit in unitsToDot)
            {
                if (ObjectManager.Me.Target != unit.Guid)
                {
                    Interact.InteractGameObject(unit.GetBaseAddress);
                }
    
                if (!ObjectManager.Target.HaveBuff("Corruption"))
                {
                    Corruption.Launch();
                    Thread.Sleep(Usefuls.Latency + 1200);
                    return;
                }
                if (!ObjectManager.Target.HaveBuff("Curse of Agony"))
                {
                    CurseofAgony.Launch();
                    Thread.Sleep(Usefuls.Latency + 1200);
                    return;
                }
                if (!ObjectManager.Target.HaveBuff("Immolate") && !ObjectManager.Me.IsCast)
                {
                    Immolate.Launch();
                    Thread.Sleep(Usefuls.Latency + 1200);
                    return;
                }
    
                return;
            }
    
    // Rest of rotation once no dot targets are available...

     

     

  9. @Seminko Actually found your post about multi target rotations:

    Spoiler
    
    internal void MultiTargetRotation()
        {
            var unitsAffectingMyCombat = ObjectManager.GetUnitAttackPlayer();
    
            if (unitsAffectingMyCombat.Count <= 0)
                return;
    
            var unitsAttackMe = unitsAffectingMyCombat.Where(u => u != null && u.IsValid && u.IsTargetingMe).ToList();
    
            if (unitsAttackMe.Count >= 1)
            {
                var unitToAttack = unitsAttackMe.FirstOrDefault(u => u != null && u.IsValid && !u.IsMyPetTarget);
                if (unitToAttack != null && unitToAttack.IsValid && unitToAttack.IsAlive)
                {
                    if (!unitToAttack.IsMyTarget)
                        Interact.InteractGameObject(unitToAttack.GetBaseAddress, !ObjectManager.Me.GetMove);
    					Lua.LuaDoString("PetAttack();");
                    if (unitToAttack.IsMyTarget)
                        Lua.LuaDoString("PetAttack();");
                    Logging.Write("PET ATTACKING: " + unitToAttack);
                }
            }
    		else
    		{
    			var unitsAttackPet = unitsAffectingMyCombat.Where(u => u != null && u.IsValid && u.IsTargetingMyPet && (!u.HaveBuff("Corruption") || !u.HaveBuff("Curse of Agony"))).FirstOrDefault();
                if (unitsAttackPet != null && unitsAttackPet.IsValid && unitsAttackPet.IsAlive && !unitsAttackPet.IsMyPetTarget)
                {
                    if (!unitsAttackPet.IsMyTarget)
    				{
    					if (!unitsAttackPet.HaveBuff("Corruption") && Corruption.IsSpellUsable)
    					{
    						Interact.InteractGameObject(unitsAttackPet.GetBaseAddress, !ObjectManager.Me.GetMove);
    						SpellManager.CastSpellByNameLUA("Corruption");
    					}
    					if (!unitsAttackPet.HaveBuff("Curse of Agony") && CurseOfAgony.IsSpellUsable)
    					{
    						Interact.InteractGameObject(unitsAttackPet.GetBaseAddress, !ObjectManager.Me.GetMove);
    						SpellManager.CastSpellByNameLUA("Curse of Agony");
    					}
    				}
                    if (unitsAttackPet.IsMyTarget)
    				{	
    					if (!unitsAttackPet.HaveBuff("Corruption") && Corruption.IsSpellUsable)
    					{
    						SpellManager.CastSpellByNameLUA("Corruption");
    					}
    					if (!unitsAttackPet.HaveBuff("Curse of Agony") && CurseOfAgony.IsSpellUsable)
    					{
    						SpellManager.CastSpellByNameLUA("Curse of Agony");
    					}
                        Lua.LuaDoString("PetAttack();");
    				}
                }
    		}
        }

     

    This is exactly what I'm trying to do with my hunter FC... Just updating it a bit based on the function you linked above. Hope that's ok!

×
×
  • Create New...