View Single Post
  #1  
Old 10-14-2009, 05:22 PM
Skomag
Fire Beetle
 
Join Date: Jul 2009
Location: no where
Posts: 5
Default Double Attack for bards and beastlords

Bards and Beastlords don't normally have the double attack skill until they put points in an AA. From a post I found, for beastlords at least, each point should be 3% for 15% max chance to double attack.

Looking at attack.cpp's Client::CheckDoubleAttack(), it will immediately return false for beastlords and bards, even with the aa trained, because HasSkill() returns false since there's no skill_cap entry for them. Initially I thought that HasSkill() could be changed to CanThisClassDoubleAttack(), but in looking at the rest of the function, since there's 0 skill and 0 max skill, bard/bst would be double attacking a lot. Instead I've come up with this patch:

Code:
  bool Client::CheckDoubleAttack(bool tripleAttack) {
-
-       // If you don't have the double attack skill, return
-       if(!HasSkill(DOUBLE_ATTACK))
-               return false;

        // You start with no chance of double attacking
        int chance = 0;

        // Used for maxSkill and triple attack calcs
        int8 classtype = GetClass();

+       // If you don't have the double attack skill, return
+       if(!HasSkill(DOUBLE_ATTACK)) {
+               // Bard and Beastlord can only double attack with AA - 3% per rank, 15% max
+               if((classtype == BEASTLORD) || (classtype == BARD)) {
+                       if(classtype == BEASTLORD) chance = 3 * GetAA(aaBestialFrenzy);
+                       if(classtype == BARD) chance = 3 * GetAA(aaHarmoniousAttack);
+                       if(chance > 0 && chance > MakeRandomInt(0, 99)) {
+                               return true;
+                       }
+               }
+               return false;
+       }
+
        // The current skill level
        uint16 skill = GetSkill(DOUBLE_ATTACK);
With the rest left as is, including the check again for the harmonious/frenzy aas. This way, a server could decide to give bard/bst double attack skill by default and let the AA increase their chances.

I just tested this fix on latest build and after 500 rounds of combat, beastlord with 5 points in AA double attacked 62 times (15.5%). Also checked a bard for a few and looked good.
Reply With Quote