You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
111 lines
3.1 KiB
111 lines
3.1 KiB
#ifndef __ASHITA_MMF_H_INCLUDED__ |
|
#define __ASHITA_MMF_H_INCLUDED__ |
|
|
|
#if defined (_MSC_VER) && (_MSC_VER >= 1020) |
|
#pragma once |
|
#endif |
|
#define SAFE_DELETE(p) if(p) { delete p; p = NULL; } |
|
|
|
#include "C:\Ashita 3\Plugins\ADK\Ashita.h" |
|
#include "Structs.h" |
|
#include "..\..\..\pluginheaders\Utilities.h" |
|
#include "..\..\..\pluginheaders\rapidxml.hpp" |
|
#include <time.h> |
|
#include <list> |
|
#include <map> |
|
|
|
using namespace std; |
|
|
|
|
|
extern plugininfo_t* g_PluginInfo; |
|
|
|
struct GroupData |
|
{ |
|
bool Loaded; |
|
char* rawdata; |
|
rapidxml::xml_document<> doc; |
|
std::map<uint16_t, string> Map; |
|
}; |
|
|
|
struct sFollow |
|
{ // 42 bytes |
|
unsigned int _unknown_0_4; // 0- 3 Looks like a pointer |
|
unsigned short TargetIndex; // 4- 5+2 |
|
unsigned int TargetID; // 8-11 |
|
float DirX; // 12-15 |
|
float DirY; // 16-19 |
|
float DirZ; // 20-23 |
|
unsigned char _unknown_24_27[4]; // 24-27 |
|
unsigned int _unknown_28_31; // 28-31 Same as _unknown_0_4 |
|
unsigned int FollowIndex; // 32-33+2 |
|
unsigned int FollowID; // 36-39 Once set will overwrite DirX, DirZ and DirY with directional values |
|
unsigned char _zero_40_40; // 40-40 |
|
unsigned char Autorun; // 41-41 |
|
}; |
|
|
|
class MultiSend : IPlugin, Ashita::Threading::AS_Thread |
|
{ |
|
IAshitaCore* m_AshitaCore; |
|
ILogManager* m_LogManager; |
|
DWORD m_PluginId; |
|
IDirect3DDevice8* m_Direct3DDevice; |
|
|
|
//References |
|
HANDLE hMapFile; |
|
sFollow* p_Follow; |
|
MMF_Global* p_MMF; |
|
|
|
//State tracking |
|
GroupData s_group; |
|
std::string s_name; |
|
uint32_t s_position; |
|
bool s_last_run_state; |
|
float s_vector_x; |
|
float s_vector_z; |
|
|
|
//Configuration |
|
std::list<uint16_t> c_groups; |
|
float c_maxdist; |
|
volatile bool c_follow; |
|
volatile bool c_attemptzone; |
|
volatile bool c_ignoreself; |
|
volatile bool c_debug; |
|
volatile bool c_safemode; |
|
|
|
public: |
|
MultiSend(void); |
|
virtual ~MultiSend(void); |
|
|
|
public: |
|
plugininfo_t GetPluginInfo(void); |
|
|
|
public: |
|
bool Initialize(IAshitaCore* core, ILogManager* log, uint32_t id); |
|
void Release(void); |
|
bool Direct3DInitialize(IDirect3DDevice8* lpDevice); |
|
void Direct3DPreRender(void); |
|
bool HandleIncomingPacket(uint16_t id, uint32_t size, void* data, void* modified, bool blocked) override; |
|
bool HandleCommand(const char* command, int32_t type); |
|
uint32_t ThreadEntry(void) override; |
|
|
|
bool CheckMatch(MMF_ICommand_Single command); |
|
bool ReadCommand(); |
|
void SendCommand(multisend_type type, uint32_t param, const char* Command); |
|
void SanitizeCommand(char* Input); |
|
std::string SubValues(std::string Input); |
|
void SubValues(char* Input); |
|
void UpdateName(std::string Name); |
|
void Claim(uint32_t* Target, uint32_t Mod); |
|
|
|
void LoadGroups(); |
|
void ReadXML(); |
|
void MatchGroups(); |
|
|
|
uint32_t GetArg(const char* text, std::string* buffer); |
|
}; |
|
|
|
__declspec(dllexport) double __stdcall GetInterfaceVersion(void); |
|
__declspec(dllexport) void __stdcall CreatePluginInfo(plugininfo_t* lpBuffer); |
|
__declspec(dllexport) IPlugin* __stdcall CreatePlugin(void); |
|
|
|
#endif // __ASHITA_MMF_H_INCLUDED__
|
|
|