Jump to content
×
×
  • Create New...
  • 0

How to one channel boss fixing?


kaJaMrSimple

Question

3 answers to this question

Recommended Posts

  • 0
  • 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

  • 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 comment
Share on other sites

  • 0
  • 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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.


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.