Plugin: MQ2Vish

randomguy_01

New member
Joined
Apr 1, 2006
Messages
6
Reaction score
0
Points
0
I originally posted this on RedGuides.com but I wanted to post it here cause it didn't get too much attention (and I also want free access :D)

This plugin will cure the DT that Vish casts (Creeping Doom). It works pretty much like MQ2Zone with Translocators but instead says "shoulder my burden" instead of a zone name.

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 0x3813
#define PKT_CHANNEL_MESSAGE 0x2C2D

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 {
    /*0000*/ unsigned short SpawnID;
    /*0002*/ unsigned short TimeStamp;
    /*0004*/ int DeltaHeading:16;
    /*0006*/ int padding0020:16;
    /*0008*/ float DeltaZ;
    /*0012*/ float Y;
    /*0016*/ int Animation:16;
    /*0018*/ int Heading:16;
    /*0020*/ float X;
    /*0024*/ float DeltaY;
    /*0028*/ float DeltaX;
    /*0032*/ float Z;
} 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"); }
 

Attachments

  • MQ2Vish.dll
    84.1 KB · Views: 28
Last edited by a moderator:
[Bonzai] 2:47 pm: i wish i could give that to 53 other fuckers in my guild

LOL

From what I understand this plugin works like MQ2Hail. It throws your voice to mournful spirits and gets you cured.

Fry.
 
Compiled version for all you without a compiler.. Nice work Randomguy!
 

Attachments

  • MQ2Vish.dll
    84 KB · Views: 30
Ok so this is a plugin you run during Vish.

If when you get DT inc message and no spirits are up will it keep trying to find them or do you go manual mode after first try?
 
Mq2CureVish

We decided to update this plugin. We made a check for the buff "Creeping Doom" by SpellID (0x6646), and not emote. Of course if there are no mournful spirits up it will not work, and you will die.


But I have tested this by changing below to target a quest mob and say a trigger phrase when a certain spell hits and it worked:
Code:
#define VishDTSpellID 0x6646 // Spell ID # for Creeping Doom
#define CureMob "Mournful Spirit"
#define CurePhrase "shoulder my burden"


mq2curevish.cpp:

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
// **********************************************************************
// Changed the way it triggers. Now will check Buff slots and if it sees
// Creeping Doom (SpellID 0x6646) it will warp you quickly to mournful
// spirit and say "shoulder my burden" then move you back -- much like
// mq2hail, or saytarget. 
//
// modified by Psycotic and wickedmofo/czarman
//
// Syntax:
// /curevish - Enables/Disables the automatic curing

#include "../MQ2Plugin.h"

PreSetup("MQ2Vish");
PLUGIN_VERSION(1.0);

#ifdef PKT_UPDATE_POSITION
#undef PKT_UPDATE_POSITION
#endif

#ifdef PKT_CHANNEL_MESSAGE
#undef PKT_CHANNEL_MESSAGE
#endif


#define PKT_UPDATE_POSITION						0x178a // 6-13-06
#define PKT_CHANNEL_MESSAGE						0x0b5a // 6-13-06

#define VishDTSpellID 0x6646 // Spell ID # for Creeping Doom
#define CureMob "Mournful Spirit"
#define CurePhrase "shoulder my burden"

typedef struct _MSGPACKET {
/*0000*/ char target[64];
/*0064*/ char sender[64];
/*0128*/ unsigned int language;
/*0132*/ unsigned int channel;
/*0136*/ char padding136[8]; //0x01
/*0144*/ unsigned int languageskill;
/*0148*/ char message[100];
} MsgPacket, *pMsgPacket;

MsgPacket M;

typedef struct _MOVEPACKET {
/*0000*/ unsigned short SpawnID;
/*0002*/ unsigned short TimeStamp;
/*0004*/ int Heading:16;
/*0006*/ int unknown1:16;    
/*0008*/ float DeltaZ;   
/*000c*/ int Animation:16;
/*000e*/ int padding014:16;  
/*0010*/ int DeltaHeading:16; 
/*0012*/ int unknown2:16;   
/*0014*/ float Y;
/*0018*/ float DeltaY;       
/*001c*/ float DeltaX; 
/*0020*/ float Z;
/*0024*/ float X;
} MovePacket, *pMovePacket; // 40 Bytes

MovePacket P;

bool ToggleCureVish=false;
bool SentMessage = false;

VOID CureVish(PSPAWNINFO pChar, PCHAR szLine)
{
	ToggleCureVish=!ToggleCureVish;
	WriteChatf("Auto-Curing Vish Creeping Doom is %s",ToggleCureVish?"ON":"OFF");
}

PLUGIN_API VOID OnPulse(VOID)
{
	if (ToggleCureVish)
	{
		int i;
		PSPAWNINFO pChar = GetCharInfo()->pSpawn;
		PCHARINFO2 pChar2 = GetCharInfo2();		
		for (i = 1; i < 21; i++)
		{
			if (pChar2->Buff[i].SpellID == VishDTSpellID)  //If this is VISH DT 
			{
				Target(pChar,CureMob);
					if (!pTarget || !ppTarget) return;

	PSPAWNINFO Target = (PSPAWNINFO)pTarget;
	if (Target->Type != SPAWN_NPC) return;

	// init packets
	ZeroMemory(&P, sizeof(P));
	ZeroMemory(&M, sizeof(M));
	P.SpawnID = (unsigned short)pChar->SpawnID;
	P.Heading = (unsigned int)(pChar->Heading * 4);

	strcpy(M.target,Target->Name);

	strcpy(M.sender,pChar->Name);
	M.channel=8;
	M.languageskill=100;

	// jump to
	P.Z = Target->Z;
	P.Y = Target->Y;
	P.X = Target->X;
	SendEQMessage(PKT_UPDATE_POSITION, &P, sizeof(P));

	sprintf(M.message,CurePhrase);
	SendEQMessage(PKT_CHANNEL_MESSAGE,&M,sizeof(M));
			}
		}
	}
}

PLUGIN_API VOID InitializePlugin(VOID)
{
	AddCommand("/curevish",CureVish);
}

PLUGIN_API VOID ShutdownPlugin(VOID)
{
	RemoveCommand("/curevish");
}

	
PLUGIN_API VOID OnAddSpawn(PSPAWNINFO pNewSpawn)
{
	DebugSpewAlways("MQ2Vish::OnAddSpawn(%s)",pNewSpawn->Name);
}
 
Ok i am dumb i downloaded it and i still dont know how to get it to work please help me i am still trying to learn how to do all this stuff
 
Cripto said:
Ok i am dumb i downloaded it and i still dont know how to get it to work please help me i am still trying to learn how to do all this stuff
/plugin mq2vish ingame, there ya go :)
 
WOW nice, would be nice to see something like this for AMV or Bloodeye DT

cast RGC or click a potion maybe, Fear shield?
 
gladimus said:
WOW nice, would be nice to see something like this for AMV or Bloodeye DT

cast RGC or click a potion maybe, Fear shield?

STILL not sure this works 100%. Has anyone tested this? I tried last week but I NEVER got the DT so couldn't test it. I guess Friday we go again, and maybe then :p
 
tried it last night but got no DT on my boxed cleric.
 
Tried it the other night and it did not seem to work. Got the DT waited like 10 seconds for it to do something saw that there were like 3 mournful spirits up close by and finally just hit my hotkey /target mournful, /saytarget shoulder my burden. Guess I am just going to leave it at that. Seems to work best. Just audio trigger the sense your doom and hit a hot key, cause this just is not work the way it is. Not even targeting the mob, and they are up. Maybe the way it checks for Doom is not right? I'd swear 6646 is the spell #.
 
Psycotic said:
According to Lucy, 6646 is Creeping Doom. Is that the right spell? 120 drop in all stats?

Yeah that is Correct. Hmm, wonder why it is not working then. Just seems like it does not /target the mournful at all when they are up, and you have the DT (6646).
 
I haven't tried myself cause I'm a cleric and i just DA myself, but I believe the spirits are hard to target by name, I think you have to type /target a_mournful

Even though, a_ isn't in their visible name, that's what ppl have been saying to type. Don't know if that helps you.
 
Booges said:
I haven't tried myself cause I'm a cleric and i just DA myself, but I believe the spirits are hard to target by name, I think you have to type /target a_mournful

Even though, a_ isn't in their visible name, that's what ppl have been saying to type. Don't know if that helps you.

Just did Vish the other day, so I will give it a shot again next week. I always thought that even thought a mob has a name like "a stupid dumb ass mob" if you went /target dumb it would still target it? But I will try what you suggested. I do have a hotkey however that has /target mournful and that works fine.
 
we supposed to do vish again tonight will trey and check it out. Guild don\'t like mqer\'s though so will have to be sneaky..
 
dust said:
we supposed to do vish again tonight will trey and check it out. Guild don\'t like mqer\'s though so will have to be sneaky..

It really does NOT work right. I would just set up the audio trigger for "you sense your doom approaching", and hot key in the /target a_mournful_spirit, and /saytarget shoulder my burden. If your guild frowns upon MQ, I would be careful then.
 
Code:
#define VishDTSpellID 0x6646 // Spell ID # for Creeping Doom

should be this as the SpellID is base 10 not base 16.

Code:
#define VishDTSpellID 6646 // Spell ID # for Creeping Doom
 
Actually I don't think this is the problem. Tested this with my Necro in Nedaria and used these as settings:

Code:
#define VishDTSpellID 0x457 // Spell ID # for Dead man Floating
#define CureMob "Eldros Danmor"
#define CurePhrase "interested in visiting"

Soon as I casted DMF on myself it triggered. So perhaps we should be looking for spellID 6647 -- the trigger effect?

OR maybe the buffslots are wrong? But it can't be if it worked for me using DMF fine. So going to try :

Code:
if ((pChar2->Buff[i].SpellID == VishDTSpellID) || (pChar2->Buff[i].SpellID == VishDTSpellID2)) //If this is VISH DT or Trigger

See what difference this makes. Also might do the same thing with targetmob, try a_mournful_spirit, etc
 
Lol ok last night I think this program fucked me up and tried to say the phrase to VISH like a zillion time when I had the DoT, and it said in MQ window that there was no a_mournful_spirit up, and I had to manual target mournful, and hit say the phrase. SO. I think it needs to CLEAR the target ID FIRST, so at least you are not /saytarget to VISH like it did last night. After last night though I am gonna do it manually for a bit, as a few ppl were like WTF was I doing saying the phrase to Vish like that.