Jump to content
  • 0
notbugme

c++ Monsters attack each other?

Question

Hello  Everyone

I'm sorry if it's on the wrong side.

In the Metin2 official game, there is a hydra region, where monsters attack an object. How can I make this system help me in this regard? I really appreciate you. Have a good day.

System: Monsters attack the object.

Share this post


Link to post

15 answers to this question

Recommended Posts

  • 0
vor 4 Stunden schrieb WeedHex:

Show a video, i can misunderstand the problem...

What exactly Can you misunderstand? He asked how he Can make monsters attack a object 

E.g. Aggressive Monsters attack a Player 

 

  • Confused 1

Share this post


Link to post
  • 0
Serach in char_state.cpp:
  m_pkParty->SendMessage(this, PM_ATTACKED_BY, 0, 0);

Add after:

if (m_pkMobData->m_table.dwVnum == 1111) // mob that attack vnum
{
	LPCHARACTER the_object = FindVictim(5555, m_pkMobData->m_table.wAggressiveSight); // 5555 = object vnum
	SetVictim(the_object);
	return;				
}

It's not tested, i just writed it.

  • Love 1

Share this post


Link to post
  • 0
18 godzin temu, WeedHex napisał:

Show a video, i can misunderstand the problem...

j6EpBJ.png

 

The monsters are attacking the object.

2 godziny temu, Dobrescu Sebastian napisał:

Serach in char_state.cpp:
  m_pkParty->SendMessage(this, PM_ATTACKED_BY, 0, 0);

Add after:

if (m_pkMobData->m_table.dwVnum == 1111) // mob that attack vnum
{
	LPCHARACTER the_object = FindVictim(5555, m_pkMobData->m_table.wAggressiveSight); // 5555 = object vnum
	SetVictim(the_object);
	return;				
}

It's not tested, i just writed it.

char_state.cpp: In member function 'virtual void CHARACTER::StateBattle()':
char_state.cpp:1115: error: invalid conversion from 'int' to 'CHARACTER*'
char_state.cpp:1115: error:   initializing argument 1 of 'CHARACTER* FindVictim(CHARACTER*, int)'
gmake: *** [OBJDIR_GAME/char_state.o] Error 1
root@host:/usr/aSource/Server/game/src #
 

Share this post


Link to post
  • 0
2 godziny temu, Dobrescu Sebastian napisał:

Serach in char_state.cpp:
  m_pkParty->SendMessage(this, PM_ATTACKED_BY, 0, 0);

Add after:

if (m_pkMobData->m_table.dwVnum == 1111) // mob that attack vnum
{
	LPCHARACTER the_object = FindVictim(5555, m_pkMobData->m_table.wAggressiveSight); // 5555 = object vnum
	SetVictim(the_object);
	return;				
}

It's not tested, i just writed it.

 

2aMqJA.png

 

g6Np65.png

  • Love 1

Share this post


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

    No registered users viewing this page.

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