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

Oculus ring implementation

qvazmir

Member
Joined
Jun 19, 2014
Messages
195
Reaction score
15
Greetings. Recently demon hunters got the ability to move into oculus ring, and that implementation was made my Phelon I think? In which file was the change made? I would really like to implement it for witchdoctors also. Thanks!
 
Last edited:
Trinity\Combat\Abilities\PhelonsPlayground\Monk\Monk.ZDps.cs
is where the movement to occ puddles is called from.
 
The code is actually in CombatBase.cs , copying the code from DH to WD doesn't seem to affect the WD at all
 
It is as if that line of code gets skipped, I've turned off avoidance, kiting and stuff for testing but still, witchdoctor ignores rings.
 
Last edited:
Phelon the god of experimenting, please answer my pity request !
 
It is as if that line of code gets skipped, I've turned off avoidance, kiting and stuff for testing but still, witchdoctor ignores rings.

Currently it has heavy checks in place for demonhunter and may need to be relaxed for other classes. There are many situations where it would be pointless to run to the circle like if you cant see the target from there, so even DH is not using them very often. Needs some tweaks yet i think.

It is set up to log information in the routine log category, which u can enable in advanced settings.

Here's the code if you want to experiment: \Combat\Abilities\CombatBase.cs (near the bottom of the file)

Code:
        /// <summary>
        /// Walk towards a location with positional bonuses e.g. occulus damage bonus / serenity defensive bonus.
        /// </summary>
        /// <param name="power">Trinity power configured to move player towards a buffed position</param>
        /// <param name="maxDistance">maximum distance spot can be from player's current position</param>
        /// <param name="arriveDistance">how close to get to the middle of the spot before stopping walking</param>
        /// <returns>if a location was found and should be moved to</returns>
        public static bool TryMoveToBuffedSpot(out TrinityPower power, float maxDistance, float arriveDistance = 20f)
        {
            if (IsInCombat && !IsCurrentlyKiting && !IsCurrentlyAvoiding)
            {
                Vector3 buffedLocation;
                if (PhelonUtils.BestBuffPosition(maxDistance, Player.Position, true, out buffedLocation))
                {
                    var lastPower = SpellHistory.LastPower;
                    var distance = buffedLocation.Distance(Player.Position);


                    Logger.LogVerbose(LogCategory.Routine, $"Buffed location found Dist={distance}");


                    if (buffedLocation.Distance(Player.Position) < arriveDistance)
                    {
                        Logger.Log(LogCategory.Routine, $"Standing in Buffed Position {buffedLocation} Dist={distance}");
                    }
                    else if (!Core.Avoidance.Grid.CanRayWalk(Player.Position, buffedLocation))
                    {
                        Logger.Log(LogCategory.Routine, $"Unable to straight-line path to Buffed Position {buffedLocation} Dist={distance}");
                    }
                    else if (!Core.Avoidance.Grid.CanRayWalk(CurrentTarget.Position, buffedLocation))
                    {
                        Logger.Log(LogCategory.Routine, $"Can't see target from buffed position {buffedLocation} Dist={distance}");
                    }
                    else if (Core.Avoidance.Avoider.IsKiteOnCooldown)
                    {
                        Logger.Log(LogCategory.Routine, $"Not moving to buffed location while on kite cooldown");
                    }
                    else if (lastPower != null && buffedLocation.Distance(CurrentTarget.Position) > lastPower.MinimumRange + CurrentTarget.CollisionRadius + Player.Radius)
                    {
                        Logger.LogVerbose(LogCategory.Routine, $"Buffed spot outside attack range for power {lastPower.SNOPower} Range={lastPower.MinimumRange} TimeSinceUse={lastPower.TimeSinceUse} Dist={distance}");
                    }
                    else if (KiteDistance <= 0 || !TargetUtil.AnyMobsInRangeOfPosition(buffedLocation, KiteDistance))
                    {
                        Logger.LogVerbose(LogCategory.Routine, $"Moving to Buffed Position {buffedLocation} Dist={distance}");                       
                        power = new TrinityPower(SNOPower.Walk, maxDistance, buffedLocation);
                        return true;                       
                    }
                }
            }
            power = null;
            return false;
        }
 
Last edited:
Currently it has heavy checks in place for demonhunter and may need to be relaxed for other classes. There are many situations where it would be pointless to run to the circle like if you cant see the target from there, so even DH is not using them very often. Needs some tweaks yet i think.

It is set up to log information in the routine log category, which u can enable in advanced settings.

Here's the code if you want to experiment: \Combat\Abilities\CombatBase.cs (near the bottom of the file)

Code:
        /// <summary>
        /// Walk towards a location with positional bonuses e.g. occulus damage bonus / serenity defensive bonus.
        /// </summary>
        /// <param name="power">Trinity power configured to move player towards a buffed position</param>
        /// <param name="maxDistance">maximum distance spot can be from player's current position</param>
        /// <param name="arriveDistance">how close to get to the middle of the spot before stopping walking</param>
        /// <returns>if a location was found and should be moved to</returns>
        public static bool TryMoveToBuffedSpot(out TrinityPower power, float maxDistance, float arriveDistance = 20f)
        {
            if (IsInCombat && !IsCurrentlyKiting && !IsCurrentlyAvoiding)
            {
                Vector3 buffedLocation;
                if (PhelonUtils.BestBuffPosition(maxDistance, Player.Position, true, out buffedLocation))
                {
                    var lastPower = SpellHistory.LastPower;
                    var distance = buffedLocation.Distance(Player.Position);


                    Logger.LogVerbose(LogCategory.Routine, $"Buffed location found Dist={distance}");


                    if (buffedLocation.Distance(Player.Position) < arriveDistance)
                    {
                        Logger.Log(LogCategory.Routine, $"Standing in Buffed Position {buffedLocation} Dist={distance}");
                    }
                    else if (!Core.Avoidance.Grid.CanRayWalk(Player.Position, buffedLocation))
                    {
                        Logger.Log(LogCategory.Routine, $"Unable to straight-line path to Buffed Position {buffedLocation} Dist={distance}");
                    }
                    else if (!Core.Avoidance.Grid.CanRayWalk(CurrentTarget.Position, buffedLocation))
                    {
                        Logger.Log(LogCategory.Routine, $"Can't see target from buffed position {buffedLocation} Dist={distance}");
                    }
                    else if (Core.Avoidance.Avoider.IsKiteOnCooldown)
                    {
                        Logger.Log(LogCategory.Routine, $"Not moving to buffed location while on kite cooldown");
                    }
                    else if (lastPower != null && buffedLocation.Distance(CurrentTarget.Position) > lastPower.MinimumRange + CurrentTarget.CollisionRadius + Player.Radius)
                    {
                        Logger.LogVerbose(LogCategory.Routine, $"Buffed spot outside attack range for power {lastPower.SNOPower} Range={lastPower.MinimumRange} TimeSinceUse={lastPower.TimeSinceUse} Dist={distance}");
                    }
                    else if (KiteDistance <= 0 || !TargetUtil.AnyMobsInRangeOfPosition(buffedLocation, KiteDistance))
                    {
                        Logger.LogVerbose(LogCategory.Routine, $"Moving to Buffed Position {buffedLocation} Dist={distance}");                       
                        power = new TrinityPower(SNOPower.Walk, maxDistance, buffedLocation);
                        return true;                       
                    }
                }
            }
            power = null;
            return false;
        }


Thanks m8! I'll get on it and hopefully get it working for my witchdoctor, will do alot for a petbuild I assume!
 
Back
Top