Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#include "../MQ2Plugin.h"
PreSetup("MQ2NoKos");
#undef SafeYLoc
#undef SafeXLoc
#undef SafeZLoc
#define CDisplay__MoveLocalPlayerToSafeCoords 0x45ED20
VOID GhostCommand(PSPAWNINFO pChar, PCHAR szLine);
VOID GhostReturn(float y, float x, float z);
float GhostReturnY;
float GhostReturnX;
float GhostReturnZ;
bool IsGhosting;
VOID GhostCommand(PSPAWNINFO pChar, PCHAR szLine)
{
static DWORD SpawnID;
if((!strcmp(szLine,"on")) && (GetCharInfo()->pSpawn->SpawnID != 0))
{
GhostReturnY = GetCharInfo()->pSpawn->Y;
GhostReturnX = GetCharInfo()->pSpawn->X;
GhostReturnZ = GetCharInfo()->pSpawn->Z;
pTarget = NULL;
SpawnID = GetCharInfo()->pSpawn->SpawnID;
GetCharInfo()->pSpawn->SpawnID = 0;
WriteChatColor("You are now ghosting.",COLOR_PURPLE);
IsGhosting = true;
}
if(!strcmp(szLine,"off"))
{
pTarget = NULL;
GetCharInfo()->pSpawn->SpawnID = SpawnID;
WriteChatColor("You are no longer ghosting.",COLOR_PURPLE);
IsGhosting = false;
}
if(!strcmp(szLine,"return"))
{
pTarget = NULL;
GetCharInfo()->pSpawn->SpawnID = SpawnID;
GhostReturn(GhostReturnY, GhostReturnX, GhostReturnZ);
IsGhosting = false;
}
if((!strcmp(szLine,"on")) && (IsGhosting = true))
{
WriteChatColor("You are already ghosting!",CONCOLOR_YELLOW);
}
}
VOID GhostReturn(float y, float x, float z)
{
PZONEINFO Zone = (PZONEINFO)pZoneInfo;
float SafeY = Zone->SafeYLoc;
float SafeX = Zone->SafeXLoc;
float SafeZ = Zone->SafeZLoc;
Zone->SafeYLoc = y;
Zone->SafeXLoc = x;
Zone->SafeZLoc = z;
CHAR szMsg[MAX_STRING] = {0};
sprintf(szMsg, "Returning back to: %3.2f, %3.2f, %3.2f.", Zone->SafeYLoc, Zone->SafeXLoc, Zone->SafeZLoc);
WriteChatColor(szMsg, CONCOLOR_YELLOW);
DWORD MLPTSC = CDisplay__MoveLocalPlayerToSafeCoords;
__asm call dword ptr [MLPTSC];
Zone->SafeYLoc = SafeY;
Zone->SafeXLoc = SafeX;
Zone->SafeZLoc = SafeZ;
}
PLUGIN_API VOID InitializePlugin(VOID)
{
AddCommand("/ghost",GhostCommand);
}
PLUGIN_API VOID ShutdownPlugin(VOID)
{
RemoveCommand("/ghost");
}