#include "../MQ2Plugin.h"
PreSetup("MQ2Zone");
#define LocalCEverQuest__DoTheZone 0x4FABE0 // SoD EMU
class LocalCEverQuest;
class LocalCEverQuest
{
public:
__declspec(dllexport) char * LocalCEverQuest::DoTheZone(int,char *,int,int,float,float,float,int);
};
#ifdef LocalCEverQuest__DoTheZone
FUNCTION_AT_ADDRESS(char * LocalCEverQuest::DoTheZone(int,char *,int,int,float,float,float,int),0x4FABE0); //SoD EMU
#endif
LocalCEverQuest **ppLEQ;
#define pLEQ (*ppLEQ)
VOID Fade(PSPAWNINFO pChar, PCHAR szLine);
float X,Y,Z;
int Heading;
int DestZone;
int DestType; // 0=use supplied coords 1=succorpoint
int ZoneReason;
VOID Fade(PSPAWNINFO pChar, PCHAR szLine)
{
CHAR szMsg[MAX_STRING] = {0};
if (pChar->Instance != 0)
{
DestZone = *((int *)(&(pChar->Instance)-1));
}
else
{
DestZone = pChar->Zone;
}
sprintf(szMsg,"Fading...");
WriteChatColor(szMsg,USERCOLOR_DEFAULT);
DestType=0;
ZoneReason=0;
Y=pChar->Y;
X=pChar->X;
Z=pChar->Z;
Heading =(int)pChar->Heading;
char aa[100]="test";
pLEQ->DoTheZone(DestZone,aa,DestType,ZoneReason,Y,X,Z,Heading);
return;
}
// Called once, when the plugin is to initialize
PLUGIN_API VOID InitializePlugin(VOID)
{
ppLEQ=(LocalCEverQuest**)pinstCEverQuest;
DebugSpewAlways("Initializing MQ2Zone");
AddCommand("/fade",Fade);
}
// Called once, when the plugin is to shutdown
PLUGIN_API VOID ShutdownPlugin(VOID)
{
DebugSpewAlways("Shutting down MQ2Zone");
RemoveCommand("/fade");
}