-
Active Member
I did a full solution rebuild of x64 configuration (just in case) and then tried running map hack again and it still doesn't "connect" to D3. MemoryContext is successfully created but contains some invalid data. The same exception "Exception thrown: 'System.ComponentModel.Win32Exception' in Enigma.Memory.dll" is appearing in log. I doubt that it matters but I'm running Windows 10 and starter edition of Diablo (latest patch).
Here are some members values inside MemoryContext
2018-07-15 18_20_35-NavMeshViewer (Debugging) - Microsoft Visual Studio.png
2018-07-15 18_21_05-NavMeshViewer (Debugging) - Microsof.png
Last edited by CrEEzz; 07-16-2018 at 10:06 AM.
-
Legendary
When you have the MemoryContext, you need to call SymbolPatcher
Code:
SymbolPatcher64.UpdateSymbolTable(ctx);
Blizzard encrypts a bunch of pointers and IDs now, so it's either finding and porting the decrypt method (each pointer type has its own method), or cheat and just scan for the object (works fine if it's not being reallocated).
There are some properties in MemoryContext which will still give exceptions as I haven't bothered fixing all of them.
-
Active Member
Nvm, I was using trunk instead of the post-obfuscation branch :facepalm: Thanks for all your hints. And thanks to @deeplearning for sharing his updates to my nav lib Look like the game is on :
NavD3.jpg
I have also migrated the library to github GitHub - Cr33zz/Nav.D3 I've just submitted updated version working with the latest patch.
Last edited by CrEEzz; 07-17-2018 at 05:40 PM.
-
Active Member
I'm slowly converting my old bot to new Enigma lib so I can write a Diablo 3 botting series on my blog I have 2 questions so far:
1) How can I access actor direction from ACD. I used to do it like this
Code:
Quat q = new Quat(acd.x0C0_Direction, acd.x0C4_Direction, acd.x0C8_Direction, acd.x0CC_Direction);
Vec3 dir = q * new Vec3(1, 0, 0);
2) I used to be able to get buff (by its power sno id) via
Code:
BuffManager.x1C_Buffs.FirstOrDefault(x => x.x000_PowerSnoId == (int)power);
Are those now simply passive skills in Player?
-
Member
Dose this project now support 32bit Diablo3?
-
Active Member
I've wrote a post on my blog containing (hopefully) correct and helpful introduction to Enimga.D3 and D3 structures. Feel free to correct me so we can make life easier for those trying to write their own bots/helpers/etc. Diablo 3 botting series: Prerequisite knowledge | Botters gonna bot
-
Post Thanks / Like - 1 Thanks
Skeetss (1 members gave Thanks to CrEEzz for this useful post)
-
Legendary
Originally Posted by
CrEEzz
I'm slowly converting my old bot to new Enigma lib
so I can write a Diablo 3 botting series on my blog
I have 2 questions so far:
1) How can I access actor direction from ACD. I used to do it like this
Code:
Quat q = new Quat(acd.x0C0_Direction, acd.x0C4_Direction, acd.x0C8_Direction, acd.x0CC_Direction);
Vec3 dir = q * new Vec3(1, 0, 0);
2) I used to be able to get buff (by its power sno id) via
Code:
BuffManager.x1C_Buffs.FirstOrDefault(x => x.x000_PowerSnoId == (int)power);
Are those now simply passive skills in Player?
Direction don't know, but will figure it out.
For buffs, this should be a good start (with ApplicationModel)
Code:
var attributes = Snapshot.Game.Player.GetAttributes();
var buffs = attributes.Where(x => AttributeId.BuffIconCount0 <= x.Key.Id && x.Key.Id <= AttributeId.BuffIconCount31).Where(x => x.Value > 0).Select(x => x.Key.Modifier).ToList();
I don't know the significance of 0..31, e.g. Call of the Ancients gives me Count4 = 1 and Count6 = 1. Have not checked if repeatable.
Originally Posted by
destiny_03
Dose this project now support 32bit Diablo3?
It used to, but I've stopped updating 32-bit offsets after 2.6.1.48432 (when obfuscation patch hit). I have no intention to support 32-bit.
Originally Posted by
CrEEzz
Cool
It mentions that SNO ID starts at 10th byte, but that's the hex 0x10th byte So.. 16th
-
Post Thanks / Like - 1 Thanks
Skeetss (1 members gave Thanks to enigma32 for this useful post)
-
Member
I'm trying to find out whether or not an ability has a cooldown and if so how long it is. I know how to find if a skill is on cooldown and how long until it is off cooldown (CurrentTick - PowerCooldown) but I can't seem to find out how long the skill's base cooldown actually is (for example Companion has a base CD of 30s).
Where do I find that number?
-
Member
Originally Posted by
raler
Sure! This is the code that I currently use. However, I've only been able to get it to work in WindowedFullscreen mode. It works perfectly for 1920x1080 resolution! I'm not sure about others, but I don't see why it wouldn't work for any resolution.
Code:
public static Point FromD3toScreenCoords(Vector3 objectGameLocation)
{
Vector3 currentCharGameLoc = Game.Me.Location;
double xd = objectGameLocation.X - currentCharGameLoc.X;
double yd = objectGameLocation.Y - currentCharGameLoc.Y;
double zd = objectGameLocation.Z - currentCharGameLoc.Z;
double w = -0.515 * xd + -0.514 * yd + -0.686 * zd + 97.985;
double X = (-1.682 * xd + 1.683 * yd + 0 * zd + 7.045e-3) / w;
double Y = (-1.54 * xd + -1.539 * yd + 2.307 * zd + 6.161) / w;
double width = Engine.Current.VideoPreferences.x0C_DisplayMode.x20_Width;
double height = Engine.Current.VideoPreferences.x0C_DisplayMode.x24_Height;
double aspectChange = (double)((double)width / (double)height) / (double)(4.0f / 3.0f); // 4:3 = default aspect ratio
X /= aspectChange;
float rX = (float)((X + 1) / 2 * width);
float rY = (float)((1 - Y) / 2 * height);
return new Point((int)rX, (int)rY);
}
I apologize if everyone already knows this, but there is a simple transform that Diablo uses that we can apply without all the fancy math. You still have to take into account the window left/top if you're in windowed mode, but in full screen and windowed it works well. I've found it much easier to work fully in D3 coordinates with things like hazard avoidance, path-finding, proximity, etc. I believe I owe credit to the person who came up with D3 Nav for the idea of a transform (and what it might be). In English, the X axis is reversed and the whole map is rotated at -45 degrees. So to get back from world coordinates to screen coordinates you Invert the ScaleX and Angle that D3 uses for its coordinate system:
public static ScaleTransform scaleTransform = new ScaleTransform() { ScaleX = -1 };
public static RotateTransform rotateTransform = new RotateTransform() { Angle = -45 };
public static TransformGroup transform;
public static Matrix TransformMatrix;
public static Matrix ReverseTransformMatrix;
transform = new TransformGroup();
transform.Children = new TransformCollection(new List<Transform>() { scaleTransform, rotateTransform });
TransformMatrix = transform.Value;
ReverseTransformMatrix = new Matrix();
ReverseTransformMatrix.Append(transformMatrix);
ReverseTransformMatrix.Invert();
Once you've set up the transform, to figure out how to get from World point A to World point B (but where you need to click on the screen), you can do this:
var diffX = targetWorldPosition.X - myPosition.X;
var diffY = targetWorldPosition.Y - myPosition.Y;
var pt = TransformMatrix.Transform(new System.Windows.Point(diffX, diffY));
PS: the 16 and multiplication may have something to do with my aspect ratio.
SourceCenterX/Y is my current screen location (which is pretty much the middle of the screen)…
int xMoveToScreenLoc = SourceCenterX + (int)(pt.X * 16d) + 8;
int yMoveToScreenLoc = SourceCenterY + (int)(pt.Y * BasicSettings.ScreenHeight / 100d) + 16;
Last edited by owen654321; 08-09-2018 at 09:21 AM.
-
Legendary
Originally Posted by
owen654321
I apologize if everyone already knows this, but there is a simple transform that Diablo uses that we can apply without all the fancy math.
That matrix is for a top-down view (minimap). If wanting to know where exactly a coordinate is on screen, in the 3D-world, then you need all that fancy math (or figure out what transform matrix converts into the same). I'm sure your algorithm is good enough for navigation, when you just need a general direction to move in.
-
Post Thanks / Like - 1 Thanks
ZenDraL (1 members gave Thanks to enigma32 for this useful post)