- Joined
- Jan 31, 2005
- Messages
- 11,860
- Reaction score
- 587
- Points
- 113
- Location
- Australia
- Website
- www.mmobugs.com
Credit to Galuvwen.
Code:
// MQ2NoStun.cpp : Defines the entry point for the DLL application.
//
// PLUGIN_API is only to be used for callbacks. All existing callbacks at this time
// are shown below. Remove the ones your plugin does not use. Always use Initialize
// and Shutdown for setup and cleanup, do NOT do it in DllMain.
#include "../MQ2Plugin.h"
PreSetup("MQ2NoStun");
#define EQ_Character__StunMe 0x4251D0
class EQ_Character_Detour {
public:
int StunMe_Trampoline(unsigned int,unsigned int,unsigned int,unsigned char);
int StunMe_Detour(unsigned int A,unsigned int B,unsigned int C, unsigned char D)
{
WriteChatColor("[DETOUR] EQCharacter->StunMe detoured!", USERCOLOR_DEFAULT);
return 0x10;
}
};
DETOUR_TRAMPOLINE_EMPTY(int EQ_Character_Detour::StunMe_Trampoline(unsigned int, unsigned int, unsigned int, unsigned char));
// Called once, when the plugin is to initialize
PLUGIN_API VOID InitializePlugin(VOID)
{
DebugSpewAlways("Initializing MQ2NoStun");
EzDetour(EQ_Character__StunMe,EQ_Character_Detour::StunMe_Detour,EQ_Character_Detour::StunMe_Trampoline);
}
// Called once, when the plugin is to shutdown
PLUGIN_API VOID ShutdownPlugin(VOID)
{
DebugSpewAlways("Shutting down MQ2NoStun");
RemoveDetour(EQ_Character__StunMe);
}
// Called every frame that the \"HUD\" is drawn -- e.g. net status / packet loss bar
PLUGIN_API VOID OnDrawHUD(VOID)
{
//DebugSpewAlways("MQ2NoStun::OnDrawHUD()");
//No Stun
if ((ppCharData) && (pCharData)) {
GetCharInfo()->Stunned = 0;
}
}