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

Animated Guardian API

Pachi

Member
Joined
May 31, 2011
Messages
117
Reaction score
9
is there API implemented for animated Guardian so I can pull the HP? I want to be able to disconnect on a certain percentage.
 
Last edited:
(Monster)animatedguardianObj).HealthPercent

will that work?
 
I got it.

Code:
     var Animated_Guardian = LokiPoe.ObjectManager.GetObjectByName<Monster>("Animated Guardian");
          var AGPercent = Animated_Guardian.HealthPercent;
            var AGThreshold = 60;
                if (AGPercent <= AGThreshold)
                {
                    Log.Warn($"[Chicken] Now chickening because our Animated Guardian ({AGPercent}%) is below threshold ({AGThreshold}%)");
                    Logout();
                    return;
                }
 
There should be another way to do this, but I'll have to test it and paste you a snippet this weekend. Basically though, you should be able to get your Animate Guardian skill, and check it's or your character's DeployedObjects, which does basically the same thing in the end.
 
Code:
            var Animated_GuardianSkill = LokiPoe.InGameState.SkillBarHud.Skills.FirstOrDefault(s => s.Name == "Animate Guardian");
            if (Animated_GuardianSkill != null)
            {
                var AGObj = Animated_GuardianSkill.DeployedObjects.FirstOrDefault() as Monster;
                if (AGObj != null)
                {
                var AGPercent = AGObj.HealthPercent;
                var AGThreshold = 70;
                    if (AGPercent <= AGThreshold)
                    {
                        Log.Warn($"[Chicken] Now chickening because our Animated Guardian ({AGPercent}%) is below threshold ({AGThreshold}%)");
                        Logout();
                        return;
                    }
                }
            }

so I ended up doing it this way, not sure if there's a better way but this is the way I figure it out
 
Back
Top