Add Dominatemark

This commit is contained in:
LightCat 2019-03-30 12:36:45 +01:00
parent 699e72840f
commit 20e87c02e4
7 changed files with 66 additions and 0 deletions

View File

@ -3,6 +3,7 @@
<Include path="nullifiedcat/visuals/esp.xml"/>
<Include path="nullifiedcat/visuals/glow.xml"/>
<Include path="nullifiedcat/visuals/chams.xml"/>
<Include path="nullifiedcat/visuals/dominatemark.xml"/>
<Include path="nullifiedcat/visuals/tracers.xml"/>
<Include path="nullifiedcat/visuals/radar.xml"/>
<Include path="nullifiedcat/visuals/playerinfo.xml"/>

View File

@ -0,0 +1,9 @@
<Tab name="Dominatemark" padding="4 4 4 4">
<Box padding="12 6 6 6" width="content" height="content" name="Player Info">
<List width="150">
<AutoVariable width="fill" target="dominatemark.enable" label="Enable"/>
<AutoVariable width="fill" target="dominatemark.min-size" label="Draw min size"/>
<AutoVariable width="fill" target="dominatemark.max-size" label="Draw max size"/>
</List>
</Box>
</Tab>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 390 KiB

After

Width:  |  Height:  |  Size: 396 KiB

Binary file not shown.

View File

@ -6,6 +6,13 @@ namespace re
class CTFPlayerShared
{
public:
inline static bool IsDominatingPlayer(CTFPlayerShared *self, int ent_idx)
{
static auto signature = gSignatures.GetClientSignature("55 89 E5 56 53 83 EC ? 8B 5D ? E8 ? ? ? ? 89 C6 31 C0");
typedef bool (*IsDominatingPlayer_t)(CTFPlayerShared *, int);
static IsDominatingPlayer_t IsDominatingPlayer_fn = IsDominatingPlayer_t(signature);
return IsDominatingPlayer_fn(self, ent_idx);
}
inline static float GetCritMult(CTFPlayerShared *self)
{
return ((fminf(fmaxf(*(float *) (unsigned(self) + 672) * 0.0039215689f, 0.0f), 1.0f) * 3.0f) + 1.0f);

View File

@ -40,6 +40,7 @@ target_sources(cathook PRIVATE
add_subdirectory(ac)
if(EnableVisuals)
target_sources(cathook PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/DominateMark.cpp"
"${CMAKE_CURRENT_LIST_DIR}/ESP.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Tracers.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Radar.cpp"

View File

@ -0,0 +1,48 @@
/* Made by BenCat07
*
* On 30th of March
* 2019
*
*/
#include "common.hpp"
static settings::Bool draw_dominate{ "dominatemark.enable", "false" };
static settings::Float min_size{ "dominatemark.min-size", "15.0f" };
static settings::Float max_size{ "dominatemark.max-size", "40.0f" };
static InitRoutine init([]() {
EC::Register(EC::Draw,
[]() {
if (!*draw_dominate)
return;
if (CE_BAD(LOCAL_E))
return;
re::CTFPlayerShared *shared_player = &re::C_BasePlayer::shared_(RAW_ENT(LOCAL_E));
for (int i = 0; i < g_IEngine->GetMaxClients(); i++)
{
CachedEntity *ent = ENTITY(i);
if (CE_GOOD(ent) && ent->m_bAlivePlayer() && re::CTFPlayerShared::IsDominatingPlayer(shared_player, i))
{
Vector draw_pos;
float size;
if (!ent->hitboxes.GetHitbox(0))
continue;
// Calculate draw pos
auto c = ent->InternalEntity()->GetCollideable();
draw_pos = ent->m_vecOrigin();
draw_pos.z += c->OBBMaxs().z;
// Calculate draw size
size = *max_size * 1.5f - ent->m_flDistance() / 20.0f;
size = fminf(*max_size, size);
size = fmaxf(*min_size, size);
Vector out;
if (draw::WorldToScreen(draw_pos, out))
{
static textures::sprite sprite = textures::atlas().create_sprite(447, 257, 64, 64);
sprite.draw(int(out.x - size / 2.0f), int(out.y - size), int(size), int(size), colors::white);
}
}
}
},
"dominatemark_draw");
});