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

[C++]Block Pets, Mounts & Horses


FlorinMarian

Question

17 answers to this question

Recommended Posts

  • 0
  • Premium
3 hours ago, EnKor said:

in quest summon_horse.quest and ride.quest

 

 

 

 

After:

# when xxxxxx.use begin


# paste

if pc.get_map_index() >= 101000 and pc.get_map_index() <= 110500 then
	return
end
                                                               
if pc.get_map_index() >= 111000 and pc.get_map_index() <= 111500 then
	return
end
                                                               

 

Thank you for this idea but it will not work, you tried to help me but with my noob level i can see some mistakes

Link to comment
  • 0
  • Premium
2 minutes ago, FlorinMarian said:

Thank you for this idea but it will not work, you tried to help me but with my noob level i can see some mistakes

i did not test that, but i belive it will work

u only need to know the right map index and change it with my.

Link to comment
  • 0
  • Premium
6 hours ago, EnKor said:

in quest summon_horse.quest and ride.quest

 

 

 

 

After:

# when xxxxxx.use begin


# paste

if pc.get_map_index() >= 110000 and pc.get_map_index() <= 110500 then
	return
end
                                                               
if pc.get_map_index() >= 111000 and pc.get_map_index() <= 111500 then
	return
end
                                                               

 

so:

- pc.get_map_index need to be exactly map_index (110 and 111 in my case)

eg: pc.get_map_index == 110 or pc.get_map_index == 111

- between pc.get_map_index() need to be "or" not "and" beccause if you say "and" will never happen. A player cannot be in two maps same time.

Happ new year !

Link to comment
  • 0
  • Premium
3 minutes ago, FlorinMarian said:

so:

- pc.get_map_index need to be exactly map_index (110 and 111 in my case)

eg: pc.get_map_index == 110 or pc.get_map_index == 111

- between pc.get_map_index() need to be "or" not "and" beccause if you say "and" will never happen. A player cannot be in two maps same time.

Happ new year !

If you know, why you come here to ask then? Just do it.

Link to comment
  • 0
  • Premium
18 minutes ago, FlorinMarian said:

so:

- pc.get_map_index need to be exactly map_index (110 and 111 in my case)

eg: pc.get_map_index == 110 or pc.get_map_index == 111

- between pc.get_map_index() need to be "or" not "and" beccause if you say "and" will never happen. A player cannot be in two maps same time.

Happ new year !

The and means kind of between these 2 index you can't summon the horse xD . 

Like if the player is between these numbers ( 25000 / 27000 ) the horse summon isn't available xD

If u write ''or'' will get just the map index's you write, on this example just 25000 and 27000 ;) 

As long as I'll be a threat for you , i will always be your target :3

Link to comment
  • 0
  • Premium
1 hour ago, FlorinMarian said:

so:

- pc.get_map_index need to be exactly map_index (110 and 111 in my case)

eg: pc.get_map_index == 110 or pc.get_map_index == 111

- between pc.get_map_index() need to be "or" not "and" beccause if you say "and" will never happen. A player cannot be in two maps same time.

Happ new year !

What?? Ok. Gogo use "or" in tbis case.

Link to comment
  • 0
  • Premium
11 hours ago, tierrilopes said:
 if (ch->GetMapIndex() == 110)
        {
            ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cant use this here."));
            return -1;
        }

Is this what you want?

You can use the vnum of the item you want to block, or just add it to the function, for example mount one for the horse.

Okay, thank you.

Now, anybody can create a function/quest which dismount/send horse away when a player enter on these maps?

Thank you!

Link to comment
  • 0
  • Moon

@tierrilopes Atleast if you give an answer, give a proper one. 

Anyway, open input_login.cpp, look for :

Spoiler
else
	{
		if (CWarMapManager::instance().IsWarMap(ch->GetMapIndex()) ||
				marriage::WeddingManager::instance().IsWeddingMap(ch->GetMapIndex()))
		{
			if (!test_server)
				ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire()));
		}
	}

add below:

Spoiler
if (ch->GetMapIndex() == 110)
	{
		if (ch->IsRiding())
		{
			ch->StopRiding();
		}
	}

 

  • Metin2 Dev 1
  • Love 1
Link to comment
  • 0
31 minutes ago, metin2-factory said:

@tierrilopes Atleast if you give an answer, give a proper one. 

Anyway, open input_login.cpp, look for :

  Reveal hidden contents

else
	{
		if (CWarMapManager::instance().IsWarMap(ch->GetMapIndex()) ||
				marriage::WeddingManager::instance().IsWeddingMap(ch->GetMapIndex()))
		{
			if (!test_server)
				ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire()));
		}
	}

add below:

  Reveal hidden contents

if (ch->GetMapIndex() == 110)
	{
		if (ch->IsRiding())
		{
			ch->StopRiding();
		}
	}

 

If you want to get a good answer, then you have to ask a good question.

And learn the difference between  : I want help - works for me - create functins for me

Link to comment
  • 0
47 minutes ago, metin2-factory said:

@tierrilopes Atleast if you give an answer, give a proper one. 

Anyway, open input_login.cpp, look for :

  Hide contents

else
	{
		if (CWarMapManager::instance().IsWarMap(ch->GetMapIndex()) ||
				marriage::WeddingManager::instance().IsWeddingMap(ch->GetMapIndex()))
		{
			if (!test_server)
				ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire()));
		}
	}

add below:

  Hide contents

if (ch->GetMapIndex() == 110)
	{
		if (ch->IsRiding())
		{
			ch->StopRiding();
		}
	}

 

Because the index is 110000 And with each war increases, it was not to be the fixed value that is in files 110 and 111
?

Link to comment
  • 0

char_horse.cpp

 

void CHARACTER::HorseSummon(bool bSummon, bool bFromFar, DWORD dwVnum, const char* pPetName)
{
    if ( bSummon )
    {
        //NOTE : summon했는데 이미 horse가 있으면 아무것도 안한다.
        if( m_chHorse != NULL )
            return;

        if (GetHorseLevel() <= 0)
            return;

        if (GetMapIndex() == 110 || GetMapIndex() == 111 || GetMapIndex() == 113 || GetMapIndex() == 82)
        {
            ChatPacket(CHAT_TYPE_INFO, "Burada Ata Binemezsin..");
            return;

        }

 

 

help :

 

sykpe :alondark7 

Link to comment
  • -1
  • Premium

in quest summon_horse.quest and ride.quest

 

 

 

 

After:

# when xxxxxx.use begin


# paste

if pc.get_map_index() >= 110000 and pc.get_map_index() <= 110500 then
	return
end
                                                               
if pc.get_map_index() >= 111000 and pc.get_map_index() <= 111500 then
	return
end
                                                               

 

Link to comment

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

Announcements

  • -15% Discount in Metin2 Dev Store (01/10/2021 => 31/12/2021) => Code => 15_PCT_OCT_TO_DEC_2021


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.