• Visit Rebornbuddy
  • Ancestral Protector

    Discussion in 'Archives' started by Wecks, Jun 28, 2016.

    1. Wecks

      Wecks New Member

      Joined:
      Dec 4, 2011
      Messages:
      20
      Likes Received:
      1
      Trophy Points:
      3
      I run with an Ancestral Protector totem. The bot using the built in combat routine likes to drop it right in front of the toon then charge into a group of mobs basically leaving it behind and being 100% useless. Anyone have a suggestion on what I could change in the code to make it drop the totem right on the face of a magic+ mob?
       
    2. Unknown Buddy

      Unknown Buddy Member

      Joined:
      May 20, 2015
      Messages:
      603
      Likes Received:
      17
      Trophy Points:
      18
      EB > 3rdParty > OldRoutine > OldRoutine.cs

      Code:
      // Handle totem logic.
      if (_totemSlot != -1 &&
      	_totemStopwatch.ElapsedMilliseconds > OldRoutineSettings.Instance.TotemDelayMs)
      {
      	var skill = LokiPoe.InGameState.SkillBarHud.Slot(_totemSlot);
      	if (skill.CanUse()  && skill.DeployedObjects.Select(o => o as Monster).Count(t => !t.IsDead && t.Distance < 60) <
      		LokiPoe.Me.MaxTotemCount)
      	{
      		await DisableAlwaysHiglight();
      
      		await Coroutines.FinishCurrentAction();
      
      		var err1 = LokiPoe.InGameState.SkillBarHud.UseAt(_totemSlot, true,
      		myPos.GetPointAtDistanceAfterThis(cachedPosition, cachedDistance/2));
      
      		_totemStopwatch.Restart();
      
      	        if (err1 == LokiPoe.InGameState.UseResult.None)
      			return true;
      
      		Log.ErrorFormat("[Logic] UseAt returned {0} for {1}.", err1, skill.Name);
      	}
      }
      Change to:

      Code:
      // Handle totem logic.
      if (_totemSlot != -1 &&
      	_totemStopwatch.ElapsedMilliseconds > OldRoutineSettings.Instance.TotemDelayMs)
      {
      	var skill = LokiPoe.InGameState.SkillBarHud.Slot(_totemSlot);
      	if (skill.CanUse() [COLOR="#00FF00"]&& cachedRarity >= Rarity.Magic[/COLOR] && skill.DeployedObjects.Select(o => o as Monster).Count(t => !t.IsDead && t.Distance < 60) <
      		LokiPoe.Me.MaxTotemCount)
      	{
      		await DisableAlwaysHiglight();
      
      		await Coroutines.FinishCurrentAction();
      
      		var err1 = LokiPoe.InGameState.SkillBarHud.UseAt(_totemSlot, true, [COLOR="#00FF00"]cachedPosition[/COLOR]);
      
      		_totemStopwatch.Restart();
      
      	        if (err1 == LokiPoe.InGameState.UseResult.None)
      			return true;
      
      		Log.ErrorFormat("[Logic] UseAt returned {0} for {1}.", err1, skill.Name);
      	}
      }
      Highlighted the 2 changes. One is for casting on Magic or higher enemies, and the other will drop the totem directly on the mob instead of halfway between you and the mob.
       
      Last edited: Jun 30, 2016
    3. Darox

      Darox Member

      Joined:
      Nov 7, 2014
      Messages:
      353
      Likes Received:
      2
      Trophy Points:
      18
      Sorry to "necro" the thread. But this is what a lot of people are looking for. Thanks unknown buddy, I will probably add this to a couple builds. Having this totem out can help a TON with the tankier targers.
       

    Share This Page