• Hail, we're RedGuides. We want you to play six (yes, 6!) EverQuest characters at once. We have scripts and a friendly community to help, please join our playstyle and say hello! 👋
Resource icon

Release MQ2Search

Alatyami

NotAddicted.com Engineer (Retired)
I cannot remember when/where but some one asked for a plugin that would allow you to lookup npc's and items while in game. Well here it is ...

MQ2Search - Opens a web browser to search Allakhazam's and EQTraders for items, recipes, and npc's.

Author: Alatyami
Version: 1.0
Date: January 1, 2009

Rich (BB code):
# Search for item on Allakhazam's
/alla item [string|item link]

# Search for NPCs on Allakhazam's
/alla npc [string]

# Search for item information on EqTraders.com
/eqtrader i [item link]

# Search for recipes requiring item on EqTraders.com
/eqtrader r [item link]


C++:
// MQ2Search.cpp : Defines the entry point for the DLL application.
#include "../MQ2Plugin.h"

PreSetup("MQ2Search");

// GLOBAL VARIABLES


// FUNCTION PROTOTYPES
void cmdSearchAlla (PSPAWNINFO, PCHAR);
void WriteMessage( const char* );

// FUNCTIONS
void cmdSearchAlla (PSPAWNINFO pChar, PCHAR szLine) {
	char szOption[MAX_STRING];
	//char szArg[MAX_STRING];
	char szURL[MAX_STRING];

	GetArg(szOption, szLine, 1);

	if (!strcmp (szOption, "item")) {
		strcpy(szURL, "/www everquest.allakhazam.com/search.html?q=");
		if ( szLine[5] == 0x12) {
			string strLine(szLine + 56);
			const char* cnstCharLine = strLine.c_str();
			strcat(szURL, cnstCharLine);
		} else {
			string strLine(szLine + 5);
			const char* cnstCharLine = strLine.c_str();
			strcat(szURL, cnstCharLine);
		}
	}

	if (!strcmp (szOption, "npc")) {
		strcpy(szURL, "/www eqbeastiary.allakhazam.com/search.shtml?name=");
		string strLine(szLine + 4);
		const char* cnstCharLine = strLine.c_str();
		strcat(szURL, cnstCharLine);
	}

	if (!strcmp (szOption, "help")) {
		SyntaxError("MQ2Search - Opens a web browser to search Allakhazam.com for items and npc's.");
		SyntaxError("Usage: /alla [item|npc] [string|item link]");
		SyntaxError("Note: NPC search does not support ${Target.Name}");
		return;
	}
	
	DoCommand(pChar, szURL);
}

void cmdSearchEQTraders (PSPAWNINFO pChar, PCHAR szLine) {
	char szOption[MAX_STRING];
	char szURL[MAX_STRING];

	GetArg(szOption, szLine, 1);

	if (!strcmp (szOption, "i")) {
		strcpy(szURL, "/www eqtraders.com/i?");
		string strLine(szLine + 2);
		const char* cnstCharLine = strLine.c_str();
		strcat(szURL, cnstCharLine);
	}

	if (!strcmp (szOption, "r")) {
		strcpy(szURL, "/www eqtraders.com/r?");
		string strLine(szLine + 2);
		const char* cnstCharLine = strLine.c_str();
		strcat(szURL, cnstCharLine);
	}
	
	if (!strcmp (szOption, "help")) {
		SyntaxError("MQ2Search - Opens a web browser to search eqtrader.com for items and recipes.");
		SyntaxError("Usage: /eqtrader [i|r] [item link]");
		return;
	}

	DoCommand(pChar, szURL);
}

void WriteMessage( const char* cMsg ) {
	char szMsg[MAX_STRING];
	strcpy( szMsg, cMsg);
	WriteChatColor(szMsg, CONCOLOR_GREEN);	
}

// Called once, when the plugin is to initialize
PLUGIN_API VOID InitializePlugin(VOID) {
	WriteMessage("MQ2Search v1.0 Loaded");
	AddCommand("/alla",cmdSearchAlla);
	AddCommand("/eqtrader", cmdSearchEQTraders);
}

// Called once, when the plugin is to shutdown
PLUGIN_API VOID ShutdownPlugin(VOID) {
	RemoveCommand("/alla");
	RemoveCommand("/eqtrader");

}


Enjoy

-Alatyami
 
May I make a suggestion for version 1.1 ?

Modify it and make it work with %t that way we dont have to type the name, only need to target the mob and do "/alla npc %t" for example.

That would be even more awesome, thanks!
 
Couldn't you already do "/alla npc ${Target.CleanName}" and accomplish the %t functionality already? (I could be wrong on the CleanName vs Name though and I'm at work so I can't verify in game)
 
Been using the hell out of this, with new expac I dont have everything in spawnmaster yet. Thanks for the awesome work again Yammers
 
MQ2Search - Opens a web browser to search Allakhazam's and EQTraders for items, recipes, and npc's.

/alla item [string|item link] - Search for item on Allakhazam's
/alla npc [string] - Search for NPCs on Allakhazam's -
/eqtrader i [item link] - Search for item information on EqTraders.com
/eqtrader r [item link] - Search for recipes requiring item on EqTraders.com - Search for item information on EqTraders.com

Hot Key Suggestion Thanks alt228. Will search Allakhazams.com for any npc you have targeted.
/alla npc ${Target.CleanName}

Hot Key Suggestion. Will search Allakhazams.com for current item on your cursor.
/alla item ${Cursor.Name}
 
Not sure if something has changed but the /alla npc ${Target.CleanName} does not work. It opens alla but only to the npc search page, not to the mob that is targeted.
 
Release MQ2Search

Users who are viewing this thread

Back
Top
Cart