[Bug Fix] Rampage Number of Hits Limit (#3929)

* [Bug Fix] Rampage Number of Hits Limit

Rampage should Hit 1-2 times (Primary / Secondary) should not be Triple/Quadable

* requested name convention changes
This commit is contained in:
Fryguy
2024-01-09 05:48:45 -05:00
committed by GitHub
parent 1b5b22eeca
commit d0e069f4f8
3 changed files with 38 additions and 26 deletions
+15 -12
View File
@@ -6446,10 +6446,11 @@ bool Client::CheckDualWield()
return zone->random.Int(1, 375) <= chance;
}
void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts)
void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts, bool rampage)
{
if (!target)
if (!target) {
return;
}
if (RuleB(Combat, UseLiveCombatRounds)) {
// A "quad" on live really is just a successful dual wield where both double attack
@@ -6459,8 +6460,9 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts)
Attack(target, EQ::invslot::slotPrimary, false, false, false, opts);
if ((IsPet() || IsTempPet()) && IsPetOwnerClient()) {
int chance = spellbonuses.PC_Pet_Flurry + itembonuses.PC_Pet_Flurry + aabonuses.PC_Pet_Flurry;
if (chance && zone->random.Roll(chance))
if (chance && zone->random.Roll(chance)) {
Flurry(nullptr);
}
}
}
return;
@@ -6468,16 +6470,14 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts)
if (IsNPC()) {
int16 n_atk = CastToNPC()->GetNumberOfAttacks();
if (n_atk <= 1) {
if (n_atk <= 1 || rampage) {
Attack(target, EQ::invslot::slotPrimary, false, false, false, opts);
}
else {
} else {
for (int i = 0; i < n_atk; ++i) {
Attack(target, EQ::invslot::slotPrimary, false, false, false, opts);
}
}
}
else {
} else {
Attack(target, EQ::invslot::slotPrimary, false, false, false, opts);
}
@@ -6503,10 +6503,12 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts)
}
}
void Mob::DoOffHandAttackRounds(Mob *target, ExtraAttackOptions *opts)
void Mob::DoOffHandAttackRounds(Mob *target, ExtraAttackOptions *opts, bool rampage)
{
if (!target)
if (!target) {
return;
}
// Mobs will only dual wield w/ the flag or have a secondary weapon
// For now, SPECATK_QUAD means innate DW when Combat:UseLiveCombatRounds is true
if ((GetSpecialAbility(SPECATK_INNATE_DW) ||
@@ -6514,13 +6516,14 @@ void Mob::DoOffHandAttackRounds(Mob *target, ExtraAttackOptions *opts)
GetEquippedItemFromTextureSlot(EQ::textures::weaponSecondary) != 0) {
if (CheckDualWield()) {
Attack(target, EQ::invslot::slotSecondary, false, false, false, opts);
if (CanThisClassDoubleAttack() && GetLevel() > 35 && CheckDoubleAttack()) {
if (CanThisClassDoubleAttack() && GetLevel() > 35 && CheckDoubleAttack() && !rampage) {
Attack(target, EQ::invslot::slotSecondary, false, false, false, opts);
if ((IsPet() || IsTempPet()) && IsPetOwnerClient()) {
int chance = spellbonuses.PC_Pet_Flurry + itembonuses.PC_Pet_Flurry + aabonuses.PC_Pet_Flurry;
if (chance && zone->random.Roll(chance))
if (chance && zone->random.Roll(chance)) {
Flurry(nullptr);
}
}
}
}