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

How to code bot to cast Flesh Offerring

Hey there, this is my edited ExampleRoutine. I'm using flesh offering on raging spirits. I don't know if there is easier way to do it but this is how I did it and it works fine.

Code:
if (_summonRagingSpiritSlot != -1 && _summonRagingSpiritStopwatch.ElapsedMilliseconds > ExampleRoutineSettings.Instance.SummonRagingSpiritDelayMs)
                {
                    var skill = LokiPoe.InGameState.SkillBarPanel.Slot(_summonRagingSpiritSlot);
                    var max = skill.GetStat(StatType.NumberOfRagingSpiritsAllowed);

                    

                    if (skill.NumberDeployed > 5 )
                    {
                        var skulls = skill.DeployedObjects;
                        Monster anySkull = LokiPoe.ObjectManager.GetObjectById<Monster>(skulls.FirstOrDefault().Id);

                        var fleshSkill = LokiPoe.Me.GetSkillByName("Flesh Offering");

                        if (!anySkull.HasFleshOffering)
                        {
                            // flesh offering
                            // Check for a target near us.
                            var target = BestDeadTarget;
                            if (target != null)
                            {
                                Log.InfoFormat("[Logic] Using {0} on {1}.", fleshSkill.Name, target.Name);

                                var uaerr = LokiPoe.InGameState.SkillBarPanel.UseAt(fleshSkill.Slot, false, target.Position);

                                if (uaerr == LokiPoe.InGameState.UseError.None)
                                {
                                    await Coroutines.FinishCurrentAction(false);

                                    await Coroutine.Sleep(Utility.LatencySafeValue(100));

                                    return true;
                                }

                                Log.ErrorFormat("[Logic] UseAt returned {0} for {1}.", uaerr, skill.Name);
                            }
                        }

                    }
 
Back
Top