Jump to content
  • 0

How to one channel boss fixing?


kaJaMrSimple

Question

3 answers to this question

Recommended Posts

  • 0
  • VIP

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 post
  • 0
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 post
  • 0
  • VIP
Posted (edited)
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 (see edit history)
Link to post

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


  • Recently Browsing

    No registered users viewing this page.

  • Activity

    1. 0

      Buy sistem

    2. 7

      Convert char to uint32_t

    3. 7

      Convert char to uint32_t

    4. 7

      Convert char to uint32_t

    5. 7

      Convert char to uint32_t

    6. 7

      Convert char to uint32_t

    7. 7

      Convert char to uint32_t

    8. 7

      Convert char to uint32_t

    9. 7

      Convert char to uint32_t

×
×
  • 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.