Jump to content

How to one channel boss fixing?


Recommended Posts

  • Honorable Member

If I read your question correctly, you want to spawn a monster (boss) only in channel 1.

You can try this, I have not tested it.

Let me know if it works.

/// 1. @ game/src/char_manager.cpp
// Search
LPCHARACTER CHARACTER_MANAGER::SpawnMob(DWORD dwVnum, long lMapIndex, long x, long y, long z, bool bSpawnMotion, int iRot, bool bShow)
{
	const CMob* pkMob = CMobManager::instance().Get(dwVnum);
	if (!pkMob)
	{
		sys_err("SpawnMob: no mob data for vnum %u", dwVnum);
		return NULL;
	}

// Add below
	if (g_bChannel > 1)
	{
		switch (dwVnum)
		{
		case 591: // Bestial Captain (metin2_map_a3, metin2_map_b3, metin2_map_c3)
			return NULL;
		}
	}

 

  • Love 1
Link to comment
Share on other sites

1 hour ago, Owsap said:

If I read your question correctly, you want to spawn a monster (boss) only in channel 1.

You can try this, I have not tested it.

Let me know if it works.


/// 1. @ game/src/char_manager.cpp
// Search
LPCHARACTER CHARACTER_MANAGER::SpawnMob(DWORD dwVnum, long lMapIndex, long x, long y, long z, bool bSpawnMotion, int iRot, bool bShow)
{
	const CMob* pkMob = CMobManager::instance().Get(dwVnum);
	if (!pkMob)
	{
		sys_err("SpawnMob: no mob data for vnum %u", dwVnum);
		return NULL;
	}

// Add below
	if (g_bChannel > 1)
	{
		switch (dwVnum)
		{
		case 591: // Bestial Captain (metin2_map_a3, metin2_map_b3, metin2_map_c3)
			return NULL;
		}
	}

 

yes that's exactly what I want. but how can we add map and duration? (by the way I haven't tried yet if it works)

Link to comment
Share on other sites

  • Honorable Member
6 hours ago, kaJaMrSimple said:

yes that's exactly what I want. but how can we add map and duration? (by the way I haven't tried yet if it works)

/// 1. @ game/src/char_manager.cpp
// Search
LPCHARACTER CHARACTER_MANAGER::SpawnMob(DWORD dwVnum, long lMapIndex, long x, long y, long z, bool bSpawnMotion, int iRot, bool bShow)
{
	const CMob* pkMob = CMobManager::instance().Get(dwVnum);
	if (!pkMob)
	{
		sys_err("SpawnMob: no mob data for vnum %u", dwVnum);
		return NULL;
	}

// Add below
	unsigned long ulRestricedMapIndex[] = { 3, 23, 43 };
	if (g_bChannel > 1 /* Check channel */ && std::find(std::begin(ulRestricedMapIndex), std::end(ulRestricedMapIndex), mapindex) != std::end(ulRestricedMapIndex) /* Search the map index for this mob spawn */)
	{
		switch (dwVnum /* Mob VNUM */ )
		{
		case 591: // Bestial Captain (Normally spawns @ metin2_map_a3, metin2_map_b3, metin2_map_c3)
			return NULL;
		}
	}

I'm not sure what you want with "duration" but the block of code above will block the spawn of the monster VNUM inside the switch which spawns in the map index inside the ulRestricedMapIndex array.

Edited by Owsap
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.