It's nothing wild or crazy, as it's my first thing for MQ, but perhaps someone will find it a useful addition :)
MQ.h -- Anywhere ... ADD
Code: Select all
extern "C" EQLIB_API VOID Info (PSPAWNINFO, PCHAR);
Code: Select all
{ "/info", CMD_MQ },
Code: Select all
{"/info", "Info"},
Code: Select all
// ***************************************************************************
// Function: Info(rmation)
// Description: Our '/info' command
// Usage: /info (which target acquired)
// ***************************************************************************
VOID Info(PSPAWNINFO pChar, PCHAR szLine)
{
CHAR szMsg[MAX_STRING] = {0};
CHAR szName[MAX_STRING] = {0};
PSPAWNINFO pTarget = NULL;
if (*EQADDR_TARGET == NULL)
{
WriteChatBuffer("You must first select a target.", USERCOLOR_WHO);
return;
}
if (*EQADDR_TARGET == pChar)
{
WriteChatBuffer("Surely you must know your own information!", USERCOLOR_WHO);
return;
}
if (!EQADDR_TARGET)
{
// I'm not certain what might cause this, but felt it best to have the check
// here anyway.
WriteChatBuffer("UNKNOWN MACROQUEST ERROR!", USERCOLOR_WHO);
return;
}
if (EQADDR_TARGET && *EQADDR_TARGET)
pTarget = *EQADDR_TARGET;
sprintf(szMsg, "%s is a level %d %s %s. (Dist: %f)",
CleanupName(strcpy(szName, pTarget->Name),FALSE),
pTarget->Level,
GetRaceByID(pTarget->Race),
GetClassByID(pTarget->Class),
DistanceToSpawn(pChar, pTarget) );
DoCommand(pChar, "/consider" );
WriteChatBuffer(szMsg, USERCOLOR_WHO );
//If you want to have your text the same color as the consider color, then
//comment out the line above,and replace with the one below.
//WriteChatBuffer(szMsg, ConColor(pChar->Level, pTarget->Level));
return;
}

