Jump to content

Quiver Unlimited Arrows function for Distance Damage


Recommended Posts

Hey guys I added the Quiver function (unlimited arrows) to my char_battle.cpp and it's great no arrow counting, except that I haven't discovered yet how to make the quiver's damage ignore the archer's distance from the target. What do I mean by that:

If the archer equips the quiver in the official server and is 1 meter away from his target, the damage he causes is the same as if he was 5 meters away from the target. In my quiver this is not happening - the distance reduces the arrow's damage. Is there someone who can show me how to make the quiver ignore the distance and make the arrow shots have the same damage from everywhere?

Link to comment
Share on other sites

  • Replies 11
  • Created
  • Last Reply

Top Posters In This Topic

battle.cpp, search for:

int CalcArrowDamage(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, LPITEM pkBow, LPITEM pkArrow, bool bIgnoreDefense)

under int iPercent = 100 - (iGap * 5);
    if (pkArrow->GetSubType() == WEAPON_QUIVER)
    {
        iPercent = 100;
    }

Kind Regards

Legend

Link to comment
Share on other sites

15 minutes ago, Legend said:

battle.cpp, search for:

int CalcArrowDamage(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, LPITEM pkBow, LPITEM pkArrow, bool bIgnoreDefense)

under int iPercent = 100 - (iGap * 5);
    if (pkArrow->GetSubType() == WEAPON_QUIVER)
    {
        iPercent = 100;
    }

Kind Regards

Legend

Thanks friend but what am I doing wrong here?

Spoiler

int iGap = (iDist / 100) - 5 - pkAttacker->GetPoint(POINT_BOW_DISTANCE);
    int iPercent = 100 - (iGap * 5);

    if (pkArrow->GetVnum() = 79504)
    {
        iPercent = 100;
    }

    if (iPercent <= 0)
        return 0;
    else if (iPercent > 100)
        iPercent = 100;

    int iDam = 0;

https://metin2.download/picture/TldDMWZYlVMQt0aZbBph8dinVfNQx03C/.png

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

7 minutes ago, Veneno said:

Thanks friend but what am I doing wrong here?

  Hide contents

int iGap = (iDist / 100) - 5 - pkAttacker->GetPoint(POINT_BOW_DISTANCE);
    int iPercent = 100 - (iGap * 5);

    if (pkArrow->GetVnum() = 79504)
    {
        iPercent = 100;
    }

    if (iPercent <= 0)
        return 0;
    else if (iPercent > 100)
        iPercent = 100;

    int iDam = 0;

https://metin2.download/picture/TldDMWZYlVMQt0aZbBph8dinVfNQx03C/.png

You cant use item ID for this, use subtype.

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • 6 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 13

      Metin2 Closed Beta Content (2003-2004)

    2. 25

      [SRC] Metin2 on LINUX - The Old Metin2 Project

    3. 2

      United/Club/Midgard serverfiles?

    4. 13

      Metin2 Closed Beta Content (2003-2004)

    5. 13

      Metin2 Closed Beta Content (2003-2004)

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.