Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.92 KB | None | 0 0
  1.         public override async Task<bool> ExecuteRotation(ExGatherTag tag)
  2.         {
  3.             if (!tag.Node.IsUnspoiled())
  4.             {
  5.                 if (!(GatheringManager.SwingsRemaining > 4 && Core.Player.CurrentGP >= 250 && level >= 77)) return true;
  6.                 await tag.Cast(Ability.PickClean);
  7.                 await Wait();
  8.                 await IncreaseChance(tag);
  9.  
  10.                 return true;
  11.             }
  12.  
  13.             double YieldsLeft()
  14.             {
  15.                 return Math.Min(GatheringManager.SwingsRemaining, Math.Max(0, (Core.Player.CurrentGP + GatheringManager.SwingsRemaining * 6) / 100d));
  16.             }
  17.  
  18.             var bountifulYield = tag.GatherItem.Level <= 70 ? 3 : 2;
  19.  
  20.             int pickCleanYield;
  21.             if (tag.GatherItem.Level <= 50) pickCleanYield = 3;
  22.             else pickCleanYield = tag.GatherItem.Level <= 70 ? 2 : 1;
  23.  
  24.             await IncreaseChance(tag);
  25.             await Wait();
  26.  
  27.             if (Core.Player.CurrentGP >= 250 && level >= 77)
  28.             {
  29.                 var yieldCalc = Math.Max(0, (Core.Player.CurrentGP + (GatheringManager.MaxSwings - 1) * 6) / 100d);
  30.                 var adjustedGp = yieldCalc - Math.Floor(yieldCalc);
  31.                 var pickCleanBonus = adjustedGp >= 0.50 && adjustedGp < 1 ? 1 : 0;
  32.  
  33.                 if (pickCleanYield * GatheringManager.MaxSwings > bountifulYield * (3 - pickCleanBonus))
  34.                 {
  35.                     await Wait();
  36.                     await tag.Cast(Ability.PickClean);
  37.                 }
  38.             }
  39.  
  40.             double uncappedYields = Math.Floor((Core.Player.CurrentGP + (GatheringManager.MaxSwings - 1) * 6) / 100d);
  41.  
  42.             if (Core.Player.CurrentGP >= 500 && level >= 40)
  43.             {
  44.                 if ((GatheringManager.MaxSwings * 2) + (uncappedYields - 5) >= bountifulYield * Math.Floor(YieldsLeft()))
  45.                 {
  46.                     await Wait();
  47.                     await tag.Cast(Ability.IncreaseGatherYield2);
  48.                 }
  49.             }
  50.  
  51.             bool usedVigorForce = false;
  52.  
  53.             while (tag.Node.CanGather && GatheringManager.SwingsRemaining > tag.SwingsRemaining && Behaviors.ShouldContinue)
  54.             {
  55.                 await Wait();
  56.  
  57.                 if (!usedVigorForce && GatheringManager.GatheringCombo == 4 && GatheringManager.SwingsRemaining > 0 && ((tag.GatherItem.HqChance > 0 && tag.GatherItem.HqChance < 100) || tag.GatherItem.Chance < 100))
  58.                 {
  59.                     await tag.Cast(Ability.IncreaseGatherChanceQuality100);
  60.                     usedVigorForce = true;
  61.                 }
  62.  
  63.                 if (Core.Player.CurrentGP >= 100 && level >= 68 && (tag.GatherItem.HqChance == 100 || GatheringManager.SwingsRemaining <= YieldsLeft()) && !Core.Player.HasAura(1286))
  64.                 {
  65.                     await tag.Cast(Ability.IncreaseGatherYieldOnce2);
  66.                     await Coroutine.Wait(2000, () => Core.Player.HasAura(1286));
  67.                 }
  68.  
  69.                 double counsels = Math.Floor(YieldsLeft() + 0.1);
  70.  
  71.                 if (Core.Player.CurrentGP >= 10 && level >= 67 && tag.GatherItem.HqChance > 0 && tag.GatherItem.HqChance < 100 && YieldsLeft() >= counsels && !Core.Player.HasAura(1262))
  72.                 {
  73.                     await tag.Cast(Ability.IncreaseGatherQualityRandomOnce);
  74.                     await Coroutine.Wait(2000, () => Core.Player.HasAura(1262));
  75.                 }
  76.  
  77.                 if (!await tag.ResolveGatherItem()) return false;
  78.                
  79.                 var swingsRemaining = GatheringManager.SwingsRemaining - 1;
  80.  
  81.                 if (!tag.GatherItem.TryGatherItem()) return false;
  82.                
  83.                 var ticks = 0;
  84.                 while (swingsRemaining != GatheringManager.SwingsRemaining && ticks++ < 50 && Behaviors.ShouldContinue)
  85.                 {
  86.                     await Coroutine.Yield();
  87.                 }
  88.             }
  89.  
  90.             return true;
  91.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement