• 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

MQ2PlaceItem

randomguy_01

Well-known member
Joined
Jul 13, 2005
RedCents
54¢
Not sure what this can be used for, I was bored.
/placeitem y x z to throw the item on your cursor to a location you specify. For those who get excited, this does NOT work on NOTRADE items. ;)

Rich (BB code):
// MQ2PlaceItem
// allows you to drop an item on a certain Y,X,Z location
// syntax: /placeitem y x z
// randomguy_01

#include "../MQ2Plugin.h"

#ifdef PKT_UPDATE_POSITION
#undef PKT_UPDATE_POSITION
#endif

#define PKT_UPDATE_POSITION  0x14CB
#define PKT_DROP_ITEM		 0x3BC2

PreSetup("MQ2PlaceItem");

VOID PlaceCmd(PSPAWNINFO pChar, PCHAR szLine)
{
	float y, x, z;
	char szBuf[MAX_STRING] = {0};
	char szMsg[MAX_STRING] = {0};
	GetArg(szBuf, szLine, 1);
	y = (float)atof(szBuf);
	GetArg(szBuf, szLine, 2);
	x = (float)atof(szBuf);
	GetArg(szBuf, szLine, 3);
	z = (float)atof(szBuf);
	

	// check for item on cursor
	PCONTENTS pCursor = GetCharInfo2()->Cursor;
	if (!pCursor) {
		WriteChatf("You must have an item on your cursor.");
		return;
	}
	if (szBuf[0] == 0) {
		WriteChatf("You must specify a location");
		return;
	}

	struct _MOVEPKT {
		 /*0000*/ unsigned short SpawnID;
		 /*0002*/ unsigned short TimeStamp;
		 /*0004*/ float Y;
		 /*0008*/ float DeltaZ;
		 /*0012*/ float DeltaY;
		 /*0016*/ float DeltaX;
		 /*0020*/ int Animation:10;
		 /*0020*/ int DeltaHeading:10;
		 /*0020*/ int padding0020:12;
		 /*0024*/ float X;
		 /*0028*/ float Z;
		 /*0032*/ int Heading:12;
		 /*0032*/ int padding1_0032:10;
		 /*0032*/ int padding2_0032:10;
	} P;

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

	// jump to
	P.Z = z;
	P.Y = y;
	P.X = x;
	SendEQMessage(PKT_UPDATE_POSITION, &P, sizeof(P));

	// drop
	SendEQMessage(PKT_DROP_ITEM, "", 0);
	DoCommand(pChar->pSpawn,"/drop");

	// jump back
	P.Z = pChar->Z;
	P.Y = pChar->Y;
	P.X = pChar->X;
	SendEQMessage(PKT_UPDATE_POSITION, &P, sizeof(P));
	
	sprintf(szMsg,"Attempting to drop %s at location %3.2f, %3.2f, %3.2f",pCursor->Item->Name, y, x, z);
	WriteChatColor(szMsg);
}

PLUGIN_API VOID InitializePlugin(VOID)
{
	AddCommand("/placeitem", PlaceCmd);
}

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

:eek:
 
Last edited:
ok, question for me would be....
Can you throw this "item" to any point in the zone?
If so, seems like a usefull way to transfer items to toons cross the zone if you ever needed to like potions, etc...
 
all this does is warp to loc, drop item on the group, warp back
 
Thanks Odessa,

Was thinking it would be nice for Macs that had turn-ins so you didn't have to warp.

Scratch that idea.
 
MQ2PlaceItem

Users who are viewing this thread

Back
Top
Cart