• 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

MQ2Doors

randomguy_01

Well-known member
Joined
Jul 13, 2005
RedCents
54¢
I saw a request for this in the official compile thread.

/toggledoors on|off|always - hides all doors in a zone

Rich (BB code):
// MQ2Doors.cpp : Defines the entry point for the DLL application.
// MQ2Doors by cronic, minor changes from randomguy_01

#include "../MQ2Plugin.h"

PreSetup("MQ2Doors");
#pragma warning(disable : 4273)

#define EQSwitch__ChangeState	0x4C3DE0 // 4/24

#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("\arMQ2Doors Help:\ax");
	WriteChatColor("\ag/toggledoors on\ax - Hide the doors in your current zone.");
	WriteChatColor("\ag/toggledoors off\ax - Shows all doors and disables the 'always' feature");
	WriteChatColor("\ag/toggledoors always\ax - Hides all doors in all zones");
}


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 doors");
	}
	else if (!strcmp(szArg, "off")) {
		gHideAlways = false;
		RevealDoors();
		WriteChatColor("Revealing 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:
Just wanted to clarify for the person that made that request that this plugin does not open all doors in a zone. There was a plugin that did that, but it was too easily traced server side since it's a server hack and nobody touches it much anymore. What MQ2Doors does is allow "you" and only "you" to pass through any given door in a zone. Basically it tricks your client into thinking you have access to said door and thus opens said door on your client only.
 
No it just moves the doors to -1000000 on the z axis. But yes, it only works for your client. I guess clarifying that in my original post would have helped.
 
Ok thx for the info. If I am running 3 toons on the same comp, this will only work on one of them? OR does it need to be loaded for each one for it to work on them?
 
Last edited:
Needs to be loaded on all 3 it only tells the client it is jacked into that all the doors have been moved way way below where they usually are.
 
is this able to be used with the current EQ patch? if so how do I load it? stuck the dll in my MQ2 folder but can't get it to open in game when I type /toggledoors on thanks in advance.
 
Rich (BB code):
#define EQSwitch__ChangeState	0x4C3DE0 // 4/24

If I can get the latest address to that offset, I can get it updated now, put into the compile, and updated with every patch from now on.
 
Rich (BB code):
#define EQSwitch__ChangeState	0x4C3E50 //7-17

Yah, that last most recent patch didn't change any offsets that mattered. You really could have just changed ClientOverride to 1 and released a new MQ2Main like I did. Anyway, even though it says 7-17 that is the current offset.
 
Will get Doors compiled tonight for you all then. Thanks to Unknown for the offset. I should be able to keep it up to date now.
 
this dll is making me crash now when ever I enter the /toggle command. Not sure if something has changed since the last patch or not, but from what I am reading in the previous posts not much has changed. Any idea why I keep crashing now?
 
Ok. Here's MQ2Doors to work with the latest patch. I will also start including this with the compiles from now on.
 
Awesome Jmo, thx for getting this for us and going to add bk into the compiles.
 
Trying to use this semi new doors.dll and its making me CTD now. Even with the one in jmo's compile makes me CTD when type /toggledoors on. Any idea why its not working?
 
MQ2Doors

Users who are viewing this thread

Back
Top
Cart