Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.

Tone said:Watch spacing from the BB code.
Try the new source.darkmoon said:CTD whenever i try to use it
It shouldn't it works fine for me anyone else having probs with it ?darkmoon said:still CTD after getting zip =\ but your don mission one works like a champ! =]
F:\Program Files\MQ2\mq2TSwitch\MQ2TSwitch.cpp(13) : warning C4005: 'PKT_UPDATE_POSITION' : macro redefinition
F:\Program Files\MQ2\mq2TSwitch\../MQ2Main/MQ2Internal.h(344) : see previous definition of 'PKT_UPDATE_POSITION'
Linking...
Creating library ../Release/mq2TSwitch.lib and object ../Release/mq2TSwitch.exp
mq2TSwitch.dll - 0 error(s), 1 warning(s)
#ifdef PKT_UPDATE_POSITION
#undef PKT_UPDATE_POSITION
#endif
Deal with it till the end of November :Pmguk said:Thanks Tone. Still don't like current sig tho![]()
/* A Tone Plugin :p
Odessa assisted in a crash fix.
Usage: /switch door#
Basically this plugin allows you to open/click any switch or door in the zone
from any location in the zone. Works great for zoning into instances like the
DoN mission ports and also clickin PoK books.
I took the Movement packet from Cronic's Csum, so credit goes to him for that.
*/
#include "../MQ2Plugin.h"
#ifdef PKT_UPDATE_POSITION
#undef PKT_UPDATE_POSITION
#endif
#define OP_ClickSwitch 0x43B
#define PKT_UPDATE_POSITION 0x14CB
#pragma warning(disable:4273) // inconsistent dll linkage warning
PreSetup("MQ2switch");
VOID ClickSwitchCmd(PSPAWNINFO pChar, PCHAR szLine)
{
CHAR szSwitch[MAX_STRING] = {0};
CHAR szMsg[MAX_STRING] = {0};
PCHARINFO pCharInfo;
PCHARINFO pCharInfo;
PDOORTABLE pDoorTable = (PDOORTABLE)pSwitchMgr;
DWORD Count;
BYTE ID=-1;
pDoorTarget = NULL;
GetArg(szSwitch,szLine,1);
if ((pCharInfo = GetCharInfo())==NULL)
return;
if (strlen(szSwitch)==0) {
MacroError("SwitchOpen:: Usage: /tswitch <Door #>");
MacroError("SwitchOpen:: Use /doors to see a list of all doors/switches in zone and their respective number.");
return;
}
ID = atoi(szSwitch);
for (Count=0; Count<pDoorTable->NumEntries; Count++) {
if (pDoorTable->pDoor[Count]->ID == ID) {
strcpy(DoorEnviroTarget.Name, pDoorTable->pDoor[Count]->Name);
DoorEnviroTarget.Y = pDoorTable->pDoor[Count]->Y;
DoorEnviroTarget.X = pDoorTable->pDoor[Count]->X;
DoorEnviroTarget.Z = pDoorTable->pDoor[Count]->Z;
DoorEnviroTarget.Heading = pDoorTable->pDoor[Count]->Heading;
DoorEnviroTarget.Type = SPAWN_NPC;
DoorEnviroTarget.HPCurrent = 1;
DoorEnviroTarget.HPMax = 1;
DoorEnviroTarget.pActorInfo = &EnviroActor;
pDoorTarget = pDoorTable->pDoor[Count];
break;
}
}
if (pDoorTarget==NULL) {
sprintf(szMsg,"Couldn't find door '%s'.",szLine);
WriteChatColor(szMsg,CONCOLOR_RED);
return;
}
//setup switch packet
struct _ClickSwitchPacket {
DWORD SwitchID;
DWORD unk0x4; // always 0
DWORD unk0x8; // always -1
DWORD SpawnID;
} S; // 0x10
// setup move packet
// Cronic's Packet
struct _MOVEPKT {
/*0000*/ unsigned short SpawnID;
/*0002*/ unsigned short TimeStamp;
/*0004*/ float Y;
/*0008*/ float DeltaZ;
/*0012*/ float DeltaY;
/*0016*/ float DeltaX;
/*0020*/ int Animation:10;
/*0020*/ int DeltaHeading:10;
/*0020*/ int padding0020:12;
/*0024*/ float X;
/*0028*/ float Z;
/*0032*/ int Heading:12;
/*0032*/ int padding1_0032:10;
/*0032*/ int padding2_0032:10;
} P; // 36
// init move packet
ZeroMemory(&P, sizeof(P));
P.SpawnID = (unsigned short)pChar->SpawnID;
P.Heading = (unsigned int)(pChar->Heading * 4);
// jump to
P.Z = pDoorTarget->Z;
P.Y = pDoorTarget->Y;
P.X = pDoorTarget->X;
SendEQMessage(PKT_UPDATE_POSITION, &P, sizeof(P));
PSPAWNINFO Me = GetCharInfo()->pSpawn;
S.SwitchID = (DWORD)atoi(szSwitch);
S.unk0x4 = (DWORD)0;
S.unk0x8 = (DWORD)-1;
S.SpawnID = (DWORD)Me->SpawnID;
SendEQMessage(OP_ClickSwitch, &S, sizeof(S));
sprintf(szMsg,"SwitchOpen:: Opened Switch/Door: %s ",szSwitch);
WriteChatColor(szMsg,USERCOLOR_DEFAULT);
// jump back
P.Z = pChar->Z;
P.Y = pChar->Y;
P.X = pChar->X;
SendEQMessage(PKT_UPDATE_POSITION, &P, sizeof(P));
}
PLUGIN_API VOID InitializePlugin(VOID)
{
AddCommand("/switch", ClickSwitchCmd);
}
PLUGIN_API VOID ShutdownPlugin(VOID)
{
RemoveCommand("/switch");
}
.TeachersPet said:Brilliant!
Now if only I could remember how Phazor made his replace doors with bags plugin, I could recode it and put it here.
/* A Tone Plugin :p
Usage: /switch door#
Basically this plugin allows you to open/click any switch or door in the zone
from any location in the zone. Works great for zoning into instances like the
DoN mission ports and also clickin PoK books.
I took the Movement packet from Cronic's Csum, so credit goes to him for that.
*/
#include "../MQ2Plugin.h"
#ifdef PKT_UPDATE_POSITION
#undef PKT_UPDATE_POSITION
#endif
#define OP_ClickSwitch 0x43B
#define PKT_UPDATE_POSITION 0x14CB
#pragma warning(disable:4273) // inconsistent dll linkage warning
PreSetup("MQ2switch");
VOID ClickSwitchCmd(PSPAWNINFO pChar, PCHAR szLine)
{
CHAR szSwitch[MAX_STRING] = {0};
CHAR szMsg[MAX_STRING] = {0};
PCHARINFO pCharInfo;
PDOORTABLE pDoorTable = (PDOORTABLE)pSwitchMgr;
DWORD Count;
BYTE ID=-1;
pDoorTarget = NULL;
GetArg(szSwitch,szLine,1);
if ((pCharInfo = GetCharInfo())==NULL)
return;
if (strlen(szSwitch)==0) {
MacroError("SwitchOpen:: Usage: /switch <Door #>");
MacroError("SwitchOpen:: Use /doors to see a list of all doors/switches in zone and their respective number.");
return;
}
ID = atoi(szSwitch);
for (Count=0; Count<pDoorTable->NumEntries; Count++) {
if (pDoorTable->pDoor[Count]->ID == ID) {
strcpy(DoorEnviroTarget.Name, pDoorTable->pDoor[Count]->Name);
DoorEnviroTarget.Y = pDoorTable->pDoor[Count]->Y;
DoorEnviroTarget.X = pDoorTable->pDoor[Count]->X;
DoorEnviroTarget.Z = pDoorTable->pDoor[Count]->Z;
DoorEnviroTarget.Heading = pDoorTable->pDoor[Count]->Heading;
DoorEnviroTarget.Type = SPAWN_NPC;
DoorEnviroTarget.HPCurrent = 1;
DoorEnviroTarget.HPMax = 1;
DoorEnviroTarget.pActorInfo = &EnviroActor;
pDoorTarget = pDoorTable->pDoor[Count];
break;
}
}
if (pDoorTarget==NULL) {
sprintf(szMsg,"Couldn't find door '%s'.",szLine);
WriteChatColor(szMsg,CONCOLOR_RED);
return;
}
//setup switch packet
struct _ClickSwitchPacket {
DWORD SwitchID;
DWORD unk0x4; // always 0
DWORD unk0x8; // always -1
DWORD SpawnID;
} S; // 0x10
// setup move packet
// Cronic's Packet
struct _MOVEPKT {
/*0000*/ unsigned short SpawnID;
/*0002*/ unsigned short TimeStamp;
/*0004*/ float Y;
/*0008*/ float DeltaZ;
/*0012*/ float DeltaY;
/*0016*/ float DeltaX;
/*0020*/ int Animation:10;
/*0020*/ int DeltaHeading:10;
/*0020*/ int padding0020:12;
/*0024*/ float X;
/*0028*/ float Z;
/*0032*/ int Heading:12;
/*0032*/ int padding1_0032:10;
/*0032*/ int padding2_0032:10;
} P; // 36
// init move packet
ZeroMemory(&P, sizeof(P));
P.SpawnID = (unsigned short)pChar->SpawnID;
P.Heading = (unsigned int)(pChar->Heading * 4);
// jump to
P.Z = pDoorTarget->Z;
P.Y = pDoorTarget->Y;
P.X = pDoorTarget->X;
SendEQMessage(PKT_UPDATE_POSITION, &P, sizeof(P));
PSPAWNINFO Me = GetCharInfo()->pSpawn;
S.SwitchID = (DWORD)atoi(szSwitch);
S.unk0x4 = (DWORD)0;
S.unk0x8 = (DWORD)-1;
S.SpawnID = (DWORD)Me->SpawnID;
SendEQMessage(OP_ClickSwitch, &S, sizeof(S));
sprintf(szMsg,"SwitchOpen:: Opened Switch/Door: %s ",szSwitch);
WriteChatColor(szMsg,USERCOLOR_DEFAULT);
// jump back
P.Z = pChar->Z;
P.Y = pChar->Y;
P.X = pChar->X;
SendEQMessage(PKT_UPDATE_POSITION, &P, sizeof(P));
}
PLUGIN_API VOID InitializePlugin(VOID)
{
AddCommand("/switch", ClickSwitchCmd);
}
PLUGIN_API VOID ShutdownPlugin(VOID)
{
RemoveCommand("/switch");
}
cbsro said:/bump
Any luck on a fix for the latest patch? I'd look at it myself but I'm lazy :/
cbsro said:I wasn't clear, I meant for the new mq2 zip where you no longer actually get a door on your target (though it's still handled by mq2 in some way). I suppose I'll probably just roll back to the previous mq2 version of the door target code, but I haven't looked at it close enough to see if there's a simple change to the plugin that would make it work.
odessa said:no idea what you are talking about, /doors gives you door number, just do /switch door# and that's it, it works.
cbsro said:I have no use for mq2pok, read the thread once when it first came up but not after that. I just assumed if you were successful in making the switch open without targetting you'd post it here or a new thread. Thanks though![]()

