Jump to content

Seminko

Members
  • Posts

    225
  • Joined

  • Last visited

Posts posted by Seminko

  1. So we've gone full circle :).

    Basically, the way I understand it, there are FightEvents which handle targetting (and probably more) which you cannot influence or control from within your fightclass - UNLESS when actually using events - OnFightStart, OnFightLoop or OnFightEnd. So when we use OnFightLoop it will loop independently of your default combat roration.

    In the OnFightLoop I would only handle targetting and the rest in my combat rotation. It's up to you to come up with the logic.

     

    Here's what I think might work - not tested, since I don't have a Lock. This should provide you all of the building blocks to fine tune it to your liking.

    Spoiler
    
    public Spell Corruption = new Spell("Corruption");
    public Spell CoA = new Spell("Curse of Agony");
    public Spell Immolate = new Spell("Immolate");
    public Spell DrainSoul = new Spell("Drain Soul");
    public Spell DrainLife = new Spell("Drain Life");
    
    public void Initialize() // When product started, initialize and launch Fightclass
    {
    	_isLaunched = true;
    	targetSwitcher(); // calling it here, once called it will register the OnFightLoop and will do that without calling it again (in combat obviously)
    	Start();
    }
    
    private void targetSwitcher()
    {
    	FightEvents.OnFightLoop += (unit, cancelable) => {
    		WoWUnit targetToSwitchTo = ObjectManager.GetUnitAttackPlayer().Where(u => u.IsValid && u.GetDistance <= Range && u.HealthPercent >= 15 && (!u.HaveBuff("Corruption") || !u.HaveBuff("Curse of Agony") || !u.HaveBuff("Immolate"))).OrderBy(ou => ou.HealthPercent).FirstOrDefault();
    		if (targetToSwitchTo.IsValid && ObjectManager.Target.HaveBuff("Corruption") && ObjectManager.Target.HaveBuff("Curse of Agony") && ObjectManager.Target.HaveBuff("Immolate")) // if the target you want to switch to is valid AND your CURRENT target has all of the three buffs, it will switch and stay on the target until it has all of the three buffs, etc etc
    		{
    			Interact.InteractGameObject(targetToSwitchTo.GetBaseAddress);
    		}
    	};
    }
    
    private void combatRotation()
    {
    	if (!ObjectManager.Target.HaveBuff("Corruption") && Corruption.IsSpellUsable) // important part that you were missing - IsSpellUsable
    	{
    		SpellManager.CastSpellByNameLUA("Corruption"); //or Launch, if CastSpellByNameLUA is not usable for TBC
    		return;
    	}
    	else if (!ObjectManager.Target.HaveBuff("Curse of Agony") && CoA.IsSpellUsable)
    	{
    		SpellManager.CastSpellByNameLUA("Curse of Agony");
    		return;
    	}
    	else if (!ObjectManager.Target.HaveBuff("Immolate") && Immolate.IsSpellUsable)
    	{
    		SpellManager.CastSpellByNameLUA("Immolate");
    		return;
    	}
    	else if (DrainSoul.KnownSpell && !ObjectManager.Target.HaveBuff("Drain Soul") && ItemsManager.GetItemCountByNameLUA("Soul Shard") < 5 && ObjectManager.Target.HealthPercent < 15  && DrainSoul.IsSpellUsable)
    	{
    		SpellManager.CastSpellByNameLUA("Drain Soul");
    		return;
    	}
    	else if (DrainLife.KnownSpell && ObjectManager.Me.HealthPercent <= 60  && DrainLife.IsSpellUsable)
    	{
    		SpellManager.CastSpellByNameLUA("Drain Life");
    		return;
    	}
    	return;
    }
    
    private void Start()
    {
    	while (_isLaunched)
    	{
    		if (Fight.InFight && ObjectManager.Me.Target > 0 && !Products.InPause && !ObjectManager.Me.IsDeadMe)
    		{
    			combatRotation();
    		}
    		Thread.Sleep(50);
    	}
    }

     

     

    Btw, you're posting in the retail version of the forums. There is a dedicated forum for TBC help and support.

  2. Well first thing I would do I set up Logging.Write inside your methods so you know when Immolate is cast, under what conditions etc.

    Also, howbout, just for the sake of testing, you did:

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

    EDIT: since you updated the previous post I'm removing all the stuff that was below... Still am curious what happens if you use the above code

  3. Just update your Range with this. Change 30 to your preferred radius mobs will be looked for and the 1 at the end for the number of mobs near target (not counting your target I believe).

    Spoiler
    
    	public float Range 
    	{ 
    		get 
    		{
    			if (ObjectManager.GetWoWUnitHostile().Count(u => u.Position.DistanceTo(ObjectManager.Target.Position) <= 30 && u.IsAttackable) > 1) // if there is more than one mob within 37 yards of the your target's position
    			{
    				return 29f;
    			}
    			else
    			{
    				return 5f;
    			}
    		} 
    	}

     

    and put the same condition into your Throw spell state (not tested in your code). If for some reason this does not work, just add it manually through the Fight Class Editor - Hostile Unit near Target

    new SpellState("Throw", 9, context => RougeSettings.CurrentSetting.Throw && ItemsManager.GetItemCountByIdLUA(3137) >= 1 && ObjectManager.Target.GetDistance <= 30 && ObjectManager.Target.GetDistance >= 8 && !ObjectManager.Me.GetMove && ObjectManager.GetWoWUnitHostile().Count(u => u.Position.DistanceTo(ObjectManager.Target.Position) <= 30 && u.IsAttackable) > 1, false, false, false, false, true, true, false, true, 2100, false, true, false, false, false, true, wManager.Wow.Helpers.FightClassCreator.YesNoAuto.No, "", "none", true, true, false),

    Let me know.

     

    EDIT: also for setting the range, it would be good if you checked if you have a throwing weapon before setting a range bigger than melee so like:

    Spoiler
    
    	public float Range 
    	{ 
    		get 
    		{
    			if (ObjectManager.GetWoWUnitHostile().Count(u => u.Position.DistanceTo(ObjectManager.Target.Position) <= 30 && u.IsAttackable) > 1 && ItemsManager.GetItemCountByIdLUA(3137)) // if there is more than one mob within 37 yards of the your target's position and you have items to throw
    			{
    				return 29f;
    			}
    			else
    			{
    				return 5f;
    			}
    		} 
    	}

     

     

  4. 17 minutes ago, valetine said:

    This can not be achieved using only [Fight Class Editor] , If I  put bigger range  in  fightclass setting, the bot will not to  close the range mobs(E.g mage mobs),It will only stand still and do nothing.

    Maybe using C # can be achieved ranged pull.

    I'm curious if you have such a rogue fightclass  , and are you willing to share?

    You can alway convert your XML to C# using the Fight Class Editor. I can share the variable range code, if you're up for it.

  5. I should have said: "whether the immolate has been successfully APPLIED or not". BTW, how does it make sure it actually puts immolate up? On vanilla where we do SpellManager.CastSpellByNameLUA("Immolate"); it doesn't actually check whether it has been applied. It starts casting Immolate but if I cancel the cast, that's it. I pressume that Spell.Launch(); acts the same way.

    This is a longshot but try using List instead of IEnumerable.

    List<WoWUnit> unitsToDot =  ObjectManager.GetObjectWoWUnit().Where(u => u.IsTargetingMeOrMyPet && (!u.HaveBuff("Corruption") || !u.HaveBuff("Curse of Agony") || !u.HaveBuff("Immolate")));

    Also, don't know how you FC is set up but I pressume you only want dotRotation() to be applied on the mobs you are already in fight with?

    EDIT: and again --> Can you share where is dotRotation() being called from and when? The more code you post the better.

  6. 4 minutes ago, Lockem said:

    Immolate launch is how I'm casting.

    Right...

    Hmmm, that's strange. Since you're looping through all the targets and you're not using while but rather if for the spell cast I can't image how it can cast twice.

    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

     

    BTW, do you use OnFightLoop? Can you share where is dotRotation() being called from? The more code you post the better.

    Going to sleep, it's 1AM here :)

  7. On 17. 11. 2017 at 10:27 AM, buffavento said:

      Hi folks 

     

      i would like to use bot on elysium server for leveling and skinning  but cant find the download file which is right, i only see other wow packs not vanilla

    Hey, could you be more specific? What download file are we talking about? The bot itself or profiles for the bot?

  8. I do not use the editor but one thing that seems off is the last screen. You used item ID whereas the condition required is the name of the item. Also the Need option for that needs to be False. If it's set to True the bots will try to use the item when IT IS on cooldown. 

    Also I would set FALSE to all the "Check if x" options.

    Let me know if that helped.

  9. On 20. 8. 2017 at 9:54 PM, eniac86 said:

    How to open "Big-mouth Clam" while fishing?
    I tried the combine - vanilla plugin but it does not open clams.
    (I have all addons turned off, latency settings are OK aswell)

    Pretty ghetto, but works:

    robotManager.Helpful.Keyboard.DownKey(wManager.Wow.Memory.WowMemory.Memory.WindowHandle, System.Windows.Forms.Keys.ShiftKey);
    Thread.Sleep(robotManager.Helpful.Others.Random(50, 150));
    ItemsManager.UseItem(1234); // item ID of the clam
    Thread.Sleep(robotManager.Helpful.Others.Random(50, 150));
    robotManager.Helpful.Keyboard.UpKey(wManager.Wow.Memory.WowMemory.Memory.WindowHandle, System.Windows.Forms.Keys.ShiftKey);
    Thread.Sleep(robotManager.Helpful.Others.Random(50, 150));

     

  10. 6 hours ago, valetine said:

    hello,did you solved this issue?

    I use timer for these. So basically this:

    						if (ItemsManager.HasItemById(5514) && !ObjectManager.Me.IsMounted && ObjectManager.Me.ManaPercentage < 15 && (_timer == null || _timer.IsReady))
    						{
    							ItemsManager.UseItem(5514);
    							_timer = new Timer(CastEverySeconds * 1000);
    							Logging.WriteDebug("Using Mana Agate");
    							Thread.Sleep(Usefuls.Latency + 1500);
    						}

     

  11. 2 minutes ago, Lockem said:

    @Seminko Actually found your post about multi target rotations:

    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!

    Sure thing, but that's an old code. ;) Now I would not "hardcode" abilities into an OnFightLoop since it might mess with your FC.

×
×
  • Create New...