Lolwutt
7 years ago
6 changed files with 1281 additions and 1249 deletions
@ -1,220 +1,222 @@ |
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2011-2014 - Ashita Development Team |
* Copyright (c) 2011-2014 - Ashita Development Team |
||||||
* |
* |
||||||
* Ashita is free software: you can redistribute it and/or modify |
* Ashita is free software: you can redistribute it and/or modify |
||||||
* it under the terms of the GNU General Public License as published by |
* it under the terms of the GNU General Public License as published by |
||||||
* the Free Software Foundation, either version 3 of the License, or |
* the Free Software Foundation, either version 3 of the License, or |
||||||
* (at your option) any later version. |
* (at your option) any later version. |
||||||
* |
* |
||||||
* Ashita is distributed in the hope that it will be useful, |
* Ashita is distributed in the hope that it will be useful, |
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
* GNU General Public License for more details. |
* GNU General Public License for more details. |
||||||
* |
* |
||||||
* You should have received a copy of the GNU General Public License |
* You should have received a copy of the GNU General Public License |
||||||
* along with Ashita. If not, see <http://www.gnu.org/licenses/>.
|
* along with Ashita. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/ |
*/ |
||||||
|
|
||||||
#ifndef __ASHITA_Deeps_H_INCLUDED__ |
#ifndef __ASHITA_Deeps_H_INCLUDED__ |
||||||
#define __ASHITA_Deeps_H_INCLUDED__ |
#define __ASHITA_Deeps_H_INCLUDED__ |
||||||
|
|
||||||
#if defined (_MSC_VER) && (_MSC_VER >= 1020) |
#if defined (_MSC_VER) && (_MSC_VER >= 1020) |
||||||
#pragma once |
#pragma once |
||||||
#endif |
#endif |
||||||
|
|
||||||
enum REACTION |
enum REACTION |
||||||
{ |
{ |
||||||
REACTION_NONE = 0x00, |
REACTION_NONE = 0x00, |
||||||
REACTION_MISS = 0x01, |
REACTION_MISS = 0x01, |
||||||
REACTION_PARRY = 0x03, |
REACTION_PARRY = 0x03, |
||||||
REACTION_BLOCK = 0x04, |
REACTION_BLOCK = 0x04, |
||||||
REACTION_HIT = 0x08, |
REACTION_HIT = 0x08, |
||||||
REACTION_EVADE = 0x09, |
REACTION_EVADE = 0x09, |
||||||
REACTION_HIT2 = 0x10, |
REACTION_HIT2 = 0x10, |
||||||
REACTION_GUARD = 0x14 |
REACTION_GUARD = 0x14 |
||||||
}; |
}; |
||||||
|
|
||||||
enum SPECEFFECT |
enum SPECEFFECT |
||||||
{ |
{ |
||||||
SPECEFFECT_NONE = 0x00, |
SPECEFFECT_NONE = 0x00, |
||||||
SPECEFFECT_BLOOD = 0x02, |
SPECEFFECT_BLOOD = 0x02, |
||||||
SPECEFFECT_HIT = 0x10, |
SPECEFFECT_HIT = 0x10, |
||||||
SPECEFFECT_RAISE = 0x11, |
SPECEFFECT_RAISE = 0x11, |
||||||
SPECEFFECT_RECOIL = 0x20, |
SPECEFFECT_RECOIL = 0x20, |
||||||
SPECEFFECT_CRITICAL_HIT = 0x22 |
SPECEFFECT_CRITICAL_HIT = 0x22 |
||||||
}; |
}; |
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Required includes for an extension. |
* @brief Required includes for an extension. |
||||||
*/ |
*/ |
||||||
#include "C:\Ashita 3\plugins\ADK\Ashita.h" |
#include "C:\Ashita 3\plugins\ADK\Ashita.h" |
||||||
#include <map> |
#include <list> |
||||||
#include <functional> |
#include <map> |
||||||
#include <stdint.h> |
#include <functional> |
||||||
|
#include <stdint.h> |
||||||
struct damage_t |
|
||||||
{ |
struct damage_t |
||||||
uint64_t total; |
{ |
||||||
uint32_t max; |
uint64_t total; |
||||||
uint32_t min; |
uint32_t max; |
||||||
uint32_t count; |
uint32_t min; |
||||||
|
uint32_t count; |
||||||
damage_t() |
|
||||||
{ |
damage_t() |
||||||
total = 0; |
{ |
||||||
max = 0; |
total = 0; |
||||||
min = 0; |
max = 0; |
||||||
count = 0; |
min = 0; |
||||||
} |
count = 0; |
||||||
bool operator > (const damage_t& o) const |
} |
||||||
{ |
bool operator > (const damage_t& o) const |
||||||
return (count > o.count); |
{ |
||||||
} |
return (count > o.count); |
||||||
uint32_t avg() |
} |
||||||
{ |
uint32_t avg() |
||||||
return count > 0 ? (total / count) : 0; |
{ |
||||||
} |
return count > 0 ? (total / count) : 0; |
||||||
}; |
} |
||||||
|
}; |
||||||
struct source_t |
|
||||||
{ |
struct source_t |
||||||
std::string name; |
{ |
||||||
std::map<const char*, damage_t> damage; |
std::string name; |
||||||
|
std::map<const char*, damage_t> damage; |
||||||
source_t() |
|
||||||
{ |
source_t() |
||||||
|
{ |
||||||
} |
|
||||||
|
} |
||||||
uint64_t total() const |
|
||||||
{ |
uint64_t total() const |
||||||
uint64_t tot = 0; |
{ |
||||||
for (auto d : damage) |
uint64_t tot = 0; |
||||||
{ |
for (auto d : damage) |
||||||
tot += d.second.total; |
{ |
||||||
} |
tot += d.second.total; |
||||||
return tot; |
} |
||||||
} |
return tot; |
||||||
|
} |
||||||
bool operator > (const source_t& o) const |
|
||||||
{ |
bool operator > (const source_t& o) const |
||||||
return (total() > o.total()); |
{ |
||||||
} |
return (total() > o.total()); |
||||||
}; |
} |
||||||
|
}; |
||||||
struct entitysources_t |
|
||||||
{ |
struct entitysources_t |
||||||
std::string name; |
{ |
||||||
uint32_t color; |
std::string name; |
||||||
std::map<uint32_t, source_t> sources; |
uint32_t color; |
||||||
|
std::map<uint32_t, source_t> sources; |
||||||
uint64_t total() const |
|
||||||
{ |
uint64_t total() const |
||||||
int64_t total = 0; |
{ |
||||||
for (auto s : sources) |
int64_t total = 0; |
||||||
{ |
for (auto s : sources) |
||||||
total += s.second.total(); |
{ |
||||||
} |
total += s.second.total(); |
||||||
return total; |
} |
||||||
} |
return total; |
||||||
bool operator == (const entitysources_t& o) const |
} |
||||||
{ |
bool operator == (const entitysources_t& o) const |
||||||
return (total() == o.total()); |
{ |
||||||
} |
return (total() == o.total()); |
||||||
|
} |
||||||
bool operator > (const entitysources_t& o) const |
|
||||||
{ |
bool operator > (const entitysources_t& o) const |
||||||
return (total() > o.total()); |
{ |
||||||
} |
return (total() > o.total()); |
||||||
}; |
} |
||||||
|
}; |
||||||
std::map<uint32_t, entitysources_t> entities; |
|
||||||
std::map<IFontObject*, std::string> clickMap; |
std::map<uint32_t, entitysources_t> entities; |
||||||
|
std::map<IFontObject*, std::string> clickMap; |
||||||
static const std::vector<uint16_t> hitMessages = { 1, 2, 77, 132, 157, 161, 163, 185, 187, 197, 227, 264, 281, 317, 352, 413, 522, 576, 577 }; |
|
||||||
static const std::vector<uint16_t> critMessages = { 67, 252, 265, 274, 353, 379 }; |
static const std::vector<uint16_t> hitMessages = { 1, 2, 77, 132, 157, 161, 163, 185, 187, 197, 227, 264, 281, 317, 352, 413, 522, 576, 577 }; |
||||||
static const std::vector<uint16_t> missMessages = { 15, 85, 158, 188, 245, 284, 324, 354 }; |
static const std::vector<uint16_t> critMessages = { 67, 252, 265, 274, 353, 379 }; |
||||||
static const std::vector<uint16_t> evadeMessages = { 14, 30, 31, 32, 33, 189, 248, 282, 283, 323, 355 }; |
static const std::vector<uint16_t> missMessages = { 15, 85, 158, 188, 245, 284, 324, 354 }; |
||||||
static const std::vector<uint16_t> parryMessages = { 69, 70 }; |
static const std::vector<uint16_t> evadeMessages = { 14, 30, 31, 32, 33, 189, 248, 282, 283, 323, 355 }; |
||||||
|
static const std::vector<uint16_t> parryMessages = { 69, 70 }; |
||||||
static const std::vector<D3DCOLOR> Colors = { D3DCOLOR_ARGB(255, 12, 0, 155), D3DCOLOR_ARGB(255, 140, 0, 0), D3DCOLOR_ARGB(255, 255, 177, 32), D3DCOLOR_ARGB(255, 143, 143, 143), |
|
||||||
D3DCOLOR_ARGB(255, 68, 68, 68), D3DCOLOR_ARGB(255, 255, 0, 0), D3DCOLOR_ARGB(255, 0, 164, 49), D3DCOLOR_ARGB(255, 198, 198, 0), |
static const std::vector<D3DCOLOR> Colors = { D3DCOLOR_ARGB(255, 12, 0, 155), D3DCOLOR_ARGB(255, 140, 0, 0), D3DCOLOR_ARGB(255, 255, 177, 32), D3DCOLOR_ARGB(255, 143, 143, 143), |
||||||
D3DCOLOR_ARGB(255, 116, 0, 145), D3DCOLOR_ARGB(255, 165, 153, 10), D3DCOLOR_ARGB(255, 184, 128, 10), D3DCOLOR_ARGB(255, 224, 0, 230), |
D3DCOLOR_ARGB(255, 68, 68, 68), D3DCOLOR_ARGB(255, 255, 0, 0), D3DCOLOR_ARGB(255, 0, 164, 49), D3DCOLOR_ARGB(255, 198, 198, 0), |
||||||
D3DCOLOR_ARGB(255, 234, 100, 0), D3DCOLOR_ARGB(255, 119, 0, 0), D3DCOLOR_ARGB(255, 130, 17, 255), D3DCOLOR_ARGB(255, 79, 196, 0), |
D3DCOLOR_ARGB(255, 116, 0, 145), D3DCOLOR_ARGB(255, 165, 153, 10), D3DCOLOR_ARGB(255, 184, 128, 10), D3DCOLOR_ARGB(255, 224, 0, 230), |
||||||
D3DCOLOR_ARGB(255, 0, 16, 217), D3DCOLOR_ARGB(255, 136, 68, 0), D3DCOLOR_ARGB(255, 244, 98, 0), D3DCOLOR_ARGB(255, 15, 190, 220), |
D3DCOLOR_ARGB(255, 234, 100, 0), D3DCOLOR_ARGB(255, 119, 0, 0), D3DCOLOR_ARGB(255, 130, 17, 255), D3DCOLOR_ARGB(255, 79, 196, 0), |
||||||
D3DCOLOR_ARGB(255, 0, 123, 145) }; |
D3DCOLOR_ARGB(255, 0, 16, 217), D3DCOLOR_ARGB(255, 136, 68, 0), D3DCOLOR_ARGB(255, 244, 98, 0), D3DCOLOR_ARGB(255, 15, 190, 220), |
||||||
|
D3DCOLOR_ARGB(255, 0, 123, 145) }; |
||||||
void g_onClick(int, void*, float, float); |
|
||||||
|
void g_onClick(int, void*, float, float); |
||||||
/**
|
|
||||||
* @brief Global copy of our plugin data. |
/**
|
||||||
*/ |
* @brief Global copy of our plugin data. |
||||||
plugininfo_t* g_PluginInfo = NULL; |
*/ |
||||||
|
plugininfo_t* g_PluginInfo = NULL; |
||||||
/**
|
|
||||||
* @brief Our Main Plugin Class |
/**
|
||||||
* |
* @brief Our Main Plugin Class |
||||||
* @note The main class of your plugin MUST use PluginBase as a base class. This is the |
* |
||||||
* internal base class that Ashita uses to communicate with your plugin! |
* @note The main class of your plugin MUST use PluginBase as a base class. This is the |
||||||
*/ |
* internal base class that Ashita uses to communicate with your plugin! |
||||||
class Deeps : IPlugin |
*/ |
||||||
{ |
class Deeps : IPlugin |
||||||
/**
|
{ |
||||||
* @brief Internal class variables. |
/**
|
||||||
*/ |
* @brief Internal class variables. |
||||||
IAshitaCore* m_AshitaCore; |
*/ |
||||||
ILogManager* m_LogManager; |
IAshitaCore* m_AshitaCore; |
||||||
DWORD m_PluginId; |
ILogManager* m_LogManager; |
||||||
IDirect3DDevice8* m_Direct3DDevice; |
DWORD m_PluginId; |
||||||
|
IDirect3DDevice8* m_Direct3DDevice; |
||||||
private: |
std::list<void*> m_Packets; |
||||||
source_t* getDamageSource(entitysources_t* entityInfo, uint8_t actionType, uint16_t actionID); |
|
||||||
bool updateDamageSource(source_t* source, uint16_t message, uint32_t damage); |
private: |
||||||
void repairBars(IFontObject* deepsBase, uint8_t size); |
source_t* getDamageSource(entitysources_t* entityInfo, uint8_t actionType, uint16_t actionID); |
||||||
void report(char mode, int max); |
bool updateDamageSource(source_t* source, uint16_t message, uint32_t damage); |
||||||
uint16_t getIndex(std::function<bool(IEntity*, int)>); |
void repairBars(IFontObject* deepsBase, uint8_t size); |
||||||
uint32_t m_charInfo; |
void report(char mode, int max); |
||||||
std::string m_sourceInfo; |
uint16_t getIndex(std::function<bool(IEntity*, int)>); |
||||||
uint8_t m_bars; |
uint32_t m_charInfo; |
||||||
bool m_debug; |
std::string m_sourceInfo; |
||||||
|
uint8_t m_bars; |
||||||
public: |
bool m_debug; |
||||||
/**
|
|
||||||
* @brief Constructor and deconstructor. |
public: |
||||||
*/ |
/**
|
||||||
Deeps(void); |
* @brief Constructor and deconstructor. |
||||||
virtual ~Deeps(void); |
*/ |
||||||
|
Deeps(void); |
||||||
/**
|
virtual ~Deeps(void); |
||||||
* @brief GetPluginData implementation. |
|
||||||
*/ |
/**
|
||||||
plugininfo_t GetPluginInfo(void); |
* @brief GetPluginData implementation. |
||||||
|
*/ |
||||||
/**
|
plugininfo_t GetPluginInfo(void); |
||||||
* @brief PluginBase virtual overrides. |
|
||||||
*/ |
/**
|
||||||
bool Initialize(IAshitaCore* core, ILogManager* log, uint32_t id); |
* @brief PluginBase virtual overrides. |
||||||
void Release(void); |
*/ |
||||||
bool HandleCommand(const char* command, int32_t type); |
bool Initialize(IAshitaCore* core, ILogManager* log, uint32_t id); |
||||||
bool HandleIncomingText(int16_t mode, const char* message, int16_t* modifiedMode, char* modifiedMessage, bool blocked); |
void Release(void); |
||||||
bool HandleIncomingPacket(uint16_t id, uint32_t size, void* data, void* modified, bool blocked); |
bool HandleCommand(const char* command, int32_t type); |
||||||
bool HandleOutgoingPacket(uint16_t id, uint32_t size, void* data, void* modified, bool blocked); |
bool HandleIncomingText(int16_t mode, const char* message, int16_t* modifiedMode, char* modifiedMessage, bool blocked); |
||||||
bool Direct3DInitialize(IDirect3DDevice8* device); |
bool HandleIncomingPacket(uint16_t id, uint32_t size, void* data, void* modified, bool blocked); |
||||||
void Direct3DRelease(void); |
bool HandleOutgoingPacket(uint16_t id, uint32_t size, void* data, void* modified, bool blocked); |
||||||
void Direct3DPreRender(void); |
bool Direct3DInitialize(IDirect3DDevice8* device); |
||||||
void Direct3DRender(void); |
void Direct3DRelease(void); |
||||||
void onClick(int, IFontObject*, float, float); |
void Direct3DPreRender(void); |
||||||
}; |
void Direct3DRender(void); |
||||||
|
void onClick(int, IFontObject*, float, float); |
||||||
// Global pointer to this
|
}; |
||||||
|
|
||||||
Deeps* g_Deeps = NULL; |
// Global pointer to this
|
||||||
|
|
||||||
/**
|
Deeps* g_Deeps = NULL; |
||||||
* @brief Required Plugin Exports |
|
||||||
*/ |
/**
|
||||||
__declspec(dllexport) double __stdcall GetInterfaceVersion(void); |
* @brief Required Plugin Exports |
||||||
__declspec(dllexport) void __stdcall CreatePluginInfo(plugininfo_t* lpBuffer); |
*/ |
||||||
__declspec(dllexport) IPlugin* __stdcall CreatePlugin(void); |
__declspec(dllexport) double __stdcall GetInterfaceVersion(void); |
||||||
|
__declspec(dllexport) void __stdcall CreatePluginInfo(plugininfo_t* lpBuffer); |
||||||
#endif // __ASHITA_Deeps_H_INCLUDED__
|
__declspec(dllexport) IPlugin* __stdcall CreatePlugin(void); |
||||||
|
|
||||||
|
#endif // __ASHITA_Deeps_H_INCLUDED__
|
||||||
|
@ -1,5 +1,5 @@ |
|||||||
LIBRARY "Deeps" |
LIBRARY "Deeps" |
||||||
EXPORTS |
EXPORTS |
||||||
GetInterfaceVersion |
GetInterfaceVersion |
||||||
CreatePluginInfo |
CreatePluginInfo |
||||||
CreatePlugin |
CreatePlugin |
Binary file not shown.
Loading…
Reference in new issue