• Hail, we're RedGuides. We want you to play six (yes, 6!) EverQuest characters at once. We have scripts and a friendly community to help, please join our playstyle and say hello! 👋
  • We've added LLM sections to our Terms & Rules and Resource Rules, for everyone's sanity & in-game safety.
    Read more
    a. Do not replace your voice with an LLM. This goes for your posts and your scripts. Drafting and editing with a tool is fine, but don't take you out of what you share.
    b. Do not replace your EQ character's voice with an LLM. We don't want scripts that speak over /ooc, /shout or other public channels. This has been an unwritten rule that's kept casino scripts off the site for decades, but we're now compelled to make it clear: keep automated communication private.

    Why Does RG Review Scripts?
    Nearly every LLM-written Lua script we see is making your character do impossible things, and rarely in a way that's beneficial to you. We've seen heavy server hammering, /target over impossible distances when /nav spawn would passively accomplish the same thing, a spawn search that fires 20+ times per second, and other pointless actions that are likely annoying GMs.

    You are welcome to use LLMs as a tool to structure, draft, and edit your work, but please read critically before hitting /lua run

MQ2HideDoors (1 Viewer)

I'm going to make a newbie guide for updating that offset so I feel useful again :)

I also put your code in the main post cronic since it's much better than mine heh
 
This depends on which version of this plugin you are using...

For the one on the first page this offset is untested (pain in the ass to find):
Rich (BB code):
0x45F738

For the revised version of cronic's MQ2Doors also untested:
Rich (BB code):
#define EQSwitch__ChangeState     0x482966
 
Last edited:
I hate to sound like a complete newbie, mostly because it shows my true colors ;) but where do ou put these "custom" defines in? I assume it's a custom since I tried to search in the MQ2Main folder and didn't find any entry at all.
Same goes for the offset defines for other plugins such as MQ2Size and whatnot :)
 
In the plugin where it defines what is listed...usually with a giant
#define Offsetname 0x273226127275273574638576954365385635354564523
 
Mochila said:
In the plugin where it defines what is listed...usually with a giant
#define Offsetname 0x273226127275273574638576954365385635354564523
In the plugins .cpp itself? Ie: MQ2Doors.cpp? Cause I can't find it there..
I was thinking eqgame.h, since there's a ton of other defines in there, but I'm not certain :(
 
Rich (BB code):
__declspec(naked) void CDoorHelper::ProcMsg(void*, int, void*, int)
{
	__asm{mov eax, 0x45C0B1};
	__asm{jmp eax};
}

That's where it is (without the updated offset)

Randomguy, can you confirm that's the right offset?
 
TP change the source on the first page to what cronic posted second, just remove the first source alltogether
 
TeachersPet said:
Rich (BB code):
__declspec(naked) void CDoorHelper::ProcMsg(void*, int, void*, int)
{
	__asm{mov eax, 0x45C0B1};
	__asm{jmp eax};
}

That's where it is (without the updated offset)

Randomguy, can you confirm that's the right offset?

It should be the right offset, it was a bitch to find but it looked good. The second one is confirmed to be the right one for the revised source (two different functions).
 
I'll put together randomguy's good toggling and cronic's function in a few.

Update: Done
 
Last edited:
This should be on the first page as an alternative to TP's code.

12-11-05: Working for the 12-07 patch, weird toggle bug fixed.

Rich (BB code):
// MQ2Doors.cpp : Defines the entry point for the DLL application.
// MQ2Doors by cronic, uber leet toggle by randomguy_01

#include "../MQ2Plugin.h"

PreSetup("MQ2Doors");

#define EQSwitch__ChangeState 0x482966

#ifdef EQSwitch__ChangeState
FUNCTION_AT_ADDRESS(void EQSwitch::ChangeState(unsigned char, class EQPlayer *, bool), EQSwitch__ChangeState);
#endif

bool gHidden = false;
BOOL gHideAlways = false;

bool ModDoors(float fMod)
{
	if (!pSwitchMgr || gGameState != GAMESTATE_INGAME) return false;

	for (unsigned int i = 0; i < ((PDOORTABLE)pSwitchMgr)->NumEntries; i++) 
	{
		PDOOR pDoor = ((PDOORTABLE)pSwitchMgr)->pDoor;
		pDoor->DefaultZ += fMod;
		pDoor->Z += fMod;

		((EQSwitch*)pDoor)->ChangeState(3, 0, 0);
	}

	return true;
}

void HideDoors()
{
	if (gHidden || !ModDoors(-1000000.00f)) return;
	gHidden = true;
}

void RevealDoors()
{
	if (!gHidden || !ModDoors(1000000.00f)) return;
	gHidden = false;
}


void DoorHelp()
{
	WriteChatColor("Hide Door Help:");
	WriteChatColor("/toggledoors on - Hide the doors in your current zone.");
	WriteChatColor("/toggledoors off - Shows all doors and disables the always feature");
	WriteChatColor("/toggledoors always - Hides all doors where ever you zone");
}


PLUGIN_API VOID ToggleDoorsCmd(PSPAWNINFO pChar, PCHAR szLine)
{
	CHAR szArg[MAX_STRING] = {0};
	GetArg(szArg, szLine, 1);

	if (szArg[0] == 0) DoorHelp();
	else if (!strcmp(szArg, "on")) {
		HideDoors();
		WriteChatColor("Hiding the doors");
	}
	else if (!strcmp(szArg, "off")) {
		gHideAlways = false;
		RevealDoors();
		WriteChatColor("Revealing the doors");
	}
	else if (!strcmp(szArg, "always")) {
		gHideAlways = true;
		WriteChatColor("Hiding doors in all zones after you zone");
	}
		
}
 
PLUGIN_API VOID OnEndZone(VOID)
{
	if (gHideAlways) {
		gHidden = false;
		HideDoors();
	}
	else return;
}

PLUGIN_API VOID InitializePlugin(VOID)
{
	AddCommand("/toggledoors", ToggleDoorsCmd);
}

PLUGIN_API VOID ShutdownPlugin(VOID)
{
	RemoveCommand("/toggledoors");
	RevealDoors();
}
 
Last edited:
New Offset was posted a long time ago....

http://www.redguides.com/community/showthread.php?t=9257

Rich (BB code):
#define EQSwitch__ChangeState 0x4A5470 /* needed for Mq2Doors */

Rich (BB code):
// MQ2Doors.cpp : Defines the entry point for the DLL application.
// MQ2Doors by cronic, uber leet toggle by randomguy_01

#include "../MQ2Plugin.h"

PreSetup("MQ2Doors");

#define EQSwitch__ChangeState 0x4A5470

#ifdef EQSwitch__ChangeState
FUNCTION_AT_ADDRESS(void EQSwitch::ChangeState(unsigned char, class EQPlayer *, bool), EQSwitch__ChangeState);
#endif

bool gHidden = false;
BOOL gHideAlways = false;

bool ModDoors(float fMod)
{
	if (!pSwitchMgr || gGameState != GAMESTATE_INGAME) return false;

	for (unsigned int i = 0; i < ((PDOORTABLE)pSwitchMgr)->NumEntries; i++) 
	{
		PDOOR pDoor = ((PDOORTABLE)pSwitchMgr)->pDoor;
		pDoor->DefaultZ += fMod;
		pDoor->Z += fMod;

		((EQSwitch*)pDoor)->ChangeState(3, 0, 0);
	}

	return true;
}

void HideDoors()
{
	if (gHidden || !ModDoors(-1000000.00f)) return;
	gHidden = true;
}

void RevealDoors()
{
	if (!gHidden || !ModDoors(1000000.00f)) return;
	gHidden = false;
}


void DoorHelp()
{
	WriteChatColor("Hide Door Help:");
	WriteChatColor("/toggledoors on - Hide the doors in your current zone.");
	WriteChatColor("/toggledoors off - Shows all doors and disables the always feature");
	WriteChatColor("/toggledoors always - Hides all doors where ever you zone");
}


PLUGIN_API VOID ToggleDoorsCmd(PSPAWNINFO pChar, PCHAR szLine)
{
	CHAR szArg[MAX_STRING] = {0};
	GetArg(szArg, szLine, 1);

	if (szArg[0] == 0) DoorHelp();
	else if (!strcmp(szArg, "on")) {
		HideDoors();
		WriteChatColor("Hiding the doors");
	}
	else if (!strcmp(szArg, "off")) {
		gHideAlways = false;
		RevealDoors();
		WriteChatColor("Revealing the doors");
	}
	else if (!strcmp(szArg, "always")) {
		gHideAlways = true;
		WriteChatColor("Hiding doors in all zones after you zone");
	}
		
}
 
PLUGIN_API VOID OnEndZone(VOID)
{
	if (gHideAlways) {
		gHidden = false;
		HideDoors();
	}
	else return;
}

PLUGIN_API VOID InitializePlugin(VOID)
{
	AddCommand("/toggledoors", ToggleDoorsCmd);
}

PLUGIN_API VOID ShutdownPlugin(VOID)
{
	RemoveCommand("/toggledoors");
	RevealDoors();
}
 
MQ2HideDoors

Users who are viewing this thread

Back
Top
Cart