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

Feature Request - Progressive GRift

leo123

New Member
Joined
Jan 7, 2015
Messages
2
Reaction score
0
Hi guys! Could you add a feature on adventure plugin?

it's very simple, is a "progressive GRift"! Basicly, increase GRift level in X if the current level was completed as succesfull... In my opinion it's very usefull to upgrade Gems...

Choose a Gem to upgrade and start with GRitft 5... it will finish quickly because it's easy and upgrade the Gem, so increase the dificult in X levels and run again, upgrade the Gem again, increase +X and reapeat...

if a Grift fail decrease in 1 lvl... and X = X - 1... it will set up GRift runs that char is able to "attend"

sorry my english...

Thanks!
 
If u can do GR70 easily, there's no difference in time GR5 and GR50, cause all u have to do is run. So just set ur bot to GR50 for one night, next time set to GR60 and so on. In some days u'll have all gems maxed. Surely, devs shoudnt spend their time on solving "2-click problem".

If u want to push rifts, u must spend ur own time to watch bot behavior and manually edit its settings for best performance, so anyway you cant push higher grifts automatically.
 
I wanted to do something similar: set max level rift you can do in adventurer, and it will decrease actual GR level by up to 15-20 (past that it's just lost XP/drops since you already spend most of your time running around) as long as it can get 100% upgrade chance on a the 3-4 gem upgrades. We'll see if I ever get around to do that (but I think I'll have a strong motivation to do so with S6 !)
 
Did some quick changes to scale rift level down while gems are low enough (and to auto-empower low level ones), if anyone wants to expand on it or make it a true setting in Adventurer feel free to re-use some code. Tested it while leveling 2 gems (including one that caps at 50) and it seems to work fine.


Open Adventurer\Coroutines\RiftCoroutines\RiftCoroutine.cs and look for that function
Code:
private async Task<bool> OpeningRift()
{
   ...
}

And replace it with this one. You can also edit the following variables in the code to change behaviour:
- autoEmpowerMaxLevel : up to which level it will empower the GR regardless of adventurer settings (60 by default)
- maxDowngrade : how many levels below the adventurer settings it will go (15 by default, so if you set it to run GR70, it will run GR55 until that's not enough to upgrade 3 or 4 times at 100%)

Code:
private async Task<bool> OpeningRift()
{
    if (RiftData.RiftWorldIds.Contains(AdvDia.CurrentWorldId))
    {
        State = States.OnNewRiftLevel;
        return false;
    }
    DisablePulse();
    if (!await _interactWithRiftStoneInteractionCoroutine.GetCoroutine()) return false;
    await Coroutine.Wait(2500, () => UIElements.RiftDialog.IsVisible);
    _interactWithRiftStoneInteractionCoroutine.Reset();
    if (!UIElements.RiftDialog.IsVisible)
    {
        return false;
    }
    _riftStartTime = DateTime.UtcNow;

    long empoweredCost = 0;
    bool shouldEmpower = _options.IsEmpowered;
    bool canEmpower = (_RiftType == RiftType.Greater && RiftData.EmpoweredRiftCost.TryGetValue(_level, out empoweredCost) && ZetaDia.PlayerData.Coinage >= empoweredCost);

    bool optimizeRiftLevel = true; // to replace with a real setting (change to false to disable)
    int autoEmpowerMaxLevel = 60; // to replace with a real setting (set to 0 to disable)
    int maxDowngrade = 15; // to replace with a real setting as well

    if (optimizeRiftLevel && _RiftType == RiftType.Greater)
    {
        int maxLevel = _level;
        int minLevel = Math.Min(maxLevel, Math.Max(13, maxLevel - maxDowngrade));

        var gems = PluginSettings.Current.Gems;

        if (gems.Gems.Count < 21)
        {
            Logger.Info("We're getting a new gem on that run, running it at minimum level (GR " + minLevel + ")!");
            _level = minLevel;
        }
        else {
            for (_level = minLevel; _level < maxLevel; _level++)
            {
                int maxRankForUpgrade = _level - 10;

                // Upgrade checks should be done in AdventurerGems or AdventurerGem classes to not duplicate capped gems list here 
                int guaranteedUpgrades = gems.Gems.Where(g => g.Rank <= maxRankForUpgrade && !g.MaxRank).ToList().Count
                    + gems.Gems.Where(g => g.Rank <= maxRankForUpgrade - 1 && (g.Rank <= 48 || (g.SNO != 428355 && g.SNO != 405796 && g.SNO != 405797 && g.SNO != 405803))).ToList().Count
                    + gems.Gems.Where(g => g.Rank <= maxRankForUpgrade - 2 && (g.Rank <= 47 || (g.SNO != 428355 && g.SNO != 405796 && g.SNO != 405797 && g.SNO != 405803))).ToList().Count
                    + gems.Gems.Where(g => g.Rank <= maxRankForUpgrade - 3 && (g.Rank <= 46 || (g.SNO != 428355 && g.SNO != 405796 && g.SNO != 405797 && g.SNO != 405803))).ToList().Count
                    ;

                if (guaranteedUpgrades >= (canEmpower && (shouldEmpower || _level <= autoEmpowerMaxLevel) ? 4 : 3))
                {
                    Logger.Info("Setting GR level to " + _level);
                    break;
                }
            }
        }

        if (_level <= autoEmpowerMaxLevel)
            shouldEmpower = true;
    }

    if (_RiftType == RiftType.Greater && shouldEmpower && canEmpower)
    {
        Logger.Info("Opening Empowered Greater Rift (Cost={0})", empoweredCost);
        ZetaDia.Me.OpenRift(_level, true);
    }
    else
    {
        Logger.Info("Opening {0} Rift", _RiftType);
        ZetaDia.Me.OpenRift(_level);
    }                        

    if (_level == -1)
    {
        await Coroutine.Sleep(5000);
        if (IsRiftPortalOpen)
        {
            _prePortalWorldDynamicId = AdvDia.CurrentWorldDynamicId;
            State = States.EnteringRift;
        }
    }
    else
    {
        await Coroutine.Wait(30000, () => ZetaDia.CurrentRift.IsStarted && RiftData.RiftWorldIds.Contains(AdvDia.CurrentWorldId) && !ZetaDia.IsLoadingWorld);
        DisablePulse();
        State = States.EnteringGreaterRift;
    }
    return false;
}

And incase someone is using the other code change to cap Gem of Ease at level 25, you have it work with this as well by changing this part:
Code:
int guaranteedUpgrades = gems.Gems.Where(g => g.Rank <= maxRankForUpgrade && !g.MaxRank).ToList().Count
                    + gems.Gems.Where(g => g.Rank <= maxRankForUpgrade - 1 && (g.Rank <= 48 || (g.SNO != 428355 && g.SNO != 405796 && g.SNO != 405797 && g.SNO != 405803))).ToList().Count
                    + gems.Gems.Where(g => g.Rank <= maxRankForUpgrade - 2 && (g.Rank <= 47 || (g.SNO != 428355 && g.SNO != 405796 && g.SNO != 405797 && g.SNO != 405803))).ToList().Count
                    + gems.Gems.Where(g => g.Rank <= maxRankForUpgrade - 3 && (g.Rank <= 46 || (g.SNO != 428355 && g.SNO != 405796 && g.SNO != 405797 && g.SNO != 405803))).ToList().Count
                    ;

to
Code:
int guaranteedUpgrades = gems.Gems.Where(g => g.Rank <= maxRankForUpgrade && !g.MaxRank).ToList().Count
                    + gems.Gems.Where(g => g.Rank <= maxRankForUpgrade - 1 && (g.Rank <= 48 || (g.SNO != 428355 && g.SNO != 405796 && g.SNO != 405797 && g.SNO != 405803)) && (g.Rank <= 23 || g.SNO != 405783)).ToList().Count
                    + gems.Gems.Where(g => g.Rank <= maxRankForUpgrade - 2 && (g.Rank <= 47 || (g.SNO != 428355 && g.SNO != 405796 && g.SNO != 405797 && g.SNO != 405803)) && (g.Rank <= 22 || g.SNO != 405783)).ToList().Count
                    + gems.Gems.Where(g => g.Rank <= maxRankForUpgrade - 3 && (g.Rank <= 46 || (g.SNO != 428355 && g.SNO != 405796 && g.SNO != 405797 && g.SNO != 405803)) && (g.Rank <= 21 || g.SNO != 405783)).ToList().Count
                    ;
 
Whats the sense of this? If you can run high grifts in short times its totally wayne which lvl your gems have! You will run highest possible grift for max out your exp/hr mostly or not?
 
If you want to get a new char/spec, you could have up to 13 new gems to level up for caldesan's despair (and maybe more with upgrades), so it's just a faster way to get this done for people who need it. Obviously if you're at the point where you mostly want XP, you'd just keep a set level with best XP/hour ratios

For example, i'm running a max of GR76, but it's slow and only useful if gems are already 70+, while GR61 is near max speed and 3 times faster for low level gems.

And thanks xzjv for implementing it, I'll give it a try :)
 
Last edited:
Just one typo in the code, check should be >= otherwise it fails to downgrade rift level when there it only one low-level gem left

Code:
if (possibleUpgrades > upgradeAttempts)

Also the original code wasn't using correct empowering costs so it would totally skip on empowering with high max rift levels and "low" gold reserves. Here is my fixed UseGemAutoLevel part of the code (including the one above)

Code:
if (settings.UseGemAutoLevel && _RiftType == RiftType.Greater)
{
    int maxLevel = _level;
    int minLevel = Math.Min(maxLevel, Math.Max(13, maxLevel - settings.GemAutoLevelReductionLimit));

    var gems = PluginSettings.Current.Gems;
    if (gems.Gems.Count < 21)
    {
        Logger.Info("We're getting a new gem on that run, running it at minimum level (GR " + minLevel + ")!");
        _level = minLevel;
    }
    else
    {
        for (_level = minLevel; _level < maxLevel; _level++)
        {
            //Logger.Debug($"Starting Auto-Gem test for level: {_level}");        
            canEmpower = (RiftData.EmpoweredRiftCost.TryGetValue(_level, out empoweredCost) && ZetaDia.PlayerData.Coinage >= empoweredCost);
            var upgradeAttempts = (canEmpower && (shouldEmpower || _level <= settings.EmpoweredRiftLevelLimit) ? 4 : 3);
            var possibleUpgrades = gems.Gems.Sum(g => g.GetUpgrades(_level, upgradeAttempts));
            if (possibleUpgrades >= upgradeAttempts)
            {
                Logger.Info($"Setting GR level to {_level}, RequiredChance={PluginSettings.Current.GreaterRiftGemUpgradeChance} Upgrades={possibleUpgrades} / {upgradeAttempts}");
                break;
            }
        }
    }

    if (_level <= settings.EmpoweredRiftLevelLimit)
        shouldEmpower = true;
}
 
Edit: there is a bug somewhere, it's empowering rifts it shouldn't so keep that in mind if using this edit

While at it, I realized that there is a gap at 60% upgrade chance so a few rift levels could be gained there while getting near max gem levels. Also I think it should always check for 100% upgrade chance with first g.GetUpgrades() method, otherwise it will just keep bumping rift levels upgrading gems at 80% chance while doing the same rift progression, but much slower.

(And yeah I'll have to get off my ass and setup SVN to send updates there directly)

Added a new method to Settings\AdventurerGem.cs:
Code:
public int GetUpgradeChance(int griftLevel)
{
    return IsMaxRank ? 0 : CalculateUpgradeChance(griftLevel, Rank);
}

And the new "UseGemAutoLevel" part in RiftCoroutine.cs

Code:
if (settings.UseGemAutoLevel && _RiftType == RiftType.Greater)
{
    int maxLevel = _level;
    int minLevel = Math.Min(maxLevel, Math.Max(13, maxLevel - settings.GemAutoLevelReductionLimit));

    var gems = PluginSettings.Current.Gems;
    if (gems.Gems.Count < 21)
    {
        Logger.Info("We're getting a new gem on that run, running it at minimum level (GR " + minLevel + ")!");
        _level = minLevel;
    }
    else
    {
        for (_level = minLevel; _level < maxLevel; _level++)
        {
            //Logger.Debug($"Starting Auto-Gem test for level: {_level}");        
            canEmpower = (RiftData.EmpoweredRiftCost.TryGetValue(_level, out empoweredCost) && ZetaDia.PlayerData.Coinage >= empoweredCost);
            var upgradeAttempts = (canEmpower && (shouldEmpower || _level <= settings.EmpoweredRiftLevelLimit) ? 4 : 3);
            var possibleUpgrades = gems.Gems.Sum(g => g.GetUpgrades(_level, upgradeAttempts, 100));
            if (possibleUpgrades >= upgradeAttempts)
            {
                Logger.Info($"Setting GR level to {_level}, RequiredChance={PluginSettings.Current.GreaterRiftGemUpgradeChance} Upgrades={possibleUpgrades} / {upgradeAttempts}");
                break;
            }
        }

        // if upgrade chance at max level is 60%, check if we can still downgrade a few levels for the same upgrade chance
        if(_level == maxLevel && gems.Gems.Max(g => g.GetUpgradeChance(_level)) == 60) {
            Logger.Info("Update chance at max level is 60%, checking if we can take a few levels off still!");
            for(; _level > minLevel; _level--) {
                var couldEmpower = (RiftData.EmpoweredRiftCost.TryGetValue(_level - 1, out empoweredCost) && ZetaDia.PlayerData.Coinage >= empoweredCost);
                var upgradeAttempts = (couldEmpower && (shouldEmpower || _level - 1 <= settings.EmpoweredRiftLevelLimit) ? 4 : 3);
                var possibleUpgrades = gems.Gems.Sum(g => g.GetUpgrades(_level - 1, upgradeAttempts, 60));

                                
                if (possibleUpgrades < upgradeAttempts)
                    break;
                else
                    canEmpower = couldEmpower;
            }
        }
    }

    if (_level <= settings.EmpoweredRiftLevelLimit)
        shouldEmpower = true;
}
 
Last edited:
Back
Top