Was trying to create my own raid dump plugin, all in all im pretty sure it would work, however my C++ program is a lil out of date and I cant finish this up, to confirm that its working or even use it at this minute, posting from work. obviously currently its a modified code. If anyone could scan it, and or change it to a dll for me, I would greatly apretiate it... I wouldnt fully expect you also to test it. Any help, would be greatly apretiated.
Code:
/*
MQ2RaidDumpDKP
*/
#include "../MQ2Plugin.h"
VOID LogDKP(PSPAWNINFO pChar, PCHAR szLine);
VOID LogDKPStop(PSPAWNINFO pChar, PCHAR szLine);
VOID LogDKPForce(PSPAWNINFO pChar, PCHAR szLine);
VOID GetDKP(PSPAWNINFO pChar);
PreSetup("MQ2LogDKP");
#define LOGINTERVAL 1800000 // 30 minute delay
DWORD PulseTime=0;
bool MQ2LogDKPEnabled=false;
PLUGIN_API VOID InitializePlugin(VOID)
{
AddCommand("/startdkp", LogDKP);
AddCommand("/stopdkp", LogDKPStop);
if(gbInZone && GetCharInfo() && GetCharInfo()->pSpawn){
WriteChatColor("MQ2WatchersLogDKP Loaded Successfully.",CONCOLOR_GREEN);
}
}
PLUGIN_API VOID ShutdownPlugin(VOID)
{
RemoveCommand("/startdkp");
RemoveCommand("/stopdkp");
}
PLUGIN_API VOID OnPulse(VOID)
{
if(MQ2LogDKPEnabled && gbInZone && GetCharInfo() && GetCharInfo()->pSpawn && (DWORD)clock()>PulseTime){
GetDKP(GetCharInfo()->pSpawn);
}
}
PLUGIN_API VOID OnZoned(VOID)
{
if(MQ2LogDKPEnabled && gbInZone && GetCharInfo() && GetCharInfo()->pSpawn){
GetDKP(GetCharInfo()->pSpawn);
}
}
VOID LogDKP(PSPAWNINFO pChar, PCHAR szLine)
{
if (MQ2LogDKPEnabled && gbInZone && GetCharInfo() && GetCharInfo()->pSpawn) {
return;
}
if (!MQ2LogDKPEnabled && gbInZone && GetCharInfo() && GetCharInfo()->pSpawn) {
if (MQ2Globals::gGameState==GAMESTATE_INGAME) {
DoCommand(pChar, "/outputfile raid");
MQ2LogDKPEnabled=true;
WriteChatColor("Automatic DKP Raid Dump Enabled",CONCOLOR_GREEN);
GetDKP(GetCharInfo()->pSpawn);
} else {
MQ2LogDKPEnabled=false;
}
}
}
VOID LogDKPStop(PSPAWNINFO pChar, PCHAR szLine)
{
if (!MQ2LogDKPEnabled && gbInZone && GetCharInfo() && GetCharInfo()->pSpawn) {
return;
}
if (MQ2LogDKPEnabled && gbInZone && GetCharInfo() && GetCharInfo()->pSpawn) {
DoCommand(pChar, "/outputfile raid");
MQ2LogDKPEnabled=false;
WriteChatColor("Automatic DKP Raid Dump Disabled",CONCOLOR_RED);
}
}
VOID GetDKP(PSPAWNINFO pSpawn)
{
//Change/Add/Delete these entries to meet your channel needs.
DoCommand(pSpawn, "/fake /rs [[ RAID DUMP ]] Taken NOW!");
DoCommand(pSpawn, "/outputfile raid");
DoCommand(pSpawn, "/fake /gu [[ RAID DUMP ]] was just taken, if you were not in raid, you missed it.");
DoCommand(pSpawn, "/pause 5");
DoCommand(pSpawn, "/fake /rs [[ Your Raid Attendance just got better. (+1) ]] ");
DoCommand(pSpawn, "/echo [${Time}] # Updating Raid Dump for DKP.");
PulseTime=(DWORD)clock()+LOGINTERVAL;
}