×
×
• Create New...
• 0

# Quiver Unlimited Arrows function for Distance Damage

## 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?

• Created

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

##### 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;

##### 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;

You cant use item ID for this, use subtype.

##### Share on other sites

• 0

But in item_proto quiver has a subtype of ARROW

##### Share on other sites

• 0
4 minutes ago, Veneno said:

But in item_proto quiver has a subtype of ARROW

Archery Quiver System is much more than this, make different subtype only for quiver, the subtype should be called WEAPON_QUIVER

##### Share on other sites

• 0

Thanks  I will try

##### Share on other sites

• 0
Just now, Veneno said:

Thanks  I will try

Good luck.

##### Share on other sites

• 0

Hey I fixed it by ItemVnum finally  I just had to insert a double =

Oh, btw can anybody give me a tut about adding the blue arrow effect at the quiver?

##### Share on other sites

• 0
9 minutes ago, Veneno said:

Hey I fixed it by ItemVnum finally  I just had to insert a double =

Good.

##### Share on other sites

• 0

Does anybody have a tut for the blue arrow effect? (Source - dinary - packs)

##### Share on other sites

• 0

and if i want use this system with all arrow I only need to

int iPercent = 100 - (iGap * 5);

Replace to

int iPercent = 100;

?

## Create an account

Register a new account

1. 0

2. 11

3. 870

4. 0

5. 0

6. 1

7. 0

8. 0

9. 0