• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • [Snippet] Better Enduring Cry (mostly for TS ranger)

    Discussion in 'Archives' started by xrip565, Dec 1, 2015.

    1. xrip565

      xrip565 New Member

      Joined:
      Nov 16, 2015
      Messages:
      2
      Likes Received:
      0
      Trophy Points:
      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.Me60) > 2)
                              {
                                  var 
      err1 LokiPoe.InGameState.SkillBarPanel.Use(_enduringCrySlottrue);
                                  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}."err1skill.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: Dec 2, 2015
    2. Tormiasz

      Tormiasz Community Developer

      Joined:
      Jun 16, 2014
      Messages:
      701
      Likes Received:
      5
      Trophy Points:
      18
      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); 
      		} 
      	} 
      }  
      
       
    3. xrip565

      xrip565 New Member

      Joined:
      Nov 16, 2015
      Messages:
      2
      Likes Received:
      0
      Trophy Points:
      0
      I found that 40 is perfect.
       
    4. UmitB

      UmitB Member

      Joined:
      Mar 13, 2014
      Messages:
      100
      Likes Received:
      8
      Trophy Points:
      18
      What about Rallying Cry ? can u make it in sameway . I made it one, but im not happy with it.
       
      Last edited: Dec 1, 2015
    5. Tormiasz

      Tormiasz Community Developer

      Joined:
      Jun 16, 2014
      Messages:
      701
      Likes Received:
      5
      Trophy Points:
      18
      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: Dec 2, 2015
    6. UmitB

      UmitB Member

      Joined:
      Mar 13, 2014
      Messages:
      100
      Likes Received:
      8
      Trophy Points:
      18
      Thanks but im getting error. Could u share oldroutine with added rallying cry ?
       
    7. Tormiasz

      Tormiasz Community Developer

      Joined:
      Jun 16, 2014
      Messages:
      701
      Likes Received:
      5
      Trophy Points:
      18
      Totally not tested, may contain errors. If so, post the errors.
       

      Attached Files:

    8. UmitB

      UmitB Member

      Joined:
      Mar 13, 2014
      Messages:
      100
      Likes Received:
      8
      Trophy Points:
      18
      Thanks Works like a charm.
       
    9. whistlingswordsman

      whistlingswordsman New Member

      Joined:
      May 15, 2014
      Messages:
      19
      Likes Received:
      0
      Trophy Points:
      1
      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?
       
    10. toNyx

      toNyx Well-Known Member

      Joined:
      Oct 29, 2011
      Messages:
      3,770
      Likes Received:
      35
      Trophy Points:
      48
      Well, you should explain what the build is based on, and what does it need.
       

    Share This Page