//Sever3 for MMOBugs.com
#include "../MQ2Plugin.h"
PreSetup("MQ2EmuWarpSafety");
#define Move 0x14CB
// Movement packet
typedef struct _MovePkt {
/*0000*/ unsigned short SpawnID;
/*0002*/ unsigned short TimeStamp;
/*0004*/ float Y;
/*0008*/ float DeltaZ;
/*0012*/ float DeltaY;
/*0016*/ float DeltaX;
/*0020*/ int Animation:10;
/*0020*/ int DeltaHeading:10;
/*0020*/ int padding0020:12;
/*0024*/ float X;
/*0028*/ float Z;
/*0032*/ int Heading:12;
/*0032*/ int padding1_0032:10;
/*0032*/ int padding2_0032:10;
} MovePkt;
PLUGIN_API BOOL OnSendPacket(DWORD Type, PVOID Packet, DWORD Size)
{
if (Type == Move)
{
MovePkt mp;
//Resets X units moved to 0 if you move 10 at once
if(mp.DeltaX > 10 || mp.DeltaX < -10) {
mp.DeltaX = 0;
}
//Resets Y units moved to 0 if you move 10 at once
if(mp.DeltaY > 10 || mp.DeltaY < -10) {
mp.DeltaY = 0;
}
//Resets Z units moved to 0 if you move 10 at once
if(mp.DeltaZ > 10 || mp.DeltaZ < -10) {
mp.DeltaZ = 0;
}
}
return true;
}
PLUGIN_API VOID InitializePlugin(VOID)
{
WriteChatColor("Warp Safety Status: Enabled",CONCOLOR_YELLOW);
}
PLUGIN_API VOID ShutdownPlugin(VOID)
{
WriteChatColor("Warp Safety Status: Disabled",CONCOLOR_YELLOW);
}