• You've discovered RedGuides 📕 an EverQuest multi-boxing community 🛡️🧙🗡️. We want you to play several EQ characters at once, come join us and say hello! 👋
  • IS THIS SITE UGLY? Change the look. To dismiss this notice, click the X --->
  • EverQuest (live servers) were patched today so brainiac is spending his evening updating MacroQuest. Please show him your appreciation.
Resource icon

Plugin - MQ2CharNotes (1 Viewer)

P

Psycotic

EverQuest I

If accepted, I would like access to the EverQuest I section.

------------------------------------------------------------
This is a custom plugin for MacroQuest2 written by me.

This started out as a simple "friends list comment" and turned into a whole plugin to add notes to PC's and NPC's. You could add any info you want to a character and it will be displayed if they are in zone, or if you have them targeted. It could be used to note epic drops off of mobs, or mark a mob as unmezzable, unrootable, unsnareable, etc.. It can mark a player as "a great tank" or "a jerk, never rez this guy even if he pays you".

It's still a work in progress, and I've got a TO-DO list that I'm working on, but I'd like to get some feedback on it (since it's my first solo plugin). Well, enough gabbing.. On to the plugin!

Rich (BB code):
 // MQ2CharNotes.cpp : Add Character / NPC Comments, Viewable in Chat and HUD
 //
 // version 0.9 (by Psycotic)
 //
 //////////////////////////////////////////////////////////////////////////////
 // Usage:
 //   This plugin lets you add a PC or NPC comment to a character.  When
 //   active, It scan any new spawns, and all spawns upon zoning in, for
 //   any comments you have saved in MQCharNotes.ini.  It will display these
 //   comments in the MQChat window upon spawn or zone if anyone zones in
 //   or is currently in zone when you enter.  It will display the current
 //   targeted player or NPC comment in the HUD.
 // 
 //
 // Commands:
 //  /charnote <comment>   - Currently targeted PC or NPC will have the comment 
 //                          assigned to them, and be displayed as requested
 //                          If the target is a corpse, it will assign the 
 //                          comment to the live  PC or NPC it belongs to.
 //                          If the comment already exists, it will update it.
 //
 //  /charnote -delete     - Will delete the comment from the currently targeted
 //                          PC or NPC.  Currently will only 'clear' the comment
 //                          and not actually remove the name from the INI file.
 //
 //  /charnotepos <x> <y>  - Assigns the position of the comment in the HUD
 //
 //
 //  Examples -
 //
 //  (With "a rabbit" currently targeted)
 //   /charnote This guy's foot isn't so lucky anymore!
 //    - Would add the comment "This guy's foot isn't so lucky anymore!"
 //      to any "a rabbit" NPC's in zone.
 //
 //  (With "Psycotic" currently targeted)
 //   /charnote This guy rocks!
 //    - Would add the comment "This guy rocks!" to PC Psycotic
 //
 //   /charnote -delete
 //    - Would clear the comment from Psycotic, leaving Psycotic's INI entry
 //
 //   /charnotepos 200 500
 //    - Would change the current HUD location of the comment to x200 y500
 //
 //
 // INI File Config Settings - Current possible settings
 //
 // CharNotesPosX=200       - Current HUD X-Axis Location
 // CharNotesPosY=170       - Current HUD Y-Axis Location
 // ShowInChat=on           - Toggle Showing Comments in Chat
 // ShowInHUD=on            - Toggle Showing Comments on HUD
 // MaxNotes=200            - Maximum Number of Possible Comments
 //
 //
 // Known Issues/ToDo:
 //  - Currently, there's no way to remove a comment once it's been added
 //    without editing the INI file and reordering the numbers.  It will
 //    clear the comment, but will not remove the target from the INI file.
 //
 //  - The code could use a bit of optimization and commenting
 //
 //  - I'd like to add a custom XML window to host the list so it doesn't
 //    scroll off the MQChat window.
 //
 //////////////////////////////////////////////////////////////////////////////
 
 
 
 #include "../MQ2Plugin.h"
 
 PreSetup("MQ2CharNotes");
 
 #define CHAT 0
 #define HUD 1
 char szTemp[MAX_STRING];
 bool ShowInChat;
 bool ShowInHUD;
 int MAX_NOTES;
 int CharNotesX;
 int CharNotesY;
 int CurNote=0;
 
 struct CharNoteList 
 {
     char Name[35];
     char Note[90];
 }; 
 
 CharNoteList CharNote[MAX_STRING];
 PSPAWNINFO psTarget;
 
 
 VOID ShowHelp(VOID)
 {
     WriteChatColor("CharNotes - Usage", CONCOLOR_YELLOW);
     WriteChatColor("'/charnote This note will be displayed for the target'", CONCOLOR_YELLOW);
     WriteChatColor("'/charnote -delete'      (Will 'clear' the comment for current target)", CONCOLOR_YELLOW);
     WriteChatColor("'/charnotepos <x> <y>'   (X,Y display location on HUD)", CONCOLOR_YELLOW);
     return;
 }
 
 VOID ClearArray(VOID)
 {
 CurNote=0;
     for (int i = 1; i <= MAX_NOTES; i++)
     {
         strcpy(CharNote.Name, "");
         strcpy(CharNote.Note, "");
     }
 }
 
 VOID SaveINIArray(VOID)
 {
 char NameArray[MAX_STRING];
 char NoteArray[MAX_STRING];
 
     for (int i = 1;  i <= CurNote; i++)
     {
         sprintf(NameArray, "Name%i",i);
         sprintf(NoteArray, "Note%i",i);
         WritePrivateProfileString("SPAWNS",NameArray,CharNote.Name,INIFileName);
         WritePrivateProfileString("SPAWNS",NoteArray,CharNote.Note,INIFileName);
     }    
 }
 
 VOID LoadINIArray(VOID)
 {
 char NameArray[MAX_STRING];
 char NoteArray[MAX_STRING];
 char Name[MAX_STRING];
 char Note[MAX_STRING];
 
     ClearArray();
     for (int i = 1; i <= MAX_NOTES; i++)
     {
         sprintf(NameArray, "Name%i",i);
         sprintf(NoteArray, "Note%i",i);
         GetPrivateProfileString("SPAWNS",NameArray,NULL,Name,MAX_STRING,INIFileName);
         GetPrivateProfileString("SPAWNS",NoteArray,NULL,Note,MAX_STRING,INIFileName);
         if (strcmp(Name,""))
         {
             strcpy(CharNote.Name,Name);
             strcpy(CharNote.Note,Note);
             CurNote=i;
         }
         else
         {
             return;
         }
 
     }
 }
 
 VOID LoadConfig(VOID)
 {
     GetPrivateProfileString("Config","ShowInChat","on",szTemp,MAX_STRING,INIFileName);
     if (!strcmp(szTemp, "on"))
         ShowInChat = true;
     else
         ShowInChat = false;
     GetPrivateProfileString("Config","ShowInHUD","on",szTemp,MAX_STRING,INIFileName);
     if (!strcmp(szTemp, "on"))
         ShowInHUD = true;
     else
         ShowInHUD = false;
     GetPrivateProfileString("Config","CharNotesPosX",NULL,szTemp,MAX_STRING,INIFileName);
     CharNotesX = atoi(szTemp);
     GetPrivateProfileString("Config","CharNotesPosY",NULL,szTemp,MAX_STRING,INIFileName);
     CharNotesY = atoi(szTemp);
     GetPrivateProfileString("Config","MaxNotes",NULL,szTemp,MAX_STRING,INIFileName);
     MAX_NOTES = atoi(szTemp);
     
 }
 
 VOID DisplayCharNote(BOOL chat, CHAR szLine[MAX_STRING])
 {
     for (int i = 1; i <= MAX_NOTES; i++)
     {
         if ((!strcmp(szLine, CharNote.Name)) && (strcmp(CharNote.Note, "")))
         {
             sprintf(szTemp,"%s - %s", CharNote.Name, CharNote.Note);
             if (!chat)
             {
                 WriteChatColor(szTemp, CONCOLOR_YELLOW);
             } 
             else
             {
                 DrawHUDText(szTemp, CharNotesX,CharNotesY,0xFFFFFFFF);
             }
         }
     }
 }
 
 VOID DoCharNotePos(PSPAWNINFO pChar, PCHAR szLine)
 {
 char szArg1[MAX_STRING]={0};
 char szArg2[MAX_STRING]={0};
 
 GetArg(szArg1,szLine,1); 
 GetArg(szArg2,szLine,2); 
 
     if (strlen(szArg2))
     {
         WritePrivateProfileString("Config","CharNotesPosX",szArg1,INIFileName);
         WritePrivateProfileString("Config","CharNotesPosY",szArg2,INIFileName);
         CharNotesX = atoi(szArg1);
         CharNotesY = atoi(szArg2);
     }
     else
     {
         WriteChatColor("You must enter Xpos and Ypos in the format \"/charnotepos 500 200\"", CONCOLOR_YELLOW);
     }
 }
 
 
 VOID DoCharNote(PSPAWNINFO pChar, PCHAR szLine)
 {
 char CharType[MAX_STRING]={0};
 char CharName[MAX_STRING]={0};
 char NameArray[MAX_STRING];
 char NoteArray[MAX_STRING];
 
     if (CurNote >= MAX_NOTES)
     {
         sprintf(szTemp, "The maximum number of notes (%i) have been added.  Please increase MAX_NOTES to increase", MAX_NOTES);
         WriteChatColor(szTemp);
         return;
     }
     if (( pTarget && ppTarget )  && (strlen(szLine)))
     {
         psTarget = (PSPAWNINFO)pTarget;
         for (int i = 1; i <= CurNote; i++)
         {
             if (!strcmp(CharNote.Name, psTarget->DisplayedName))
             {
                 if (!strcmp(szLine, "-delete"))
                 {
                     strcpy(CharNote.Note,"");
                     WritePrivateProfileString("SPAWNS",NoteArray,CharNote.Note,INIFileName);
                     return;
                 }
 
                 strcpy(CharNote.Note,szLine);
                 WritePrivateProfileString("SPAWNS",NoteArray,CharNote.Note,INIFileName);
                 return;
             }
         }
         CurNote++;
         sprintf(NameArray, "Name%i",CurNote);
         sprintf(NoteArray, "Note%i",CurNote);
         strcpy(CharNote[CurNote].Name,psTarget->DisplayedName);
         strcpy(CharNote[CurNote].Note,szLine);
         WritePrivateProfileString("SPAWNS",NameArray,CharNote[CurNote].Name,INIFileName);
         WritePrivateProfileString("SPAWNS",NoteArray,CharNote[CurNote].Note,INIFileName);
         DisplayCharNote(CHAT, CharNote[CurNote].Name);
     }
     else
     {
         ShowHelp();
     }
 
 }
 
 
 PLUGIN_API VOID InitializePlugin(VOID)
 {
     DebugSpewAlways("Initializing MQ2CharNotes");
     AddCommand("/charnote",DoCharNote);
     AddCommand("/charnotepos",DoCharNotePos);
     LoadConfig();
     LoadINIArray();
 }
 
 PLUGIN_API VOID ShutdownPlugin(VOID)
 {
     DebugSpewAlways("Shutting down MQ2CharNotes");
     RemoveCommand("/charnote");
     RemoveCommand("/charnotepos");
     SaveINIArray();
 }
 
 PLUGIN_API VOID OnDrawHUD(VOID)
 {
     if (ShowInHUD)
     {
         if (pTarget && ppTarget) 
         {
             psTarget = (PSPAWNINFO)pTarget;
 //            if (psTarget->Type != SPAWN_CORPSE)
             DisplayCharNote(HUD, psTarget->DisplayedName);
         }
     }
 }
 
 
 PLUGIN_API VOID OnAddSpawn(PSPAWNINFO pNewSpawn)
 {
     if (ShowInChat)
     {
         if (pNewSpawn->Type != SPAWN_CORPSE)
         DisplayCharNote(CHAT, pNewSpawn->DisplayedName);
     }
 }
 
 PLUGIN_API VOID OnZoned(VOID)
 {
     SaveINIArray();
 }
 
 PLUGIN_API VOID SetGameState(DWORD GameState)
 {
     SaveINIArray();
 }
 



And here's the MQ2CharNotes.ini file.

Rich (BB code):
 [Config]
 CharNotesPosX=600
 CharNotesPosY=170
 ShowInChat=on
 ShowInHUD=on
 MaxNotes=200
 
 [SPAWNS]
 Name1=Psycotic
 Note1=This guy rocks!
 
Very kewlz. They should also do something like that for all boss mobs, so you would never have to go to alla again. So when you go to a mob youve never done before, and highlight it, and type /strat it would give you a run down on how much he hits for, effects, immune to ....ect. The coding for that would be insane tho.

Can this be used for items as well?
 
someoneorsomething said:
Very kewlz. They should also do something like that for all boss mobs, so you would never have to go to alla again. So when you go to a mob youve never done before, and highlight it, and type /strat it would give you a run down on how much he hits for, effects, immune to ....ect. The coding for that would be insane tho.

I don't think the coding would be that hard to do, but the INI file would be a pain to populate. That's not a bad idea though.. I'll play around with that thought.


someoneorsomething said:
Can this be used for items as well?

It doesn't process links right. It might need to send the info to and EQ window instead of the MQ window to process the link text.. I'll play around with it and see.. I just always hate sending things to the EQ window as it's logged and I would imagine, /snoop(able).
 
I like this. Especially if I could figure out how to use it. Of course that's totally non-reflective of your post, I'm just a noob who can't do shit herself.
 
MQ2CharNotes - This plugin lets you add a PC or NPC comment to a character. It will display the comments from the ini file when that mob/pc spawns or enters the zone. It will display the current targeted player or NPC comment in the HUD.

Commands:
/charnote - Currently targeted PC or NPC will have the comment assigned to them, and be displayed as requested
If the target is a corpse, it will assign the comment to the live PC or NPC it belongs to.
If the comment already exists, it will update it.

/charnote delete - Will delete the comment from the currently targeted PC or NPC. Currently will only 'clear' the comment and not actually remove the name from the INI file.

/charnotepos <x> <y> - Assigns the position of the comment in the HUD

Examples:
(With "a rabbit" currently targeted)
/charnote This guy's foot isn't so lucky anymore! - Would add the comment "This guy's foot isn't so lucky anymore!" to any "a rabbit" NPC's in zone.

(With "Bob" currently targeted)
/charnote This guy rocks! - Would add the comment "This guy rocks!" to PC Bobb
/charnote -delete - Would clear the comment from Bob, leaving Bob's INI entry
/charnotepos 200 500 - Would change the current HUD location of the comment to x200 y500

Rich (BB code):
INI File Config Settings
CharNotesPosX=200     
CharNotesPosY=170  
ShowInChat=on  
ShowInHUD=on 
MaxNotes=200

CharNotesPosX=200 - Current HUD X-Axis Location
CharNotesPosY=170 - Current HUD Y-Axis Location
ShowInChat=on - Toggle Showing Comments in Chat
ShowInHUD=on - Toggle Showing Comments on HUD
MaxNotes=200 - Maximum Number of Possible Comments
 
Plugin - MQ2CharNotes

Users who are viewing this thread

Back
Top