Access Holiday outposts

03/31/2019 13:17 Skippster#1
Hey guys,

i'm currently playing around with gwca and it's awesome (thanks to all the developers, you guys rock :D).

Now i want to know if its possible to change the map you're loading in to say Kamadan wintersday (MapID: 819) when you would normally move to Kamadan.

i tested changing the contents of the "InstanceLoadInfo" Packet (header: 411) but these are only kinda?! working.
Changing:
  • the district only changes the district dropdown label
  • the language leads to crashing
  • the map_id seems to do nothing
  • is_explorable leads to crashing when using a skill (kindof understandable^^)
  • is_observer changes to observer mode but you can only observer your own party (so i can not "fly" to other characters)

Do i use the wrong approach or do i change the wrong packet?
I found the packet here: [Only registered and activated users can see links. Click Here To Register...]

I know its a StoC Packet so maybe i need to send my own CtoS Packet to tell the server i want to join kama wintersday?


One more thing. I started by trying out the zaishen title example from [Only registered and activated users can see links. Click Here To Register...]. But when i use "FreeLibraryAndExitThread(hModule, EXIT_SUCCESS);" after pressing "VK_END" (see code below) the game crashes. I thought this would only exit my dll thead created by the "CreateThread" method?
I'm "only" a Javascript developer with minor knowledge in C++ and maybe this is the expected behaviour but it seems strange to me.


Code:
#include <Windows.h>

#include <functional>
#include <stdlib.h>
#include <stdint.h>

#include <GWCA/GWCA.h>
#include <GWCA/GameContainers/GamePos.h>
#include <GWCA/Utilities/Export.h>

#include <GWCA/Packets/StoC.h>
#include <GWCA/Managers/StoCMgr.h>
#include <GWCA/Managers/CtoSMgr.h>
#include <GWCA/GameEntities/Agent.h>
#include <GWCA/Managers/AgentMgr.h>
#include <GWCA/Constants/Maps.h>

FILE *stream;


void init(HMODULE hModule) {

	// open console and redirect stdout into it
	AllocConsole();
	freopen_s(&stream, "CONOUT$", "w", stdout);

	GW::Initialize();
		
	GW::StoC::AddCallback<GW::Packet::StoC::InstanceLoadInfo>([](GW::Packet::StoC::InstanceLoadInfo* pak) -> bool {
		printf("InstanceLoadInfo loaded\n");
		if (GetAsyncKeyState('S') & 1) {
			printf("Value changed!\n");
			pak->map_id = static_cast<uint32_t>(GW::Constants::MapID::Kamadan_Jewel_of_Istan_Wintersday_outpost);
		}
		return false;
	});



	while (1) {
		Sleep(100);

		// Get Player Agent Structure.
		GW::Agent* player = GW::Agents::GetPlayer();

		if (GetAsyncKeyState(VK_SPACE) & 1) {
			if (player != NULL) {
				printf("Player: %ls: %f %f\n", GW::Agents::GetAgentName(player).c_str(), player->pos.x, player->pos.y);
			}
		}

		if (GetAsyncKeyState(VK_END) & 1) {
			break;
		}
	}

	GW::Terminate();
	FreeConsole();
	FreeLibraryAndExitThread(hModule, EXIT_SUCCESS); // crashes here
}

BOOL APIENTRY DllMain(HMODULE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved)
{
	if (ul_reason_for_call == DLL_PROCESS_ATTACH) {
		DisableThreadLibraryCalls(hModule);
		CreateThread(0, 0, (LPTHREAD_START_ROUTINE)init, hModule, 0, 0);
	}
	return TRUE;
}
~ Skippster
04/03/2019 22:59 afmart#2
From my understanding, ATM the game servers are gate keepers of the seasonal maps, when the map is supposed to halloween it will redirect you to halloween map instead of normal map. as far as i know is impossible to map travel to seasonal maps, but im still very green to manipulating the GW client using the API's. i know there is(or was) a way to load pvp maps with you alone but dont have the faintiest idea of how to do it
04/04/2019 17:45 DerMoench14#3
It's possible but not public, sry.
04/12/2019 22:09 4D1#4
canthan new year lions arch map is open year round, other than that nope :feelsbadman:
04/18/2019 12:24 afmart#5
Quote:
Originally Posted by DerMoench14 View Post
It's possible but not public, sry.
can you load the holiday npcs too?