Alatyami
NotAddicted.com Engineer (Retired)
- Joined
- Dec 21, 2004
- RedCents
- 804¢
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
[highlight=cpp]// 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");
}[/highlight]
Enjoy
-Alatyami
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]
[highlight=cpp]// 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");
}[/highlight]
Enjoy
-Alatyami


