What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

xrip565

New Member
Joined
Nov 16, 2015
Messages
2
Reaction score
0
[Snippet] Better Enduring Cry and Rallying Cry (mostly for TS ranger)

In OldRoutine.cs find line starting with "if (_enduringCrySlot != -1)" and change block of code to
PHP:
				// Since EC has a cooldown, we can just cast it when mobs are in range to keep our endurance charges refreshed.
				if (_enduringCrySlot != -1)
				{
					// See if we can use the skill.
					var skill = LokiPoe.InGameState.SkillBarPanel.Slot(_enduringCrySlot);

					if (!LokiPoe.Me.HasEnduranceCharge && skill.CanUse())
					{
						if (Utility.NumberOfMobsNear(LokiPoe.Me, 60) > 2)
						{
							var err1 = LokiPoe.InGameState.SkillBarPanel.Use(_enduringCrySlot, true);
							if (err1 == LokiPoe.InGameState.UseError.None)
							{
								await Coroutine.Sleep(Utility.LatencySafeValue(500));

								await Coroutines.FinishCurrentAction(false);

								return true;
							}

							Log.ErrorFormat("[Logic] Use returned {0} for {1}.", err1, skill.Name);
						}
					}
				}

It would help to cast EC only if no charges left. In default state it casting everytime when there is more than one mob in area of 20 radius.
 
Last edited:
Isn't 60 range a bit too far? I would do this that way

Code:
private int EnduranceCharges
{
	get
	{
		Aura aura = LokiPoe.ObjectManager.Me.Auras.FirstOrDefault(a => a.InternalName == "endurance_charge");
		if (aura != null)
			return aura.Charges;
		
		return 0;
	}
}

private int MaxEnduranceCharges
{
	get
	{
		return LokiPoe.ObjectManager.Me.GetStat(StatTypeGGG.MaxEnduranceCharges);
	}
}

private TimeSpan EnduranceChargesTimeLeft
{
	get
	{
		Aura aura = LokiPoe.ObjectManager.Me.Auras.FirstOrDefault(a => a.InternalName == "endurance_charge");
		if (aura != null)
			return aura.TimeLeft;

		return TimeSpan.Zero;
	}
}






// Since EC has a cooldown, we can just cast it when mobs are in range to keep our endurance charges refreshed. 
if (_enduringCrySlot != -1) 
{ 
	// See if we can use the skill. 
	var skill = LokiPoe.InGameState.SkillBarPanel.Slot(_enduringCrySlot); 

	if ( skill.CanUse() && (EnduranceChargesTimeLeft.TotalSeconds < 5 || EnduranceCharges < MaxEnduranceCharges) ) 
	{ 
		if (Utility.NumberOfMobsNear(LokiPoe.Me, 40) > 2) 
		{ 
			var err1 = LokiPoe.InGameState.SkillBarPanel.Use(_enduringCrySlot, true); 
			if (err1 == LokiPoe.InGameState.UseError.None) 
			{ 
				await Coroutine.Sleep(Utility.LatencySafeValue(500)); 

				await Coroutines.FinishCurrentAction(false); 

				return true; 
			} 

			Log.ErrorFormat("[Logic] Use returned {0} for {1}.", err1, skill.Name); 
		} 
	} 
}
 
Isn't 60 range a bit too far? I would do this that way

Code:
private int EnduranceCharges
{
	get
	{
		Aura aura = LokiPoe.ObjectManager.Me.Auras.FirstOrDefault(a => a.InternalName == "endurance_charge");
		if (aura != null)
			return aura.Charges;
		
		return 0;
	}
}

private int MaxEnduranceCharges
{
	get
	{
		return LokiPoe.ObjectManager.Me.GetStat(StatTypeGGG.MaxEnduranceCharges);
	}
}

private TimeSpan EnduranceChargesTimeLeft
{
	get
	{
		Aura aura = LokiPoe.ObjectManager.Me.Auras.FirstOrDefault(a => a.InternalName == "endurance_charge");
		if (aura != null)
			return aura.TimeLeft;

		return TimeSpan.Zero;
	}
}






// Since EC has a cooldown, we can just cast it when mobs are in range to keep our endurance charges refreshed. 
if (_enduringCrySlot != -1) 
{ 
	// See if we can use the skill. 
	var skill = LokiPoe.InGameState.SkillBarPanel.Slot(_enduringCrySlot); 

	if ( skill.CanUse() && (EnduranceChargesTimeLeft.TotalSeconds < 5 || EnduranceCharges < MaxEnduranceCharges) ) 
	{ 
		if (Utility.NumberOfMobsNear(LokiPoe.Me, 40) > 2) 
		{ 
			var err1 = LokiPoe.InGameState.SkillBarPanel.Use(_enduringCrySlot, true); 
			if (err1 == LokiPoe.InGameState.UseError.None) 
			{ 
				await Coroutine.Sleep(Utility.LatencySafeValue(500)); 

				await Coroutines.FinishCurrentAction(false); 

				return true; 
			} 

			Log.ErrorFormat("[Logic] Use returned {0} for {1}.", err1, skill.Name); 
		} 
	} 
}

What about Rallying Cry ? can u make it in sameway . I made it one, but im not happy with it.
 
Last edited:
What about Rallying Cry ? can u make it in sameway . I made it one, but im not happy with it.

Code:
private TimeSpan RallyingCryTimeLeft
{
	get
	{
		Aura aura = LokiPoe.ObjectManager.Me.Auras.FirstOrDefault(a => a.InternalName == "inspiring_cry");
		if (aura != null)
			return aura.TimeLeft;

		return TimeSpan.Zero;
	}
}

// Since EC has a cooldown, we can just cast it when mobs are in range to keep our endurance charges refreshed. 
if (_rallyingCrySlot != -1) 
{ 
	// See if we can use the skill. 
	var skill = LokiPoe.InGameState.SkillBarPanel.Slot(_rallyingCrySlot); 

	if ( skill.CanUse() && (RallyingCryTimeLeft.TotalSeconds < 5 ) ) 
	{ 
		if (Utility.NumberOfMobsNear(LokiPoe.Me, 40) > 2) 
		{ 
			var err1 = LokiPoe.InGameState.SkillBarPanel.Use(_rallyingCrySlot, true); 
			if (err1 == LokiPoe.InGameState.UseError.None) 
			{ 
				await Coroutine.Sleep(Utility.LatencySafeValue(500)); 

				await Coroutines.FinishCurrentAction(false); 

				return true; 
			} 

			Log.ErrorFormat("[Logic] Use returned {0} for {1}.", err1, skill.Name); 
		} 
	} 
}
 
Last edited:
Code:
private TimeSpan RallyingCryTimeLeft
{
	get
	{
		Aura aura = LokiPoe.ObjectManager.Me.Auras.FirstOrDefault(a => a.InternalName == "inspiring_cry");
		if (aura != null)
			return aura.TimeLeft;

		return TimeSpan.Zero;
	}
}

// Since EC has a cooldown, we can just cast it when mobs are in range to keep our endurance charges refreshed. 
if (_rallyingCrySlot != -1) 
{ 
	// See if we can use the skill. 
	var skill = LokiPoe.InGameState.SkillBarPanel.Slot(_rallyingCrySlot); 

	if ( skill.CanUse() && (RallyingCryTimeLeft.TotalSeconds < 5 ) ) 
	{ 
		if (Utility.NumberOfMobsNear(LokiPoe.Me, 40) > 2) 
		{ 
			var err1 = LokiPoe.InGameState.SkillBarPanel.Use(_rallyingCrySlot, true); 
			if (err1 == LokiPoe.InGameState.UseError.None) 
			{ 
				await Coroutine.Sleep(Utility.LatencySafeValue(500)); 

				await Coroutines.FinishCurrentAction(false); 

				return true; 
			} 

			Log.ErrorFormat("[Logic] Use returned {0} for {1}.", err1, skill.Name); 
		} 
	} 
}

Thanks but im getting error. Could u share oldroutine with added rallying cry ?
 
Totally not tested, may contain errors. If so, post the errors.
 

Attachments

how about sustaining frenzy charges in Serleth's PA build? is there a way to sustain it or how have you guys solved it alternatively?
 
how about sustaining frenzy charges in Serleth's PA build? is there a way to sustain it or how have you guys solved it alternatively?

Well, you should explain what the build is based on, and what does it need.
 
Back
Top