MQ2Warning:
Purpose: Provide an audio warning of various conditions in game, thank you Odessa for your assistance with this plugin.
Why Developed: To alert me when certain players, guilds or GM's enter the zone. Pause macros if I am running AFK crafter or hunters. Also assists me when I am doing things in game it can be very stressful watching out for guilds or players that may train me. Or that get to close and spot me me using MQ2.
HUD proved to be to stressful and hard to keep an eye on when I am killing a mob or involved in a quest. So the audio warning is a great system to alert me.
How Does it Work?
The default configuration will use 3 sound files from your EQ Trigger Sound File Folder. (You can change the path to any sound file you wish to use Default is C:\program files\sony\everquest\)
Commands:
/rtone resets tone
/wreset resets the entire macro monitor..
I suggest you use this after you start the plugin and then fire your macro to make sure its reset and ready to go.
Before loading the plugin, configure the .ini file ,
Ini File Settings:
Friends =Put the names of all toons / friends that will be in zone with you.
Enemies = List any players that you do not like in game or that may try to train you. Use a comma with no space between names.
Guilds = List any Enemy Guilds
PlayerCount = Warn me if more then this number of players are in the zone. If you are boxing two toons then put 2 and if anyone else enters the zone that is not on your friends list an audio alarm will sound.
PauseOnPlayerCount = If you are running a macro do you want to pause the macro on any warning 0 = No 1 = Yes
WarningRadius = Set a Radius distance to warn you if one of your enemies or enemy guilds enters this radious (Default is 200 and should be fine). This feature lets you know if an enemy you know of may try to train or kill you.
PauseOnRadius = Pause macro if Enemy enters radious 0 = No 1 = Yes
PauseOnEnemy=Pause macro if Enemy enters zone
PauseOnGuild=Pause macro if Named Guild enters zone
PauseOnGM=Pause macro if GM enters zone
Source Code for Plugin:
Sample ini file
Enjoy
Purpose: Provide an audio warning of various conditions in game, thank you Odessa for your assistance with this plugin.
Why Developed: To alert me when certain players, guilds or GM's enter the zone. Pause macros if I am running AFK crafter or hunters. Also assists me when I am doing things in game it can be very stressful watching out for guilds or players that may train me. Or that get to close and spot me me using MQ2.
HUD proved to be to stressful and hard to keep an eye on when I am killing a mob or involved in a quest. So the audio warning is a great system to alert me.
How Does it Work?
The default configuration will use 3 sound files from your EQ Trigger Sound File Folder. (You can change the path to any sound file you wish to use Default is C:\program files\sony\everquest\)
Commands:
/rtone resets tone
/wreset resets the entire macro monitor..
I suggest you use this after you start the plugin and then fire your macro to make sure its reset and ready to go.
Before loading the plugin, configure the .ini file ,
Ini File Settings:
Friends =Put the names of all toons / friends that will be in zone with you.
Enemies = List any players that you do not like in game or that may try to train you. Use a comma with no space between names.
Guilds = List any Enemy Guilds
PlayerCount = Warn me if more then this number of players are in the zone. If you are boxing two toons then put 2 and if anyone else enters the zone that is not on your friends list an audio alarm will sound.
PauseOnPlayerCount = If you are running a macro do you want to pause the macro on any warning 0 = No 1 = Yes
WarningRadius = Set a Radius distance to warn you if one of your enemies or enemy guilds enters this radious (Default is 200 and should be fine). This feature lets you know if an enemy you know of may try to train or kill you.
PauseOnRadius = Pause macro if Enemy enters radious 0 = No 1 = Yes
PauseOnEnemy=Pause macro if Enemy enters zone
PauseOnGuild=Pause macro if Named Guild enters zone
PauseOnGM=Pause macro if GM enters zone
Source Code for Plugin:
Rich (BB code):
#include "../MQ2Plugin.h"
#include <iostream>
#include <string>
#include <vector>
using namespace std;
std::vector <std::string> friends;
std::vector <std::string> enemies;
std::vector <std::string> guilds;
int igSkipPulses = 10;
int igSkipPulse = 0;
int warningRadius = 200;
int playerCount;
bool pauseOnPlayerCount;
bool pauseOnGM;
bool pauseOnRadius;
bool pauseOnEnemy;
bool pauseOnGuild;
bool verbose = false;
bool paused = false;
bool beeped = false;
PreSetup("MQ2Warning");
VOID Tokenize(const string& str, vector<string>& tokens, const string& delimiters = ",")
{
// Skip delimiters at beginning.
string::size_type lastPos = str.find_first_not_of(delimiters, 0);
// Find first "non-delimiter".
string::size_type pos = str.find_first_of(delimiters, lastPos);
while (string::npos != pos || string::npos != lastPos)
{
// Found a token, add it to the vector.
tokens.push_back(str.substr(lastPos, pos - lastPos));
// Skip delimiters. Note the "not_of"
lastPos = str.find_first_not_of(delimiters, pos);
// Find next "non-delimiter"
pos = str.find_first_of(delimiters, lastPos);
}
}
VOID Update_INIFileName() {
sprintf(INIFileName,"%s\\MQ2Warning.ini",gszINIPath);
}
VOID Load_MQ2Radar_INI()
{
std::string _friends;
std::string _enemies;
std::string _guilds;
CHAR szTemp[MAX_STRING]={0};
Update_INIFileName();
GetPrivateProfileString("MQ2Warning","Friends","",&szTemp[0],sizeof(szTemp),INIFileName);
_friends = string(szTemp);
Tokenize(_friends, friends);
WritePrivateProfileString("MQ2Warning","Friends",szTemp,INIFileName);
GetPrivateProfileString("MQ2Warning","Enemies","",&szTemp[0],sizeof(szTemp),INIFileName);
_enemies = string(szTemp);
Tokenize(_enemies, enemies);
WritePrivateProfileString("MQ2Warning","Enemies",szTemp,INIFileName);
GetPrivateProfileString("MQ2Warning","Guilds","",&szTemp[0],sizeof(szTemp),INIFileName);
_guilds = string(szTemp);
Tokenize(_guilds, guilds);
WritePrivateProfileString("MQ2Warning","Guilds",szTemp,INIFileName);
GetPrivateProfileString("MQ2Warning","PlayerCount","0",&szTemp[0],sizeof(szTemp),INIFileName);
playerCount = atoi(&szTemp[0]);
sprintf(szTemp, "%d", playerCount);
WritePrivateProfileString("MQ2Warning","PlayerCount",szTemp,INIFileName);
GetPrivateProfileString("MQ2Warning","PauseOnPlayerCount","1",&szTemp[0],sizeof(szTemp),INIFileName);
pauseOnPlayerCount = atoi(&szTemp[0]);
sprintf(szTemp, "%d", pauseOnPlayerCount);
WritePrivateProfileString("MQ2Warning","PauseOnPlayerCount",szTemp,INIFileName);
GetPrivateProfileString("MQ2Warning","WarningRadius","200",&szTemp[0],sizeof(szTemp),INIFileName);
warningRadius = atoi(&szTemp[0]);
sprintf(szTemp, "%d", warningRadius);
WritePrivateProfileString("MQ2Warning","WarningRadius",szTemp,INIFileName);
GetPrivateProfileString("MQ2Warning","PauseOnRadius","1",&szTemp[0],sizeof(szTemp),INIFileName);
pauseOnRadius = atoi(&szTemp[0]);
sprintf(szTemp, "%d", pauseOnRadius);
WritePrivateProfileString("MQ2Warning","PauseOnRadius",szTemp,INIFileName);
GetPrivateProfileString("MQ2Warning","PauseOnEnemy","1",&szTemp[0],sizeof(szTemp),INIFileName);
pauseOnEnemy = atoi(&szTemp[0]);
sprintf(szTemp, "%d", pauseOnEnemy);
WritePrivateProfileString("MQ2Warning","PauseOnEnemy",szTemp,INIFileName);
GetPrivateProfileString("MQ2Warning","PauseOnGuild","1",&szTemp[0],sizeof(szTemp),INIFileName);
pauseOnGuild = atoi(&szTemp[0]);
sprintf(szTemp, "%d", pauseOnGuild);
WritePrivateProfileString("MQ2Warning","PauseOnGuild",szTemp,INIFileName);
GetPrivateProfileString("MQ2Warning","PauseOnGM","1",&szTemp[0],sizeof(szTemp),INIFileName);
pauseOnGM = atoi(&szTemp[0]);
sprintf(szTemp, "%d", pauseOnGM);
WritePrivateProfileString("MQ2Warning","PauseOnGM",szTemp,INIFileName);
}
BOOL Friend(PSPAWNINFO pSpawn) {
for (int i=0;i<friends.size();i++) {
if (!stricmp(pSpawn->Name,friends.c_str())) return true;
}
return false;
}
BOOL Enemy(PSPAWNINFO pSpawn) {
for (int i=0;i<enemies.size();i++) {
if (!stricmp(pSpawn->Name,enemies.c_str())) return true;
}
return false;
}
BOOL Guild(PSPAWNINFO pSpawn) {
for (int i=0;i<guilds.size();i++) {
if (!stricmp(pGuildList->GuildName[pSpawn->GuildID],guilds.c_str())) return true;
}
return false;
}
VOID ResetBeep(PSPAWNINFO pChar, PCHAR szLine) {
beeped = false;
}
VOID Reset(PSPAWNINFO pChar, PCHAR szLine) {
beeped = false;
paused = false;
DoCommand(pChar,"/mqpause off");
}
VOID Verbose(PSPAWNINFO pChar, PCHAR szLine) {
if (verbose) {
verbose = false;
} else {
verbose = true;
}
}
BOOL InGame() {
return(gGameState == GAMESTATE_INGAME && GetCharInfo2() && GetCharInfo());
}
// Called once, when the plugin is to initialize
PLUGIN_API VOID InitializePlugin(VOID)
{
DebugSpewAlways("Initializing MQ2Warning");
Load_MQ2Radar_INI();
AddCommand("/rtone",ResetBeep);
AddCommand("/wreset",Reset);
AddCommand("/wverbose",Verbose);
}
// Called once, when the plugin is to shutdown
PLUGIN_API VOID ShutdownPlugin(VOID)
{
DebugSpewAlways("Shutting down MQ2Warning");
RemoveCommand("/rtone");
RemoveCommand("/wverbose");
RemoveCommand("/wreset");
}
PLUGIN_API VOID OnPulse(VOID)
{
PSPAWNINFO pSpawn = (PSPAWNINFO)pSpawnList;
PSPAWNINFO pChar = GetCharInfo()->pSpawn;
int beeptype = 0, count = 0;
//HWND EQhWnd = *(HWND*)EQADDR_HWND;
if (InGame()) {// && GetForegroundWindow()==EQhWnd) {
if (igSkipPulse == igSkipPulses) {
igSkipPulse = 0;
while (pSpawn)
{
if (GetSpawnType(pSpawn)==PC) {
count++;
if (pSpawn!=pChar && !Friend(pSpawn)) {
// check radius
if (pauseOnRadius && GetDistance(pChar,pSpawn)<warningRadius)
{
if (verbose) WriteChatf("WARNING: %s within Radius!", pSpawn->Name);
beeptype = 3; // play 3 times
}
// check enemies
if (pauseOnEnemy && Enemy(pSpawn)) {
if (verbose) WriteChatf("WARNING: Enemy %s in zone!", pSpawn->Name);
beeptype = 1;
}
// check guilds
if (pauseOnGuild && Guild(pSpawn)) {
if (verbose) WriteChatf("WARNING: Guild %s, player %s in zone!", GetGuildByID(pSpawn->GuildID), pSpawn->Name);
beeptype = 1;
}
// check GM
if (pauseOnGM && pSpawn->GM && !beeped) {
if (verbose) WriteChatf("WARNING: GM %s in Zone!", pSpawn->Name);
beeptype = 2; // play 3 times thump
}
}
// check count
if (pauseOnPlayerCount && playerCount < count) {
if (verbose) WriteChatf("WARNING: Too many players in zone!");
beeptype = 4; // play 3 times
}
}
pSpawn=pSpawn->pNext;
}
if (beeptype>0 && !beeped) {
if (beeptype==3) {
MacroBeep(pChar,"AudioTriggers\\default\\alert3.wav");
Sleep(500);
MacroBeep(pChar,"AudioTriggers\\default\\alert3.wav");
Sleep(500);
MacroBeep(pChar,"AudioTriggers\\default\\alert3.wav");
}
if (beeptype==4) {
MacroBeep(pChar,"AudioTriggers\\default\\alert.wav");
Sleep(500);
MacroBeep(pChar,"AudioTriggers\\default\\alert.wav");
Sleep(500);
MacroBeep(pChar,"AudioTriggers\\default\\alert.wav");
}
if (beeptype==1) {
MacroBeep(pChar,"AudioTriggers\\default\\alert.wav");
}
if (beeptype==2) {
MacroBeep(pChar,"AudioTriggers\\default\\thump.wav");
Sleep(500);
MacroBeep(pChar,"AudioTriggers\\default\\thump.wav");
Sleep(500);
MacroBeep(pChar,"AudioTriggers\\default\\thump.wav");
}
paused = true;
beeped = true;
DoCommand(pChar,"/mqpause on");
}
if (beeptype==0 && paused) {
beeped = false;
paused = false;
DoCommand(pChar,"/mqpause off");
}
} else {
igSkipPulse++;
}
}
}
Sample ini file
Rich (BB code):
[MQ2Warning]
Friends=Fred,Barny,Pebbles
Enemies=Satan,Greg,Ed
Guilds=StormHaters,Avid Hunters,Raid Rangers
PlayerCount=2
PauseOnPlayerCount=1
WarningRadius=200
PauseOnRadius=1
PauseOnEnemy=1
PauseOnGuild=1
PauseOnGM=1
Enjoy
Last edited:


but um, I'd prolly reverse those friends/enemies