/info

A forum for feature requests/discussions and user submitted patches that improve MQ2

Moderator: MacroQuest Developers

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

/info

Post by Amadeus » Mon Feb 17, 2003 7:36 pm

I added a little command for MQ that simply gives me more information when I want to "consider" something rather than the bland info that comes with /consider.

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);
EQLib.cpp -- in DetermineWhoFirst() ... ADD

Code: Select all

		{ "/info",		CMD_MQ },
EQLib.cpp -- in TakeControlOfCommandList() ... ADD

Code: Select all

		{"/info",		"Info"},
EQLib.cpp -- Anywhere ... ADD

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;
}

Vendor001
Cheezily Banned
Cheezily Banned
Posts: 78
Joined: Wed Nov 13, 2002 1:37 pm

Post by Vendor001 » Thu Feb 20, 2003 7:37 pm

Has this been checked in? I think it would be kinda neat.