-
Member
I am sitting here experimenting a bit, and i found this, which are a bit old:
Originally Posted by
bastiflew
just a small piece of code for checking if a power is ready or is active :
Code:
public static bool IsPowerReady(this ActorCommonData acd, SnoPower power)
{
return acd.GetAttributeValue(AttributeId.PowerCooldown, (int) power) <= 0;
}
public static bool IsPowerActive(this ActorCommonData acd, SnoPower power)
{
for (var i = (int) AttributeId.BuffIconCount0; i <= (int) AttributeId.BuffIconCount31; i++)
{
var active = acd.GetAttributeValue((AttributeId) i, (int) power);
if (active > 0)
return true;
}
return false;
}
Usage :
Code:
var akaratActive = ActorCommonDataHelper.GetLocalAcd().IsPowerActive(SnoPower.X1_Crusader_AkaratsChampion);
here the list of powers :
[C#] public enum SnoPower { MistressOfPain_PainBolts_LR = 0x5A41D, - Pastebin.com
I more or less copy pasted it in to see how stuff worked out. But i have a problem.
I get errors that says SnoPower and ActorCommonData could not be found.
Is this because this was written using an older version of enigma? And how would one go about fixing it?
I would also appreciate if one of you knew where i could locate a example or two using this library. Traversing though this thread is a bit hard as most post are bugs or erros people have encounter, or outdated snippets.
Thanks in advantage.
Last edited by Quazaka; 11-24-2015 at 12:22 PM.
-
Active Member
This is still working. Here is alternate version of power active:
Code:
public bool IsPowerActive(SnoPower power)
{
if (m_PlayerAcd == null)
return false;
try
{
return GetBuff(power) != null;
}
catch (Exception)
{
}
return false;
}
private Buff GetBuff(SnoPower power)
{
try
{
return Engine.Current.BuffManager.x1C_Buffs.FirstOrDefault(x => x.x000_PowerSnoId == (int)power);
}
catch (Exception)
{
}
return null;
}
You have to place enum SnoPower (from pasebin) somewhere in your code. And do not forget to add:
Code:
using Enigma.D3;
using Enigma.D3.Memory;
using Enigma.D3.UI;
using Enigma.D3.Enums;
using Enigma.D3.Helpers;
as well as references to enigma dll's.
-
Member
Thanks for the quick reply.
I apologize for the seemly dumb questions.
But I get the following errors:
Code:
The type 'MemoryObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'Enigma.Memory, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Which i guess is because i am missing the DLL. Because trying to add Enigma.Memory in the Reference manager in VS i get and error that claims i can't add a module.
Where are this/these dll/'s to find?
-
Contributor
Originally Posted by
Quazaka
Thanks for the quick reply.
I apologize for the seemly dumb questions.
But I get the following errors:
Code:
The type 'MemoryObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'Enigma.Memory, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Which i guess is because i am missing the DLL. Because trying to add Enigma.Memory in the Reference manager in VS i get and error that claims i can't add a module.
Where are this/these dll/'s to find?
You can compile Enigma.Memory and copy the .DLL to the working directory and reference it. Enigma.Memory has all the implementations for the memory reading.
-
Active Member
Anyone knows how can I check whenever portal is an exit or an entrance to current location? Is there destination location or world id in portal actor or its ACD?
-
Legendary
Originally Posted by
CrEEzz
Anyone knows how can I check whenever portal is an exit or an entrance to current location? Is there destination location or world id in portal actor or its ACD?
Found some old information that perhaps can help. In ACD there is x214_Ptr_12Bytes_Portals which I think is a ResolvedPortalDestination, so at +8 there is LevelAreaSNO which should help you.
-
Post Thanks / Like - 1 Thanks
CrEEzz (1 members gave Thanks to enigma32 for this useful post)
-
Active Member
Thanks for hint, I let Ya know when I confirm that. Meanwhile I'm looking for animation sno ID/name. I suppose its somewhere under ACD.x210_Ptr_220Bytes_Animation. Did someont figured it out already?
-
Contributor
Originally Posted by
CrEEzz
Thanks for hint, I let Ya know when I confirm that. Meanwhile I'm looking for animation sno ID/name. I suppose its somewhere under ACD.x210_Ptr_220Bytes_Animation. Did someont figured it out already?
In ACD.x210_Ptr_220Bytes_Animation
Code:
public int _x000 { get { return Read<int>(0x000); } } // Flag or State? - 2 (Default)
public int AnimId { get { return Read<int>(0x004); } } // SNO Id
public int _x024 { get { return Read<int>(0x024); } } // Anim Type, e.g Dual, Single or 2 hander , = Anim Sno ID (7643 barbarian_male_DW_Whirlwind)
public int AnimSnoIdFollower { get { return Read<int>(0x0E0); } } // Follower anim SnoId
-
Post Thanks / Like - 1 Thanks
CrEEzz (1 members gave Thanks to Dolphe for this useful post)
-
Wow nice was looking for this as well some time ago
-
Active Member
There was minor patch deployed tonight, anyone can supply actual pointers :>
-
Will be at home in 3 hours. When I get something I will let you know
-
Engine.cs -> [C#] public class Engine : MemoryObject, IDisposable { private static class Addr - Pastebin.com
LevelArea Size -> public const int SizeOf = 0x00000918; //2.3.0.34606
PlayerDataManager Size -> public const int SizeOf = 0x000521F8; //2.3.0.34606
just tested a bit but should work
have fun
-
Post Thanks / Like - 1 Thanks
CrEEzz (1 members gave Thanks to R3peat for this useful post)
-
Member
If you have ILDasm error, You can modify csproj file for fixing new sdk version or you can replace method UnsafeRead by :
/// <summary>
/// Read a struct from a buffer at given offset.
/// </summary>
/// <remarks>No validation is made.</remarks>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe static T UnsafeRead(byte[] buffer, int offset)
{
fixed(byte* buff = &buffer[offset])
return (T)Marshal.PtrToStructure(new IntPtr(buff), typeof(T));
}
And remove all IL stuff ^^
-
Active Member
I got this weird problem with scenes. Occasionally I encounter this state when scenes in m_Engine.ObjectManager.x998_Scenes are not updated (no new scenes are visible in the list) when I explore a dungeon. I checked it by listing all scenes with non-negative scene.x000_Id every 300ms xD. Has anyone of encountered similar problem? Perhaps Scene size has changed, but then i would get only single scene in the list.
BTW. Here is my bot "promo" video xD Once again thanks to Enigma!
-
Post Thanks / Like - 1 Thanks
jacksafari (1 members gave Thanks to CrEEzz for this useful post)
-
Contributor
Never had any trouble with scenes. Did it work before the patch 1w ago? And btw x000_Id can occur multiple times (if its the same tileset), x004_internal is the unique Id (so if you add x000_ID to hashset or similar it will not "update" ).