Originally Posted by
GameHelper
This is already in ExileAPI, what are you talking about?
do you mean it? there is only a blank:
ExileApi/DeployedObject.cs at master . Queuete/ExileApi . GitHub
i will share now:
Code:
using ExileCore.PoEMemory.MemoryObjects;
using ExileCore.Shared.Cache;
using GameOffsets;
using System.Linq;
namespace ExileCore.PoEMemory.Components {
public class DeployedObject :RemoteMemoryObject {
private Entity _entity;
public DeployedObjectType TypeId => cache_do.Value.TypeId;
public ushort SkillId => cache_do.Value.SkillId; // Look up in ActorComponent.ActorSkills
public ushort InstanceId => cache_do.Value.InstanceId; // Look up in EntityList
public ushort Padding => cache_do.Value.Padding;
private readonly FrameCache<DeployedObjectOffsets> cache_do;
public DeployedObjectOffsets deploy_data => cache_do.Value;
public Entity Entity => _entity ?? (_entity = TheGame.IngameState.Data.EntityList.Entities.FirstOrDefault(e=>e.Id == InstanceId));
public ActorSkill Skill => TheGame.IngameState.Data.LocalPlayer?.GetComp<Actor>()?.ActorSkills?.Find(x => x.Id == SkillId);
public DeployedObject() {
cache_do = new FrameCache<DeployedObjectOffsets>(() => M.Read<DeployedObjectOffsets>(Address));
}
}
using System.Runtime.InteropServices;
namespace GameOffsets
{
[StructLayout(LayoutKind.Explicit, Pack = 1)]
public struct DeployedObjectOffsets {
[FieldOffset(0x0)] public DeployedObjectType TypeId;//4 for totems, 22 for golems
[FieldOffset(0x2)] public ushort SkillId;// Look up in ActorComponent.ActorSkills
[FieldOffset(0x4)] public ushort InstanceId;// Look up in EntityList
[FieldOffset(0x6)] public ushort Padding;//Always 0
}
public enum DeployedObjectType : ushort {
Spectre = 0,
Totem = 4,
Trap,
Zombie,
Skeleton,
Mine = 10,
Skitterbots = 14, // Share same id as mirrors/clones
Clone = 14,
AnimatedGuardian = 16,
AnimatedWeapon = 17,
RagingSpirit = 18,
Golem = 22,
AgonyCrawler = 36,
HolyRelic = 38,
AbsolutionSentinel = 47,
Reaper = 48
}
}