Jump to content
metin2dev
Metin2International
  • 0
Runah

[PROBLEM]Lose Health After Unmound When Pet Summoned

Question

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

Share this post


Link to post
Share on other sites

14 answers to this question

Recommended Posts

  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

Try this noob solution:

questlua_pc.cpp:

 

Find this:

int pc_unmount(lua_State* L)

and add this:

ch->SetHP(GetMaxHP());

so if you unmount, then get max hp!

Share this post


Link to post
Share on other sites
  • 0

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...  :(

Share this post


Link to post
Share on other sites
  • 0

"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;
}

Share this post


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

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

 

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());

Share this post


Link to post
Share on other sites
  • 0

 

 

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

Share this post


Link to post
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.

×