• 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¢
This is for the 2/23/2006 patch.

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"

PLUGIN_VERSION(1.1);

#ifdef PKT_UPDATE_POSITION
#undef PKT_UPDATE_POSITION
#endif

#define PKT_UPDATE_POSITION  0x7B59
#define PKT_DROP_ITEM		 0x7668

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*/ 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;
	} 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");
}
 
As I posted this earlier when i originally wrote it- I don't know of anything too useful for this to be used for. I pretty much wrote this because I was bored.
 
i have a newbie question. plugins like this, and others such as mq2gank or mq2csum... do these warp your character to the position similar to mq2hail, or does it actually perform the placement of the item, or the corpse summon from where you stand? im a very conservative MQ2 user and i avoid using warp or zone commands, as a matter of fact those plugins are usually not loaded.

thank you!
 
ncccippy said:
i have a newbie question. plugins like this, and others such as mq2gank or mq2csum... do these warp your character to the position similar to mq2hail, or does it actually perform the placement of the item, or the corpse summon from where you stand? im a very conservative MQ2 user and i avoid using warp or zone commands, as a matter of fact those plugins are usually not loaded.

thank you!

they all warp.
 
Just a thought, but wouldnt this be handy to use in a macro for placing the new traps and oh what are those healing things called again...
 
MQ2PlaceItem

Users who are viewing this thread

Back
Top
Cart