Jump to content
×
×
  • Create New...

Ride the Horse after Death


Recommended Posts

Hi.
 
I see this features in Metin2 Official.
When you die and you're riding, when you restart from here, your character will ride automatically the mount (I have done this only with Pony).
 
Open game/src/char_horse.cpp
Check:
bool CHARACTER::StartRiding()

Check:

   if(test_server)
        sys_log(0, "Ride Horse : %s ", GetName());

Add under:

m_HorseNSystem = 1;

Check:

bool CHARACTER::StopRiding()
{

Check:

       if (!IsDead() && !IsStun())
        {

Add under:

          m_HorseNSystem = 0;

Check:

            m_HorseNSystem = 0;
            ComputePoints();
            UpdatePacket();

Add above:

          m_dwMountVnum = 0;

 

Open game/src/char.h
Check:
       PIXEL_POSITION        m_posSafeboxOpen;

Add under:

   public:
            int                m_HorseNSystem;

 

Open game/src/cmd_general.cpp
Check:
    ch->ChatPacket(CHAT_TYPE_COMMAND, "CloseRestartWindow");

    ch->GetDesc()->SetPhase(PHASE_GAME);
    ch->SetPosition(POS_STANDING);
    ch->StartRecoveryEvent();

Add under:

    if (ch->m_HorseNSystem == 1)
    {
        ch->StartRiding();
        ch->m_HorseNSystem = 0;
    }

Open game/src/char_battle.cpp

Check:
void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
{

Check:

        if (IsHorseRiding())
        {
            StopRiding();

Add under:

           m_HorseNSystem = 1;

Check:

        else if (GetMountVnum())
        {
            RemoveAffect(AFFECT_MOUNT_BONUS);
            m_dwMountVnum = 0;
            UnEquipSpecialRideUniqueItem();

Add under:

            m_HorseNSystem = 1;

 

The code was written in a few minutes for a personal test.

 
Updates:
 
Fast method:
Open game/src/char_battle.cpp
Check:
void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
{
	if (IsDead())
		return;

	{
		if (IsHorseRiding())
		{
			StopRiding();
		}
		else if (GetMountVnum())
		{
			RemoveAffect(AFFECT_MOUNT_BONUS);
			m_dwMountVnum = 0;
			UnEquipSpecialRideUniqueItem();

			UpdatePacket();
		}
	}

Edit like this:

void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
{
	if (IsDead())
		return;

/*	{
		if (IsHorseRiding())
		{
			StopRiding();
		}
		else if (GetMountVnum())
		{
			RemoveAffect(AFFECT_MOUNT_BONUS);
			m_dwMountVnum = 0;
			UnEquipSpecialRideUniqueItem();

			UpdatePacket();
		}
	}*/

 

Best Regards,
Anyone.
  • Love 1
Link to comment
Share on other sites

Why all this fuss only Search
1-char_battle.cpp

this

void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
{
	if (IsDead())
		return;

	{
		if (IsHorseRiding())
		{
			StopRiding();
		}
		else if (GetMountVnum())
		{
			RemoveAffect(AFFECT_MOUNT_BONUS);
			m_dwMountVnum = 0;
			UnEquipSpecialRideUniqueItem();

			UpdatePacket();
		}
	}

Edit to

void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
{
	if (IsDead())
		return;

	{
/*		if (IsHorseRiding())
		{
			StopRiding();
		}
		else if (GetMountVnum())
		{
			RemoveAffect(AFFECT_MOUNT_BONUS);
			m_dwMountVnum = 0;
			UnEquipSpecialRideUniqueItem();

			UpdatePacket();
		}*/
	}

All right

  • Love 1
Link to comment
Share on other sites

  • 1 month later...
En 28/6/2017 a las 8:52, txtxtx dijo:

Why all this fuss only Search
1-char_battle.cpp

this

void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
{
	if (IsDead())
		return;

	{
		if (IsHorseRiding())
		{
			StopRiding();
		}
		else if (GetMountVnum())
		{
			RemoveAffect(AFFECT_MOUNT_BONUS);
			m_dwMountVnum = 0;
			UnEquipSpecialRideUniqueItem();

			UpdatePacket();
		}
	}

Edit to

void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
{
	if (IsDead())
		return;

	{
/*		if (IsHorseRiding())
		{
			StopRiding();
		}
		else if (GetMountVnum())
		{
			RemoveAffect(AFFECT_MOUNT_BONUS);
			m_dwMountVnum = 0;
			UnEquipSpecialRideUniqueItem();

			UpdatePacket();
		}*/
	}

All right

Did you test what you wrote?

If i'm not wrong, if u die and not unmount the horse, the player won't do the die animation, it will die but you will see it ridding the horse.

Link to comment
Share on other sites

  • Premium
On ‎28‎/‎06‎/‎2017 at 7:52 AM, txtxtx said:

Why all this fuss only Search
1-char_battle.cpp

this

void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
{
	if (IsDead())
		return;

	{
/*		if (IsHorseRiding())
		{
			StopRiding();
		}
		else if (GetMountVnum())
		{
			RemoveAffect(AFFECT_MOUNT_BONUS);
			m_dwMountVnum = 0;
			UnEquipSpecialRideUniqueItem();

			UpdatePacket();
		}*/
	}

 

Don't do this in no circumstance, you don't have to be a genius to realize what he did by commenting the else if (GetMountVnum()):

		RemoveAffect(AFFECT_MOUNT_BONUS);

 

If you die, the bonus from the mount will not be remove as they are supposed to.

So, if you want to do something, do it properly:

void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
{
	if (IsDead())
		return;

	{
		if (GetMountVnum())
		{
			RemoveAffect(AFFECT_MOUNT_BONUS);
			m_dwMountVnum = 0;
			UnEquipSpecialRideUniqueItem();

			UpdatePacket();
		}
	}

 

Link to comment
Share on other sites

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.


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.