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

About DH Sentry count around bot

austin909

Member
Joined
Apr 19, 2014
Messages
253
Reaction score
3
Hi!
How do I know how many sentries there are within 60 yards around bot?
Who can tell me the code?
Thanks!
 
1. Repair spell history queue (code below depends on it).
2. Use this snippet somewhere you need in DemonHunterCombat.cs
Code:
            // Count up Demon Hunter sentries
            float    xSentryRange = 60f;
            float    xSentryRangeSqr = xSentryRange*xSentryRange;
            TimeSpan SentryLifeTime = TimeSpan.FromSeconds(30);
            int      SentryMaxCount = 2;

            if (Passives.DemonHunter.CustomEngineering.IsActive)
            {
                SentryLifeTime = TimeSpan.FromSeconds(60);
                SentryMaxCount = 3;
            }

            int PlayerSentriesAtRange = SpellHistory.HistoryQueue
                .Where(p => p.Power.SNOPower == SNOPower.DemonHunter_Sentry &&
                            p.Power.TargetPosition.Distance2DSqr(Player.Position) < xSentryRangeSqr)
                .OrderBy(s => s.TimeSinceUse < SentryLifeTime).Take(SentryMaxCount).Count();
Good luck!
 
1. Repair spell history queue (code below depends on it).
2. Use this snippet somewhere you need in DemonHunterCombat.cs
Code:
            // Count up Demon Hunter sentries
            float    xSentryRange = 60f;
            float    xSentryRangeSqr = xSentryRange*xSentryRange;
            TimeSpan SentryLifeTime = TimeSpan.FromSeconds(30);
            int      SentryMaxCount = 2;

            if (Passives.DemonHunter.CustomEngineering.IsActive)
            {
                SentryLifeTime = TimeSpan.FromSeconds(60);
                SentryMaxCount = 3;
            }

            int PlayerSentriesAtRange = SpellHistory.HistoryQueue
                .Where(p => p.Power.SNOPower == SNOPower.DemonHunter_Sentry &&
                            p.Power.TargetPosition.Distance2DSqr(Player.Position) < xSentryRangeSqr)
                .OrderBy(s => s.TimeSinceUse < SentryLifeTime).Take(SentryMaxCount).Count();
Good luck!

Thanks for your help!
I'll test later!
:)
 
Back
Top