randomguy_01
Well-known member
- Joined
- Jul 13, 2005
- RedCents
- 54¢
Updated 7/19/06
Might compile it later today.
I got the idea to write this from the Vish macro that was posted recently by everdead.
Basically, this 'warps' you to the mournful spirit (if one is up) and says 'shoulder my burden' to cure you of the DT ae, similar to what /zone does with translocators.
I haven't gotten a chance yet to test it (maybe later tonight), but it should in theory work. If you get a chance to test it before me and it works/doesn't work- please post.
Might compile it later today.
I got the idea to write this from the Vish macro that was posted recently by everdead.
Basically, this 'warps' you to the mournful spirit (if one is up) and says 'shoulder my burden' to cure you of the DT ae, similar to what /zone does with translocators.
I haven't gotten a chance yet to test it (maybe later tonight), but it should in theory work. If you get a chance to test it before me and it works/doesn't work- please post.

Rich (BB code):
// MQ2Vish.cpp : This plugin automatically cures the Vish Death-touch ae
// by moving you to the NPC that cures it and saying the expression
// 'shoulder my burden'
// This will NOT work if there are no curing NPC's (mournful spirits) up
// Author: randomguy_01, an idea based off a macro by everdead
// ************************************************** ********************
// Syntax:
// /vish - Enables/Disables the automatic curing
#include "../MQ2Plugin.h"
PreSetup("MQ2Vish");
PLUGIN_VERSION(1.0);
#ifdef PKT_UPDATE_POSITION
#undef PKT_UPDATE_POSITION
#endif
#define PKT_UPDATE_POSITION 0x178A
#define PKT_CHANNEL_MESSAGE 0x0B5A
DWORD OverlayColor = CONCOLOR_RED; // can modify this
DWORD OverlayHold = 6000; // in milliseconds
bool bVish = false;
VOID VishCmd(PSPAWNINFO pChar);
CHAR szTriggerMsg[MAX_STRING] = {0};
struct _MOVEPKT {
unsigned short SpawnID;
unsigned short TimeStamp;
unsigned Heading:12;
unsigned padding0004:20;
float DeltaY;
int Animation:10;
unsigned Padding0012:22;
float DeltaX;
float Y;
int DeltaHeading:10;
int Padding0024:6;
int unknown0026:2;
float DeltaZ;
float Z;
float X;
} MovePkt;
struct _MSGPACKET {
/*0000*/ char target[64];
/*0064*/ char sender[64];
/*0128*/ unsigned int language;
/*0132*/ unsigned int channel;
/*0136*/ char padding136[8];
/*0144*/ unsigned int languageskill;
/*0148*/ char message[100];
} MsgPkt;
VOID VishCmd(PSPAWNINFO pChar, PCHAR szLine)
{
if(bVish) {
WriteChatColor("No longer curing Creeping Doom",CONCOLOR_RED);
bVish = false;
}
else {
WriteChatColor("Automatically curing Creeping Doom",CONCOLOR_GREEN);
bVish = true;
}
}
PLUGIN_API DWORD OnWriteChatColor(PCHAR Line, DWORD Color, DWORD Filter)
{
DebugSpewAlways("MQ2Vish::OnWriteChatColor(%s)",Line);
if(bVish)
{
if (strstr(Line, " sense your doom "))
{
PSPAWNINFO pChar = GetCharInfo()->pSpawn;
ZeroMemory(&MovePkt, sizeof(MovePkt));
ZeroMemory(&MsgPkt, sizeof(MsgPkt));
MovePkt.SpawnID = (unsigned short)pChar->SpawnID;
MovePkt.Heading = (unsigned int)(pChar->Heading * 4);
// clear target
pTarget = NULL;
PSPAWNINFO psTarget = NULL;
// /squelch won't show MQ2 default /target faulure.
DoCommand(pChar->pSpawn,"/squelch /target mournful npc");
if (ppTarget && pTarget) {
psTarget = (PSPAWNINFO)pTarget;
}
if (!psTarget)
{
WriteChatf("You have been hit with Creeping Doom!");
MacroError("There are no mournful spirits up.");
DisplayOverlayText("NO MOURNFUL SPIRITS UP!",OverlayColor,100,500,500,OverlayHold);
return 0;
}
WriteChatf("You have been hit with Creeping Doom!");
sprintf(szTriggerMsg,"Using %s to shoulder your burden!",psTarget->DisplayedName);
DisplayOverlayText(szTriggerMsg,OverlayColor,100,500,500,OverlayHold);
strcpy(MsgPkt.target,psTarget->Name);
strcpy(MsgPkt.sender,pChar->Name);
MsgPkt.channel=8;
MsgPkt.languageskill=100;
MovePkt.Z = psTarget->Z;
MovePkt.Y = psTarget->Y;
MovePkt.X = psTarget->X;
SendEQMessage(PKT_UPDATE_POSITION, &MovePkt, sizeof(MovePkt));
sprintf(MsgPkt.message,"shoulder my burden");
SendEQMessage(PKT_CHANNEL_MESSAGE,&MsgPkt,sizeof(MsgPkt));
WriteChatf("Using %s at %3.2f, %3.2f, %3.2f to shoulder your burden.",psTarget->Name,psTarget->Y,psTarget->X,psTarget->Z);
}
}
return 0;
}
PLUGIN_API VOID InitializePlugin(VOID)
{
AddCommand("/vish",VishCmd);
}
PLUGIN_API VOID ShutdownPlugin(VOID)
{
RemoveCommand("/vish");
}
Last edited:

