|
|
|
#include "No-ckback.h"
|
|
|
|
#include "DSP-Utils.h"
|
|
|
|
|
|
|
|
#include <windows.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
plugininfo_t* g_PluginInfo;
|
|
|
|
|
|
|
|
bool Nockback::Initialize(IAshitaCore* core, ILogManager* log, uint32_t id)
|
|
|
|
{
|
|
|
|
this->m_AshitaCore = core;
|
|
|
|
this->m_PluginId = id;
|
|
|
|
this->m_LogManager = log;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Nockback::Release()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
plugininfo_t Nockback::GetPluginInfo()
|
|
|
|
{
|
|
|
|
return *g_PluginInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Nockback::HandleIncomingPacket(uint16_t id, uint32_t size, void* data, void* modified, bool blocked)
|
|
|
|
{
|
|
|
|
if (id == 0x28)
|
|
|
|
{
|
|
|
|
uint8_t actionType = (uint8_t)(unpackBitsBE((unsigned char*)data, 82, 4));
|
|
|
|
|
|
|
|
if (actionType == 11)
|
|
|
|
{
|
|
|
|
uint8_t targetNum = RBUFB(data, 0x09);
|
|
|
|
uint16_t startBit = 150;
|
|
|
|
for (int i = 0; i < targetNum; i++)
|
|
|
|
{
|
|
|
|
packBitsBE((unsigned char*)modified, 0, startBit + 60, 3);
|
|
|
|
if (unpackBitsBE((unsigned char*)data, startBit + 121, 1) & 0x1)
|
|
|
|
{
|
|
|
|
startBit += 37;
|
|
|
|
}
|
|
|
|
if (unpackBitsBE((unsigned char*)data, startBit + 122, 1) & 0x1)
|
|
|
|
{
|
|
|
|
startBit += 34;
|
|
|
|
}
|
|
|
|
startBit += 123;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
__declspec(dllexport) double __stdcall GetInterfaceVersion(void)
|
|
|
|
{
|
|
|
|
return ASHITA_INTERFACE_VERSION;
|
|
|
|
}
|
|
|
|
|
|
|
|
__declspec(dllexport) void __stdcall CreatePluginInfo(plugininfo_t* Data)
|
|
|
|
{
|
|
|
|
g_PluginInfo = Data;
|
|
|
|
g_PluginInfo->PluginVersion = 1.05;
|
|
|
|
g_PluginInfo->InterfaceVersion = ASHITA_INTERFACE_VERSION;
|
|
|
|
g_PluginInfo->Priority = 0;
|
|
|
|
|
|
|
|
strncpy_s(g_PluginInfo->Name, "No-ckback", 256);
|
|
|
|
strncpy_s(g_PluginInfo->Author, "kjLotus", 256);
|
|
|
|
}
|
|
|
|
|
|
|
|
__declspec(dllexport) IPlugin* __stdcall CreatePlugin(void)
|
|
|
|
{
|
|
|
|
return (IPlugin*)new Nockback();
|
|
|
|
}
|