Correct the definition of "quading"

If you would like your NPCs to use the old rules, turn
Combat:UseLiveCombatRounds to false.
This commit is contained in:
Michael Cook (mackal) 2015-07-05 02:05:50 -04:00
parent 82fe15190b
commit 22efe33f9b
2 changed files with 30 additions and 23 deletions

View File

@ -448,6 +448,7 @@ RULE_BOOL(Combat, OneProcPerWeapon, true) //If enabled, One proc per weapon per
RULE_BOOL(Combat, ProjectileDmgOnImpact, true) //If enabled, projectiles (ie arrows) will hit on impact, instead of instantly. RULE_BOOL(Combat, ProjectileDmgOnImpact, true) //If enabled, projectiles (ie arrows) will hit on impact, instead of instantly.
RULE_BOOL(Combat, MeleePush, true) // enable melee push RULE_BOOL(Combat, MeleePush, true) // enable melee push
RULE_INT(Combat, MeleePushChance, 50) // (NPCs) chance the target will be pushed. Made up, 100 actually isn't that bad RULE_INT(Combat, MeleePushChance, 50) // (NPCs) chance the target will be pushed. Made up, 100 actually isn't that bad
RULE_BOOL(Combat, UseLiveCombatRounds, true) // turn this false if you don't want to worry about fixing up combat rounds for NPCs
RULE_CATEGORY_END() RULE_CATEGORY_END()
RULE_CATEGORY(NPC) RULE_CATEGORY(NPC)

View File

@ -5120,6 +5120,18 @@ bool Client::CheckDualWield()
void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts) void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts)
{ {
if (!target)
return;
if (RuleB(Combat, UseLiveCombatRounds)) {
// A "quad" on live really is just a successful dual wield where both double attack
// The mobs that could triple lost the ability to when the triple attack skill was added in
Attack(target, MainPrimary, false, false, false, opts);
if (CanThisClassDoubleAttack() && CheckDoubleAttack())
Attack(target, MainPrimary, false, false, false, opts);
return;
}
if (IsNPC()) { if (IsNPC()) {
int16 n_atk = CastToNPC()->GetNumberOfAttacks(); int16 n_atk = CastToNPC()->GetNumberOfAttacks();
if (n_atk <= 1) { if (n_atk <= 1) {
@ -5133,7 +5145,6 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts)
Attack(target, MainPrimary, false, false, false, opts); Attack(target, MainPrimary, false, false, false, opts);
} }
if (target) {
// we use this random value in three comparisons with different // we use this random value in three comparisons with different
// thresholds, and if its truely random, then this should work // thresholds, and if its truely random, then this should work
// out reasonably and will save us compute resources. // out reasonably and will save us compute resources.
@ -5149,14 +5160,12 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts)
RandRoll < (GetLevel() + NPCTripleAttackModifier)) { RandRoll < (GetLevel() + NPCTripleAttackModifier)) {
Attack(target, MainPrimary, false, false, false, opts); Attack(target, MainPrimary, false, false, false, opts);
// now lets check the quad attack // now lets check the quad attack
if (GetSpecialAbility(SPECATK_QUAD) && if (GetSpecialAbility(SPECATK_QUAD) && RandRoll < (GetLevel() + NPCQuadAttackModifier)) {
RandRoll < (GetLevel() + NPCQuadAttackModifier)) {
Attack(target, MainPrimary, false, false, false, opts); Attack(target, MainPrimary, false, false, false, opts);
} }
} }
} }
} }
}
void Mob::DoOffHandAttackRounds(Mob *target, ExtraAttackOptions *opts) void Mob::DoOffHandAttackRounds(Mob *target, ExtraAttackOptions *opts)
{ {
@ -5166,11 +5175,8 @@ void Mob::DoOffHandAttackRounds(Mob *target, ExtraAttackOptions *opts)
if (GetSpecialAbility(SPECATK_INNATE_DW) || GetEquipment(MaterialSecondary) != 0) { if (GetSpecialAbility(SPECATK_INNATE_DW) || GetEquipment(MaterialSecondary) != 0) {
if (CheckDualWield()) { if (CheckDualWield()) {
Attack(target, MainSecondary, false, false, false, opts); Attack(target, MainSecondary, false, false, false, opts);
if (CanThisClassDoubleAttack() && GetLevel() > 35) { if (CanThisClassDoubleAttack() && GetLevel() > 35 && CheckDoubleAttack())
if (CheckDoubleAttack()) {
Attack(target, MainSecondary, false, false, false, opts); Attack(target, MainSecondary, false, false, false, opts);
} }
} }
} }
}
}