Jump to content

[PROBLEM]Lose Health After Unmound When Pet Summoned


Go to solution Solved by Runah,

Recommended Posts

  • Premium

Hi guys, like title says, it's simples, when pet is summoned and i unride from horse ou mount, just lose the health that pet gives...

I hope you guys can help me,
With the best regards,
Runah

YfEFo71.png

A new project is coming up very soon. Stay tunned.

Metin2dev Topic

Nexus2 Facebook

Nexus2 Discord

  • Replies 14
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Premium

Let me explain better with an example:

I have 10k health, i summon pet (pet gives 3k health) - Stay with 13k / max 13k hp

I mount the horse (all fine) - stay with 13k / max 13k hp

I unmount / unride - Stay with 10k / max 13k hp...

YfEFo71.png

A new project is coming up very soon. Stay tunned.

Metin2dev Topic

Nexus2 Facebook

Nexus2 Discord

  • Premium

I know that oficials are like that, but that's a bug and the problem is that players spend to much elixir (%) and potions because of that bug...

Thx by the way, hope you can help me.

YfEFo71.png

A new project is coming up very soon. Stay tunned.

Metin2dev Topic

Nexus2 Facebook

Nexus2 Discord

  • Premium

Bug that's a problem, because if he is farming or attacking moob and lose health they just down and up the horse and get MaxHP...  :(

YfEFo71.png

A new project is coming up very soon. Stay tunned.

Metin2dev Topic

Nexus2 Facebook

Nexus2 Discord

  • Premium

"problem is that players spend to much elixir (%) and potions because of that bug..."

 

The last idea for me:

int pc_unmount(lua_State* L)
{
    LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
    int iHp = ch->GetHP();
    ch->RemoveAffect(AFFECT_MOUNT);
    ch->RemoveAffect(AFFECT_MOUNT_BONUS);
    ch->SetHP(iHp);
    if (ch->IsHorseRiding())
        ch->StopRiding();
    return 0;
}

ou :D

char.cpp

 

In function CHARACTER::ComputePoints()

 

Search:

if (iMaxHP != GetMaxHP())
{
SetRealPoint(POINT_MAX_HP, iMaxHP); // 기본HP를 RealPoint에 저장해 놓는다.
}


PointChange(POINT_MAX_HP, 0);


if (iMaxSP != GetMaxSP())
{
SetRealPoint(POINT_MAX_SP, iMaxSP); // 기본SP를 RealPoint에 저장해 놓는다.
}


PointChange(POINT_MAX_SP, 0);


if (GetHP() > GetMaxHP())
PointChange(POINT_HP, GetMaxHP() - GetHP());


if (GetSP() > GetMaxSP())
PointChange(POINT_SP, GetMaxSP() - GetSP());

Copy this and remove.

 

After replace before UpdatePacket();

 

Good Luck.

Edited by Morphe
  • Premium

The Problem is that when you unride a horse/mount, all your stats will be "reloaded".

 

This bug is caust because the "affect" table in mysql is not part of the function which

is "reloading" the players stats.

 

For fixing this you simply  just have to add the affect table to the function,

or making the new hp you current max hp.

 

This kind of Bug also happends if you:

 

  • Use some skills (Like Dash)
  • Unride a horse/mount
  • Teleport

The most irritating thing is that it happen when you use some skills,

this is not good for PvP and the additional hp you get from Quests arent helping.

 

I have a fixed core but i cant share it whit you since u buyed it myself.

You should ask a developer here for help, maybe he will do it for free.

 

I am not so good in C++ so that i could help you myself, i am sorry.

This solve all problems.

 

 

ou :D

char.cpp

 

In function CHARACTER::ComputePoints()

 

Search:

if (iMaxHP != GetMaxHP())
{
SetRealPoint(POINT_MAX_HP, iMaxHP); // 기본HP를 RealPoint에 저장해 놓는다.
}


PointChange(POINT_MAX_HP, 0);


if (iMaxSP != GetMaxSP())
{
SetRealPoint(POINT_MAX_SP, iMaxSP); // 기본SP를 RealPoint에 저장해 놓는다.
}


PointChange(POINT_MAX_SP, 0);


if (GetHP() > GetMaxHP())
PointChange(POINT_HP, GetMaxHP() - GetHP());


if (GetSP() > GetMaxSP())
PointChange(POINT_SP, GetMaxSP() - GetSP());

Copy this and remove.

 

After replace before UpdatePacket();

 

Edited by Morphe

 

This solve all problems.

 

 

ou :D

char.cpp

 

In function CHARACTER::ComputePoints()

 

Search:

if (iMaxHP != GetMaxHP())
{
SetRealPoint(POINT_MAX_HP, iMaxHP); // 기본HP를 RealPoint에 저장해 놓는다.
}


PointChange(POINT_MAX_HP, 0);


if (iMaxSP != GetMaxSP())
{
SetRealPoint(POINT_MAX_SP, iMaxSP); // 기본SP를 RealPoint에 저장해 놓는다.
}


PointChange(POINT_MAX_SP, 0);


if (GetHP() > GetMaxHP())
PointChange(POINT_HP, GetMaxHP() - GetHP());


if (GetSP() > GetMaxSP())
PointChange(POINT_SP, GetMaxSP() - GetSP());

Copy this and remove.

 

After replace before UpdatePacket();

 

 

I try this a long tine ago and I have big problems with player hp after mount/unmount , hp has increased to all players.

 

edit: I try only with

if (GetHP() > GetMaxHP())
PointChange(POINT_HP, GetMaxHP() - GetHP());


if (GetSP() > GetMaxSP())
PointChange(POINT_SP, GetMaxSP() - GetSP());

 

 

This solve all problems.

 

 

ou :D

char.cpp

 

In function CHARACTER::ComputePoints()

 

Search:

if (iMaxHP != GetMaxHP())
{
SetRealPoint(POINT_MAX_HP, iMaxHP); // 기본HP를 RealPoint에 저장해 놓는다.
}


PointChange(POINT_MAX_HP, 0);


if (iMaxSP != GetMaxSP())
{
SetRealPoint(POINT_MAX_SP, iMaxSP); // 기본SP를 RealPoint에 저장해 놓는다.
}


PointChange(POINT_MAX_SP, 0);


if (GetHP() > GetMaxHP())
PointChange(POINT_HP, GetMaxHP() - GetHP());


if (GetSP() > GetMaxSP())
PointChange(POINT_SP, GetMaxSP() - GetSP());

Copy this and remove.

 

After replace before UpdatePacket();

 

 

I try this a long tine ago and I have big problems with player hp after mount/unmount , hp has increased to all players.

 

edit: I try only with

if (GetHP() > GetMaxHP())
PointChange(POINT_HP, GetMaxHP() - GetHP());


if (GetSP() > GetMaxSP())
PointChange(POINT_SP, GetMaxSP() - GetSP());

I havent problem :D

  • Premium
  • Solution

Solved, actually i was refreshing status after get HP, that's the problem. (my fail) #Close

YfEFo71.png

A new project is coming up very soon. Stay tunned.

Metin2dev Topic

Nexus2 Facebook

Nexus2 Discord

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.