[Classic] 1.13.2.32089
Is there a flag to know a unit has been attack?
sorry, my english is poor
[Classic] 1.13.2.32089
Is there a flag to know a unit has been attack?
sorry, my english is poor
Check out Script_UnitIsTapDenied
It takes a unit token and returns a lua boolean.
"Threads should always commit suicide - they should never be murdered" - DirectX SDK
i dont think taped is correct. dont know exactly for memory, but simple lua it is affectingCombat = UnitAffectingCombat("target"); so i think you have to look for this flag
signed __int64 __fastcall Script_UnitAffectingCombat(__int64 a1)
{
__int64 v1; // rbx
signed __int64 result; // rax
__int64 v3; // rax
__int64 v4; // rax
v1 = a1;
if ( lua_isstring(a1, 1i64) )
{
v3 = lua_tolstring(v1, 1i64);
v4 = Script_GetGUIDFromToken_0(v3, 0i64);
if ( v4 && (*(*(v4 + 0x18 + 0x158i64) >> 0x13) & 1 )
{
lua_pushboolean(v1, 1i64);
result = 1i64;
}
else
{
lua_pushboolean(v1, 0i64);
result = 1i64;
}
}
else
{
luaL_error(v1, "Usage: UnitAffectingCombat("unit")");
result = 0i64;
}
return result;
}
This Part if ( v4 && (*(*(v4 + 0x18 + 0x158i64) >> 0x13) & 1 )
UnitAffectingCombat is used to check if a unit is in combat.
UnitIsTapDenied is used to check if the unit is tapped by someone else (making it pointless to kill).
I thought he wanted to know the latter, but we will probably never know :P
"Threads should always commit suicide - they should never be murdered" - DirectX SDK