mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-25 12:42:25 +00:00
[Rules] Add Archery/Throwing Ammo Consumption Rules. (#1743)
- Add RULE_BOOL(Combat, ArcheryConsumesAmmo, true, "Set to false to disable Archery Ammo Consumption") - Add RULE_BOOL(Combat, ThrowingConsumesAmmo, true, "Set to false to disable Throwing Ammo Consumption")
This commit is contained in:
parent
3c87480553
commit
8b83a13560
@ -489,6 +489,8 @@ RULE_BOOL(Combat, UseExtendedPoisonProcs, false, "Allow old school poisons to la
|
|||||||
RULE_BOOL(Combat, EnableSneakPull, false, "Enable implementation of Sneak Pull")
|
RULE_BOOL(Combat, EnableSneakPull, false, "Enable implementation of Sneak Pull")
|
||||||
RULE_INT(Combat, SneakPullAssistRange, 400, "Modified range of assist for sneak pull")
|
RULE_INT(Combat, SneakPullAssistRange, 400, "Modified range of assist for sneak pull")
|
||||||
RULE_BOOL(Combat, Classic2HBAnimation, false, "2HB will use the 2 hand piercing animation instead of the overhead slashing animation")
|
RULE_BOOL(Combat, Classic2HBAnimation, false, "2HB will use the 2 hand piercing animation instead of the overhead slashing animation")
|
||||||
|
RULE_BOOL(Combat, ArcheryConsumesAmmo, true, "Set to false to disable Archery Ammo Consumption")
|
||||||
|
RULE_BOOL(Combat, ThrowingConsumesAmmo, true, "Set to false to disable Throwing Ammo Consumption")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
RULE_CATEGORY(NPC)
|
RULE_CATEGORY(NPC)
|
||||||
|
|||||||
@ -756,11 +756,22 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
|
|||||||
//EndlessQuiver AA base1 = 100% Chance to avoid consumption arrow.
|
//EndlessQuiver AA base1 = 100% Chance to avoid consumption arrow.
|
||||||
int ChanceAvoidConsume = aabonuses.ConsumeProjectile + itembonuses.ConsumeProjectile + spellbonuses.ConsumeProjectile;
|
int ChanceAvoidConsume = aabonuses.ConsumeProjectile + itembonuses.ConsumeProjectile + spellbonuses.ConsumeProjectile;
|
||||||
|
|
||||||
if (RangeItem->ExpendableArrow || !ChanceAvoidConsume || (ChanceAvoidConsume < 100 && zone->random.Int(0,99) > ChanceAvoidConsume)){
|
// Consume Ammo, unless Ammo Consumption is disabled or player has Endless Quiver
|
||||||
|
bool consumes_ammo = RuleB(Combat, ArcheryConsumesAmmo);
|
||||||
|
if (
|
||||||
|
consumes_ammo &&
|
||||||
|
(
|
||||||
|
RangeItem->ExpendableArrow ||
|
||||||
|
!ChanceAvoidConsume ||
|
||||||
|
(ChanceAvoidConsume < 100 && zone->random.Int(0,99) > ChanceAvoidConsume)
|
||||||
|
)
|
||||||
|
) {
|
||||||
DeleteItemInInventory(ammo_slot, 1, true);
|
DeleteItemInInventory(ammo_slot, 1, true);
|
||||||
LogCombat("Consumed one arrow from slot [{}]", ammo_slot);
|
LogCombat("Consumed Archery Ammo from slot {}.", ammo_slot);
|
||||||
|
} else if (!consumes_ammo) {
|
||||||
|
LogCombat("Archery Ammo Consumption is disabled.");
|
||||||
} else {
|
} else {
|
||||||
LogCombat("Endless Quiver prevented ammo consumption");
|
LogCombat("Endless Quiver prevented Ammo Consumption.");
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckIncreaseSkill(EQ::skills::SkillArchery, GetTarget(), -15);
|
CheckIncreaseSkill(EQ::skills::SkillArchery, GetTarget(), -15);
|
||||||
@ -1338,8 +1349,14 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
|
|||||||
|
|
||||||
DoThrowingAttackDmg(other, RangeWeapon, item);
|
DoThrowingAttackDmg(other, RangeWeapon, item);
|
||||||
|
|
||||||
//consume ammo
|
// Consume Ammo, unless Ammo Consumption is disabled
|
||||||
DeleteItemInInventory(ammo_slot, 1, true);
|
if (RuleB(Combat, ThrowingConsumesAmmo)) {
|
||||||
|
DeleteItemInInventory(ammo_slot, 1, true);
|
||||||
|
LogCombat("Consumed Throwing Ammo from slot {}.", ammo_slot);
|
||||||
|
} else {
|
||||||
|
LogCombat("Throwing Ammo Consumption is disabled.");
|
||||||
|
}
|
||||||
|
|
||||||
CommonBreakInvisibleFromCombat();
|
CommonBreakInvisibleFromCombat();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user