• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

MQ2WorkingAssist

TeachersPet

Well-known member
Joined
Jul 27, 2005
RedCents
71¢
TurkReno's Assist had problems so I made this one. It also does a distance check so if you're within range of doing an assist it doesn't warp you. Let me know if you have any problems.

Minor Update (10 minutes after initial post)
- There is no need to use a structure for OP_Assist, thank you to randomguy_01 for pointing that out ^_^

Rich (BB code):
/*
	MQ2WorkingAssist
	By: TeachersPet

	This removes distance restrictions on /assist by moving you
	to 10,000 units below your target and back to your previous
	location as soon as assist has fired.

	I'd like to thank those who made this possible,
	- Abyss for his MovePkt structure
	- TurkReno for making a non-working version of this
	- Whoever made the Assist structure in TurkReno's version
	- The Lord Our God
	- My Agent
	- The Staff at Gold's Gym in West Hollywood
	- Calvin Klein
	- Whoever invented Astroglide
	- Oh yeah, that guy Pythagorus for right triangle functions
*/

#include "../MQ2Plugin.h"
#include <math.h>
 
PreSetup("MQ2WorkingAssist");

// ******************** Packet Defines ********************

#ifdef PKT_UPDATE_POSITION 
#undef PKT_UPDATE_POSITION 
#endif

#define PKT_UPDATE_POSITION 0x178A // 06-16-06
#define OP_ASSIST 0x1C3C // 06-16-06

// Abyss's MOVEPKT structure
// (Because I'm too lazy to make one myself)
typedef 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;

// ********************* End Defines **********************

VOID PacketMoveLoc(float Y, float X, float Z) {
	MovePkt Move;

	Move.SpawnID = (unsigned short)GetCharInfo()->pSpawn->SpawnID; 
	Move.Heading = (unsigned int)(GetCharInfo()->pSpawn->Heading * 4); 

	Move.Y = Y;
	Move.X = X;
	Move.Z = Z;

	SendEQMessage(PKT_UPDATE_POSITION, &Move, sizeof(Move));
}

float oldY;
float oldX;
float oldZ;

bool WaitAssist = false;

VOID AssistTarget(PSPAWNINFO pChar, PCHAR szLine) {	
	char szOutput[MAX_STRING] = {0};

	if(szLine[1]) {
		pTarget = NULL;
		Target(GetCharInfo()->pSpawn,szLine);
	}

	PSPAWNINFO Targ = (PSPAWNINFO)pTarget;

	if(Targ) {
		sprintf(szOutput,"Assisting %s",Targ->Name);
		WriteChatColor(szOutput,USERCOLOR_DEFAULT);

		pTarget = NULL;

		// Tells OnPulse you're waiting for assist to fire

		// Check if out of range of assisting
		float myY = GetCharInfo()->pSpawn->Y;
		float myX = GetCharInfo()->pSpawn->X;
		float myZ = GetCharInfo()->pSpawn->Z;

		float dist;
		dist = sqrt(pow(sqrt(pow((myX - Targ->X),2) + pow((myY - Targ->Y),2)),2) + pow((myZ - Targ->Z),2));

		if(dist > 200) {
			// Save Old Locations
			oldY = myY;
			oldX = myX;
			oldZ = myZ;

			PacketMoveLoc(Targ->Y,Targ->X,(Targ->Z) - 25);

			WaitAssist = true;
		}

		SendEQMessage(OP_ASSIST, &Targ->SpawnID, 4);
	}
}

int WaitAssistCount = 0;
PLUGIN_API VOID OnPulse(VOID) {
	if(WaitAssist) {
		PSPAWNINFO Target = (PSPAWNINFO)pTarget;
		if(Target) {
			PacketMoveLoc(oldY,oldX,oldZ);
			WaitAssist = false;
			WaitAssistCount = 0;
		}
		WaitAssistCount++;
		if(WaitAssistCount >= 1000) {
			WaitAssistCount = 0;
			WaitAssist = false;
		}
	}
}

PLUGIN_API VOID InitializePlugin(VOID) {
	AddCommand("/assist",AssistTarget);
}

PLUGIN_API VOID ShutdownPlugin(VOID) {
	RemoveCommand("/assist");
}
 
Last edited:
TeachersPet said:
Rich (BB code):
	I'd like to thank those who made this possible,
	- Abyss for his MovePkt structure
	- TurkReno for making a non-working version of this
	- Whoever made the Assist structure in TurkReno's version
	- The Lord Our God
	- My Agent
	- The Staff at Gold's Gym in West Hollywood
	- Calvin Klein
	- Whoever invented Astroglide
	- Oh yeah, that guy Pythagorus for right triangle functions

hahaha thats great.
 
So by using this plugin, you can assist the MA from any distance?

Or does it actually continuously move you to assist distance during a fight?
 
If the MA is not in your group, you should /con him before using this to force the server to send you an update on his current position. Otherwise, you might try to assist from where your client THINKS he is... which might or might not be near where he ACTUALLY is.
 
So I should just /consider an NPC before warping to it and it will update my clients location of it?
 
Yup. Group members are updated to your client every tick regardless, but other pc's and npcs beyond a certain radius only get updated to you periodically. npc's beyond a certain radius get updated every few ticks (but with enough lag that a lot of pullers know the trick to /con before pulling just to make sure the mob is where you think it is... and pcs beyond a certain radius might not get updated to you at all unless you /con them. That's why if you're looking at a map and see a non-grouped pc running away from you, you'll see them seem to stop about 600 feet away and then next thing you know they've zoned out at the zone line far across the zone (without warping).
 
And that's the only thing that really distinguishes the difference between mine and yours, according to JoeK.
 
Both are good, only thing I don't like about yours TP is when you assist someone and they have no target it untargets who you were assisting. Meaning you have to retarget them to assist again. So for now i'm still using turk's :)

Mean no disrespect at all btw, sure it's great plugin, just won't use for that reason alone.
 
MQ2WorkingAssist

Users who are viewing this thread

Back
Top
Cart