Jump to content
×
×
  • Create New...
  • 0

Quiver Unlimited Arrows function for Distance Damage


Veneno

Question

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

  • Answers 11
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

11 answers to this question

Recommended Posts

  • 0

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

  • 0
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;

http://prntscr.com/96fkw9

Link to comment
Share on other sites

  • 0
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;

http://prntscr.com/96fkw9

You cant use item ID for this, use subtype.

Link to comment
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


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.