Jump to content

Recommended Posts

Hey can someone help me fix that, when a player have 4k HP and getting 5k damage, that his HP is going into negative (-1k in that case). I want to prevent that (for example his HP should be 0 not -1k).

Sorry for my bad english ?

Edited by backtop
Link to comment
https://metin2.dev/topic/28959-hp-negative-when-dead/
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

  • Solution

char_battle.cpp

Search:

    if (!cannot_dead)
    {
        PointChange(POINT_HP, -dam, false);
    }

Change:

    if (!cannot_dead)
    {
        if (GetHP() - dam <= 0)
            dam = GetHP();

        PointChange(POINT_HP, -dam, false);
    }

Borrowed from MARTY's source.

Link to comment
https://metin2.dev/topic/28959-hp-negative-when-dead/#findComment-148647
Share on other sites

20 minutes ago, Chookez said:

char_battle.cpp

Search:

    if (!cannot_dead)
    {
        PointChange(POINT_HP, -dam, false);
    }

Change:

    if (!cannot_dead)
    {
        if (GetHP() - dam <= 0)
            dam = GetHP();

        PointChange(POINT_HP, -dam, false);
    }

Borrowed from MARTY's source.

Working perfect. Thank you ?

Link to comment
https://metin2.dev/topic/28959-hp-negative-when-dead/#findComment-148648
Share on other sites

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.