Issue resolved in below post
Issue resolved in below post
Last edited by WiNiFiX; 11-29-2016 at 02:44 AM.
PHP Code:
using System;
using SlimDX;
#pragma warning disable 649
#pragma warning disable 169
namespace VanillaMagic
{
public static class Camera
{
internal static IntPtr BaseAddress
{
get
{
var ptr = WoW.hook.Memory.Read<IntPtr>(Offsets.Camera.CameraPtr, true);
return WoW.hook.Memory.Read<IntPtr>(ptr + Offsets.Camera.CameraPtrOffset);
}
}
private static Offsets.CGCamera cam => WoW.hook.Memory.Read<Offsets.CGCamera>(BaseAddress);
public static float X => cam.Position.X;
public static float Y => cam.Position.Y;
public static float Z => cam.Position.Z;
public static float FOV => cam.FieldOfView;
public static float NearClip => cam.NearClip;
public static float FarClip => cam.FarClip;
public static float Aspect => cam.Aspect;
private static Matrix Matrix
{
get
{
var bCamera = WoW.hook.Memory.ReadBytes(BaseAddress + Offsets.Camera.CameraMatrix, 36);
var m = new Matrix();
m[0, 0] = BitConverter.ToSingle(bCamera, 0);
m[0, 1] = BitConverter.ToSingle(bCamera, 4);
m[0, 2] = BitConverter.ToSingle(bCamera, 8);
m[1, 0] = BitConverter.ToSingle(bCamera, 12);
m[1, 1] = BitConverter.ToSingle(bCamera, 16);
m[1, 2] = BitConverter.ToSingle(bCamera, 20);
m[2, 0] = BitConverter.ToSingle(bCamera, 24);
m[2, 1] = BitConverter.ToSingle(bCamera, 28);
m[2, 2] = BitConverter.ToSingle(bCamera, 32);
return m;
}
}
public static Vector2 WorldToScreen(float x, float y, float z)
{
var Projection = Matrix.PerspectiveFovRH(FOV * 0.5f, Aspect, NearClip, FarClip);
var eye = new Vector3(X, Y, Z);
var lookAt = new Vector3(X + Matrix[0, 0], Y + Matrix[0, 1], Z + Matrix[0, 2]);
var up = new Vector3(0f, 0f, 1f);
var View = Matrix.LookAtRH(eye, lookAt, up);
var World = Matrix.Identity;
var WorldPosition = new Vector3(x, y, z);
var ScreenPosition = Vector3.Project(WorldPosition, 0f, 0f, WindowHelper.WindowWidth, WindowHelper.WindowHeight, NearClip, FarClip, World*View*Projection);
return new Vector2(ScreenPosition.X, ScreenPosition.Y-20f);
}
}
}
Last edited by WiNiFiX; 12-02-2016 at 07:13 AM.
Hey does anyone have offset for Target Combo Points for Rogues in 1.12.1?
Edited: You can get a look at the lua function GetComboPoints() at 0x0051A190:So, it seems that you have just to check your char to be rogue or druid, the PLAYER__FIELD_COMBO_TARGET descriptor to be equal to CGGameUI::m_lockedTarget and then - just read the second byte of the decriptor PLAYER_FIELD_BYTES (Or, if you find it complicate - call the freaking function directly or use luagettext).Code:signed int __thiscall Script_GetComboPoints(void *this) { void *v1; // edi __int64 v2; // rax _Player *v3; // eax _Player *v4; // esi char v5; // al ObjectFields *v6; // ecx __int64 v7; // rdi int v8; // ebx uint64 v9; // rax unsigned int v10; // eax unsigned int v11; // ecx PlayerFields *v12; // edx ObjectFields *v13; // eax __int64 v14; // rdi int v15; // ebx uint64 v16; // rax unsigned __int8 v17; // al void *v19; // [esp+18h] [ebp-4h] v1 = this; v19 = this; v2 = ClntObjMgrGetActivePlayer(); v3 = ClntObjMgrObjectPtr(TYPEMASK_PLAYER, "..\\Object/ObjectClient/Player_C.h", v2, 0x90); v4 = v3; if ( !v3 ) { goto LABEL_15; } v5 = v3->unitBase.UnitData->UNIT_FIELD_CLASS; if ( v5 != CLASS_ROGUE && v5 != CLASS_DRUID ) { goto LABEL_15; } v6 = v4->unitBase.objectBase.objectFields; LODWORD(v7) = v6->OBJECT_FIELD_GUID; v8 = HIDWORD(v6->OBJECT_FIELD_GUID); v9 = ClntObjMgrGetActivePlayer(); if ( v7 == v9 && v8 == HIDWORD(v9) ) { v12 = v4->PlayerData; v10 = v12->PLAYER__FIELD_COMBO_TARGET; v11 = HIDWORD(v12->PLAYER__FIELD_COMBO_TARGET); } else { v10 = 0; v11 = 0; } if ( __PAIR__(v11, v10) != CGGameUI::m_lockedTarget ) { v1 = v19; LABEL_15: FrameScript::PushNumber(v1, 0.0); return 1; } v13 = v4->unitBase.objectBase.objectFields; LODWORD(v14) = v13->OBJECT_FIELD_GUID; v15 = HIDWORD(v13->OBJECT_FIELD_GUID); v16 = ClntObjMgrGetActivePlayer(); if ( v14 == v16 && v15 == HIDWORD(v16) ) { v17 = v4->PlayerData->PLAYER_FIELD_BYTES_COMBO_POINTS; } else { v17 = 0; } FrameScript::PushNumber(v19, v17); return 1; }
Last edited by tutrakan; 01-08-2018 at 01:07 PM.
Please show me where I asked for an offset in this thread before the post about combo-points, I asked for assistance with CTM (no offsets) and for WorldToScreen (no offsets).
Both valid queries as there was no information in this thread about either query. and I provided corrections to old users incorrect WorldToScreen functions - the last time i checked that was helping the community.
Last edited by WiNiFiX; 11-19-2016 at 03:16 AM.
movementStruct = player + 0x9A8
PlayerJump = 0x007C6230
Code:__asm {mov ecx, movementStruct; push 1; call PlayerJump;};
I'm not sure why a second example is necessary. And my message was not directed solely at you. If you read through this thread, the vast majority of posts do not add any useful information. I just think this thread would be much cleaner and on-topic if people would ask their questions somewhere else.
Has anyone had any luck registering console commands in this build?
I can't for the love of God get it working for me. SStrHashHT fails because data being passed to ConsoleCommandRegister is all shit.
Edit: It works fine on build 12340.
This probably means you're calling ConsoleCommandRegister with the wrong prototype. Here is what I have for it's prototype in 1.12.1:
The function is located at 0x63F9E0.Code:int __fastcall ConsoleCommandRegister(char *Str2, int a2, int a3, int a4)
If you think you have the correct prototype, you should verify that ecx is set properly by putting a breakpoint on ConsoleCommandRegister with a debugger of your choice, making your call to it, and examining the value manually.
Edit: Additionally, this function is not __fastcall in 3.3.5a (build 12340).
Last edited by namreeb; 11-21-2016 at 04:13 PM.
I managed to pass the data properly now, but now there's an exception elsewhere in the code...
Here's what it looks like in the IDA Debugger:
Not every variable/function in that code is named unfortunately, but v8 (on the purple line) might not get the right value. Any idea what that would be?
I feel like there's something I need to set prior to registering my command that I'm not doing properly.
Yeah, I figured about 0064A6F0 by glancing at its body, but I don't get why SStrChr fails after calling __strnicmp. All the data I pass to ConsoleCommandRegister seems OK from what I could tell. Is there anything I need to do before registering my own command?
I call this, if it's of any help.
Code:void FixInvalidPtrCheck() { *((int*)0x884800) = 0x1; *((int*)0x884C00) = 0x7FFFFFFF; }
I finally figured it out!
Thanks a lot for your help, nambreeb.
Complimentary screen shot: