Jump to content

How to Give SetPolymorph to Monsters?


Recommended Posts

20 hours ago, BadRomani said:

How can I transform monsters? To any different monster.

For example: I want to turn Nemere monster into dog or Any monster into another monster.

 

Example:

BEFORE

spacer.png

AFTER
spacer.png

 

I don't quite understand what you want to do, I'll try to do it... do you want to change the texture of the mobs? or do you want to activate some sort of mode to change mob textures at will?

  • Love 1
Link to comment
Share on other sites

4 hours ago, Psycho said:

I don't quite understand what you want to do, I'll try to do it... do you want to change the texture of the mobs? or do you want to activate some sort of mode to change mob textures at will?



Thank you very much for your interest. I hope this video will serve as an example for you.

spacer.png

Edited by Metin2 Dev International
Core X - External 2 Internal
Link to comment
Share on other sites

  • Premium

Here's a proof of concept that does what you showed in the gif when using the cloak of courage (70038). You can remove the poly effect from the SetPolymorph function or add an argument so you can control when to spawn it or not.

char_battle.cpp
 

Spoiler
//Modify FuncAggregateMonster as the following:

struct FuncAggregateMonster
{
	LPCHARACTER m_ch;
	FuncAggregateMonster(LPCHARACTER ch)
	{
		m_ch = ch;
	}
	void operator()(LPENTITY ent)
	{
		if (ent->IsType(ENTITY_CHARACTER))
		{
			LPCHARACTER ch = (LPCHARACTER) ent;
			if (ch->IsPC())
				return;
			if (!ch->IsMonster())
				return;
			if (ch->GetVictim())
				return;

			if (number(1, 100) <= 50) // Temporarily attracts enemies with a 50% chance
				if (DISTANCE_APPROX(ch->GetX() - m_ch->GetX(), ch->GetY() - m_ch->GetY()) < 5000)
					if (ch->CanBeginFight())
					{
						ch->SetPolymorph(101, true); // Set polymorph to mobs that were attracted to dog (vnum 101)
						ch->BeginFight(m_ch);
					}
		}
	}
};

 

b7a7fcd9138b54f6f806e0069574fa35.gif

Edited by Metin2 Dev International
Core X - External 2 Internal
Link to comment
Share on other sites

On 12/27/2023 at 2:22 AM, CORKY said:

Here's a proof of concept that does what you showed in the gif when using the cloak of courage (70038). You can remove the poly effect from the SetPolymorph function or add an argument so you can control when to spawn it or not.

char_battle.cpp
 

  Reveal hidden contents
//Modify FuncAggregateMonster as the following:

struct FuncAggregateMonster
{
	LPCHARACTER m_ch;
	FuncAggregateMonster(LPCHARACTER ch)
	{
		m_ch = ch;
	}
	void operator()(LPENTITY ent)
	{
		if (ent->IsType(ENTITY_CHARACTER))
		{
			LPCHARACTER ch = (LPCHARACTER) ent;
			if (ch->IsPC())
				return;
			if (!ch->IsMonster())
				return;
			if (ch->GetVictim())
				return;

			if (number(1, 100) <= 50) // Temporarily attracts enemies with a 50% chance
				if (DISTANCE_APPROX(ch->GetX() - m_ch->GetX(), ch->GetY() - m_ch->GetY()) < 5000)
					if (ch->CanBeginFight())
					{
						ch->SetPolymorph(101, true); // Set polymorph to mobs that were attracted to dog (vnum 101)
						ch->BeginFight(m_ch);
					}
		}
	}
};

 

b7a7fcd9138b54f6f806e0069574fa35.gif

This really worked. But their names should not change.

For example:

It should not change to Wolf -> Wild Dog. Only the model will change.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



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