• 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

MQ2HideDoors

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
 
TeachersPet said:
Done!

So tell me cronic, are you here to stay at RG?

No, I'm just at the end of a brief pause between road trips and work binges.

cronic
 
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).
 
both offsets are right, don't matter though since patch is incoming :)
 
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:
Rich (BB code):
#define EQSwitch__ChangeState 0x482F18    /* 12-15-2005 */

New offset for yas.

-CodeCaster
 
Leeches rejoice...

Rich (BB code):
#define EQSwitch__ChangeState 0x48379A
 
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();
}
 
Ahh Drat, I should have checked the offset thread. Still you've earned my red cent for the day! :cool:
 
MQ2HideDoors

Users who are viewing this thread

Back
Top
Cart