• 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

MQ2GiveNPC

randomguy_01

Well-known member
Joined
Jul 13, 2005
RedCents
54¢
here ya go. Open a "give" window to hand in shit from where ever in a zone.

Usage: /give - opens a 'give' window with a targeted npc.

Rich (BB code):
// MQ2GiveNPC.cpp : Defines the entry point for the DLL application.
// Author: randomguy_01

#include "../MQ2Plugin.h"

PreSetup("MQ2GiveNPC");

#define Address 0x5DF28A // for 6/08/2007 eqgame
#define Size 0x01
#define OP_GiveNPC 0x0000 // need to find this

DWORD address0 = Address;
DWORD length0 = Size;
DWORD oldperm=0, tmp;

// this packet structure may be outdated
typedef struct _GiveNPC {
	/*00*/ DWORD TargetID;
	/*04*/ DWORD MyID;
} GiveNPCPacket, *PGiveNPCPacket;

VOID GiveNPC(PSPAWNINFO pChar, PCHAR szLine)
{
	FlushInstructionCache(GetCurrentProcess(), (LPCVOID)address0, length0);
	VirtualProtectEx(GetCurrentProcess(), (LPVOID)address0, length0, PAGE_EXECUTE_READWRITE, &oldperm);
	WriteProcessMemory(GetCurrentProcess(), (LPVOID)address0, "\xEB", length0, NULL);
	VirtualProtectEx(GetCurrentProcess(), (LPVOID)address0, length0, oldperm, &tmp);
	PSPAWNINFO Target = (PSPAWNINFO)pTarget;
	// check for target
	if (!pTarget || !ppTarget) return;
	if (Target->Type != SPAWN_NPC) {
		MacroError("You must target an NPC to /give");
		return;
	}
	GiveNPCPacket Packet;
	Packet.TargetID = Target->SpawnID;
	Packet.MyID = pChar->SpawnID;
	SendEQMessage(OP_GiveNPC,&Packet,sizeof(Packet));
	//WriteChatf("Opening give window with \ay%s\ax", Target->DisplayedName);
}

VOID RemoveCrack(VOID)
{
	FlushInstructionCache(GetCurrentProcess(), (LPCVOID)address0, length0);
	VirtualProtectEx(GetCurrentProcess(), (LPVOID)address0, length0, PAGE_EXECUTE_READWRITE, &oldperm);
	WriteProcessMemory(GetCurrentProcess(), (LPVOID)address0, "\x7A", length0, NULL);
	VirtualProtectEx(GetCurrentProcess(), (LPVOID)address0, length0, oldperm, &tmp);
}

// Called once, when the plugin is to initialize
PLUGIN_API VOID InitializePlugin(VOID)
{
	AddCommand("/give",GiveNPC);
}

// Called once, when the plugin is to shutdown
PLUGIN_API VOID ShutdownPlugin(VOID)
{
	RemoveCommand("/give");
	RemoveCrack();
}
 
Last edited:
Can't get this to work. It doesn't do anything if the NPC is out of range.
 
Very nice,

Props also to Dirtynumbangel as well for helping create this..
Go You Two!
 
Devlin said:
Very nice,

Props also to Dirtynumbangel as well for helping create this..
Go You Two!

I just brought the
Rich (BB code):
#define Address 0x5BECEA
to the table. Random is the real talent here.

Good stuff Random. Red cent headed your way.

*Edit* I have to "spread the reputation around a bit"
So I'll have to toss you a red cent later ;)
 
Last edited:
So if the Ssru quest macro uses the MQ2Hail plugin which is basically using warp, would this plugin be better?

I have no clue if warping to a target is better or worse than turning things into an out of range npc, but it did get me thinking... :)

Keep up the great work guys!

-SimpleMynd
 
Not working for me, opens the window, but just returns the items to my cursor when i click trade.


=(
 
Any chance of getting the source for that? I like to compile my own. Not to mention learning.

--jimbo
 
Yea any chance that you could update it or atleast send source in PM so someone can update it that would be nice
 
Ok, newb question of the day. How "active" of a hack is this? I mean does this change offsets, or is this easily seen by other players if you are using it? The reason I ask is I would love to use this to turn in a demi-plane blocker so I don't have to gather a group and fight all the way to the turn-in mob, but I don't want to bring extra risk to my account over one turn-in. (yes I'm aware that using MQ is already a risk)
 
It probably works like any other hail plugin... you warp to the mob or something for a split second anyway.

For demi-plane turnins if you want any chance at a title later on you need to say some stuff to the guy. Maybe you should just wait til DP is empty and warp there to turn in and say the proper lines. Only one of them has agro in the immediate area, from what I remember.
 
Sum1 said:
It probably works like any other hail plugin... you warp to the mob or something for a split second anyway.

This plugin does not use the movement packet. The packet for Op_Trade, plus the define which I post every patch just about (#define Trade_NPC).
 
triba1fusion said:
Pretty sure its not safe to use, as it uses the movement packets.

No it does not

It uses WriteProcessMemory to modify a conditional jump inside the CGiveWnd::OnProcessFrame function, in effect bypassing the distance check in the function.

Next up we fake a packet saying we are trading with the NPC this in effect opens the give window up.
 
JCasper,
Could you clarify the following please?
JCasper said:
Next up we fake a packet saying we are trading with the NPC this in effect opens the give window up.
Faking a received packet or a sent packet? And is it not the case that all packet sending was obfuscated? I haven't had a chance to delve into that yet. :(

Thanks,

Jimbo
 
jimbo said:
JCasper,
Could you clarify the following please?
Faking a received packet or a sent packet? And is it not the case that all packet sending was obfuscated? I haven't had a chance to delve into that yet. :(

Thanks,

Jimbo

Sent.. and somewhat.. its not hard to figure out
 
Tried this the other day, it doesnt seem to work loaded plugin, targeted (npc banker in guild hall stood near guild banker) typed /give and nothing . did i do something wrong or is this just not working ?

Ty.
 
Any plugin that sends a packet will not work. This plugin sends a movement packet to "position" your character near the turn in mob, therefore it will not do anything because you are out of range to hand in the item.
 
This plugin actually doesn't send a movepkt. The reason that it doesn't work is that the function that it tries to use to send the packet to open the trade window doesn't exist in the code anymore. It tried to use send_packet, but that isn't in MQ2 as of the 4/20 patch.
 
Btw, thanks for the negative redcent whoever gave it to me, "for thinking he knows how sh** works when he does not." Thats real professional, and for all I know (since this plugin is not open source), it could send a movement packet, then send a trade request packet, then another movement packet. So if it doesnt send a movement packet, are you telling me that the server allows a trade to open across an entire zone without checking distances? Either way, as stated in a previous post I no longer play EQ and purely check these forums to learn and help where I can.
 
It's a reasonable assumption.

I actually thought, when you said that, that you were right...it certainly makes sense, since all of the other plugins that let you do things from a distance involve movepkt. Wasn't until I looked at the source again that I was corrected.
 
Source posted on the first post of this thread. I am not updating this plugin but I am posting my last working version (in source code form) from 3/15/2007. The opcode for initiating a "give" needs to be updated. The packet structure may or may not have to be changed (I have no idea).

Have a blast.
 
MQ2GiveNPC

Users who are viewing this thread

Back
Top
Cart