
Contributor
[WoW] 8.2.0.30918
All unit's offsets shifted by 8 bytes
Code:
NpcFlags = 0x14CC,
Charm = 0x14D8,
Summon = 0x14E8,
Critter = 0x14F8,
SummonedBy = 0x1518,
CharmedBy = 0x1520,
CreatedBy = 0x1528,
DemonCreator = 0x1538,
Target = 0x1558,
Race = 0x158C,
ClassId = 0x158D,
Sex = 0x158F,
DisplayPower = 0x1590,
OverrideDisplayPowerID = 0x1594,
Health = 0x1598,
MaxHealth = 0x15A0,
Power = 0x1390,
MaxPower = 0x17A0,
Level = 0x15A8,
FactionTemplate = 0x15CC,
Flags = 0x15D0,
Flags2 = Flags + 4,
FlagsByte = Flags2 + 2,
Flags3 = Flags + 8,
BoundingRadius = 0x15E4,
CombatReach = 0x15E8,
DisplayID = 0x15F0,
MountDisplayID = 0x15F8,
VisFlags = 0x1610,
AnimFlags = 0x1612,
PetNumber = 0x1614,
PvpFlags = 0x164D,
ShapeshiftForm = 0x164F,
These ads disappear when you log in.

Post Thanks / Like  3 Thanks

Active Player Fields Shifted as well
Code:
internal class ActivePlayerFields
{
public static UInt32 Coinage = 0x3540 + ( 0x1 * 0x10 );
public static UInt32 XP = 0x3548 + ( 0x1 * 0x10 );
public static UInt32 NextXp = 0x354c + ( 0x1 * 0x10 );
public static UInt32 SkillId = 0x3554 + ( 0x1 * 0x10 );
public static UInt32 SkillLine = 0x3954 + ( 0x1 * 0x10 );
public static UInt32 SkillMax = 0x3d54 + ( 0x1 * 0x10);
public static UInt32 SkillBonus = 0x3f54 + ( 0x1 * 0x10 );
public static UInt32 SkillRacial = 0x4154 + ( 0x1 * 0x10 );
public static UInt32 InvSlots = 0x4748 + ( 0x4 * 0x10 + 0x8);
}

Post Thanks / Like  1 Thanks
gdfsxwy (1 members gave Thanks to counted for this useful post)

Player Fields Shifted as well
Code:
internal class PlayerFields
{
public static uint Flags = 0x1aa8 + 0x10;
public static uint QuestBase = 0x1b34 + 0x10;
public static uint QuestMax = 0x3434 + 0x10;
}

Contributor
WorldFrame_Intersect have changed, now called with 2 additional arguments.
Code:
constexpr uintptr_t WorldFrame_GetCurrent = 0x180430;
constexpr uintptr_t WorldFrame_Intersect = 0x14CE0F0;
typedef bool(__fastcall* WorldFrame_Intersect)(uintptr_t worldFrame, vector3* from, vector3* to, vector3* result, float* distance, uint32_t flags, int32_t unk_1);
typedef uintptr_t(__fastcall* WorldFrame_GetCurrent)();
WorldFrame_Intersect(WorldFrame_GetCurrent(), &from, &to, &result, &distance, flags, 0);
Last edited by ejt; 06272019 at 06:19 AM.

Post Thanks / Like  5 Thanks

Member
TraceLine Shifted as well. Ask for help

Member
TraceLine is same as Intersect.I think they have same parameters.

Post Thanks / Like  1 Thanks
gdfsxwy (1 members gave Thanks to ynyzyfy for this useful post)

Contributor
Originally Posted by
ynyzyfy
TraceLine is same as Intersect.I think they have same parameters.
This is correct, TraceLine and WorldFrame_Intersect is the same function some just call them different names.

Post Thanks / Like  1 Thanks
gdfsxwy (1 members gave Thanks to ejt for this useful post)

Member
Ask for help
Code:
typedef struct vector3 {
float x = 0;
float y = 0;
float z = 0;
};
typedef bool(__fastcall * _WorldFrame_Intersect)(uintptr_t worldFrame, vector3 * from, vector3 * to, vector3 * result, uint32_t flags, int32_t unk_1);
typedef uintptr_t(__fastcall * _WorldFrame_GetCurrent)();
static uintptr_t WorldFrame_GetCurrent = 0x180430;
static uintptr_t WorldFrame_Intersect = 0x14CE0F0;
int TraceLine(lua_State *L)
{
float x1 = xlua_tonumber(L, 1);
float y1 = xlua_tonumber(L, 2);
float z1 = xlua_tonumber(L, 3);
float x2 = xlua_tonumber(L, 4);
float y2 = xlua_tonumber(L, 5);
float z2 = xlua_tonumber(L, 6);
uint32_t Flag = xlua_tonumber(L, 7);
vector3 from;
vector3 to;
vector3 result;
from.x = x1;
from.y = y1;
from.z = z1;
to.x = x2;
to.y = y2;
to.z = z2;
_WorldFrame_GetCurrent GetCurrent = (_WorldFrame_GetCurrent)(WorldFrame_GetCurrent + _BaseAddress);
_WorldFrame_Intersect Intersect = (_WorldFrame_Intersect)(WorldFrame_Intersect + _BaseAddress);
bool n = Intersect(GetCurrent(), &from, &to, &result, Flag, 0);
xlua_pushboolean(L, n);
return 1;
}
Error picture:
1.jpg
2.jpg
Last edited by gdfsxwy; 06272019 at 06:12 AM.

Contributor
Originally Posted by
gdfsxwy
Ask for help
Code:
typedef struct vector3 {
float x = 0;
float y = 0;
float z = 0;
};
typedef bool(__fastcall * _WorldFrame_Intersect)(uintptr_t worldFrame, vector3 * from, vector3 * to, vector3 * result, uint32_t flags, int32_t unk_1);
typedef uintptr_t(__fastcall * _WorldFrame_GetCurrent)();
static uintptr_t WorldFrame_GetCurrent = 0x180430;
static uintptr_t WorldFrame_Intersect = 0x14CE0F0;
int TraceLine(lua_State *L)
{
float x1 = xlua_tonumber(L, 1);
float y1 = xlua_tonumber(L, 2);
float z1 = xlua_tonumber(L, 3);
float x2 = xlua_tonumber(L, 4);
float y2 = xlua_tonumber(L, 5);
float z2 = xlua_tonumber(L, 6);
uint32_t Flag = xlua_tonumber(L, 7);
vector3 from;
vector3 to;
vector3 result;
from.x = x1;
from.y = y1;
from.z = z1;
to.x = x2;
to.y = y2;
to.z = z2;
_WorldFrame_GetCurrent GetCurrent = (_WorldFrame_GetCurrent)(WorldFrame_GetCurrent + _BaseAddress);
_WorldFrame_Intersect Intersect = (_WorldFrame_Intersect)(WorldFrame_Intersect + _BaseAddress);
bool n = Intersect(GetCurrent(), &from, &to, &result, Flag, 0);
xlua_pushboolean(L, n);
return 1;
}
Error picture:
1.jpg
2.jpg
mb, the definition of function is:
Code:
typedef bool(__fastcall* WorldFrame_Intersect)(uintptr_t worldFrame, vector3* from, vector3* to, vector3* result, float* distance, uint32_t flags, int32_t unk_1);
Edit: Just note that distance should be set to 1.
Code:
bool WorldObject::IsWithinLoS(std::shared_ptr<WorldObject> target)
{
Vec3 p1 = GetPosition();
Vec3 p2 = target>GetPosition();
Vec3 ipt;
float dist = 1;
p1.z += GetDisplayHeight();
p2.z += target>GetDisplayHeight();
bool trace = WorldFrame_Intersect(WorldFrame_GetCurrent(), &p1, &p2, &ipt, &dist, 0x100010, 0);
return !trace;
}
Last edited by ejt; 06272019 at 06:21 AM.

Member

Active Member
Originally Posted by
ejt
mb, the definition of function is:
Code:
typedef bool(__fastcall* WorldFrame_Intersect)(uintptr_t worldFrame, vector3* from, vector3* to, vector3* result, float* distance, uint32_t flags, int32_t unk_1);
Edit: Just note that distance should be set to 1.
Code:
bool WorldObject::IsWithinLoS(std::shared_ptr<WorldObject> target)
{
Vec3 p1 = GetPosition();
Vec3 p2 = target>GetPosition();
Vec3 ipt;
float dist = 1;
p1.z += GetDisplayHeight();
p2.z += target>GetDisplayHeight();
bool trace = WorldFrame_Intersect(WorldFrame_GetCurrent(), &p1, &p2, &ipt, &dist, 0x100010, 0);
return !trace;
}
It is very kind to share the code, in which I have discovered a very interesting point: GetDisplayHeight()
Would you mind sharing how you implemented this? Is it a virtual function or sth else? Any code snippet would be best! Thanks in advance.

Contributor
Originally Posted by
zys924
It is very kind to share the code, in which I have discovered a very interesting point: GetDisplayHeight()
Would you mind sharing how you implemented this? Is it a virtual function or sth else? Any code snippet would be best! Thanks in advance.
float = [[Object + 0x120] + 0x110]
have not confirmed 100% its working but my los function seems to do its thing so guess it still does.