Jump to content

[PROBLEM]Lose Health After Unmound When Pet Summoned


Go to solution Solved by Runah,

Recommended Posts

  • 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

Link to comment
Share on other sites

  • 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;
}
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

 

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());
Link to comment
Share on other sites

 

 

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

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.