Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-26-2008, 06:31 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default Double Attack change

I think the Client::CheckDoubleAttack() method needs some modifications. Here it is currently:
Code:
bool Client::CheckDoubleAttack(bool AAadd, bool Triple) {
	int skill = 0;
	if (Triple)
	{
		if(!HasSkill(DOUBLE_ATTACK))
			return(false);
		
		if (GetClass() == MONK || GetClass() == WARRIOR || GetClass() == RANGER || GetClass() == BERSERKER)
		{
			skill = GetSkill(DOUBLE_ATTACK)/2;
		} else {
			return(false);
		}
	}
	else
	{
		
		//should these stack with skill, or does that ever even happen?
		int aaskill = GetAA(aaBestialFrenzy)*25 + GetAA(aaHarmoniousAttack)*25
			+ GetAA(aaKnightsAdvantage)*25 + GetAA(aaFerocity)*25;
			
		if (!aaskill && !HasSkill(DOUBLE_ATTACK))
		{
			return false;
		}
		skill = GetSkill(DOUBLE_ATTACK) + aaskill;
		
		//discipline effects
		skill += (spellbonuses.DoubleAttackChance + itembonuses.DoubleAttackChance) * 3;
		
		if(skill < 300)	//only gain if we arnt garunteed
			CheckIncreaseSkill(DOUBLE_ATTACK);
	}
	if(MakeRandomInt(0, 299) < skill)
	{
		return true;
	}
	return false;
}
The first thing needing changes is the first argument bool AAadd, it doesn't get used anywhere in the method.
Next is the aa bonus *25 is too high. Max double attack skill for a 65 warrior is 255. In the following check if(skill < 300) if a warrior had only 225 skill + all 3 Ferocity AA's, the warrior would never skill up past 225 to max but would always double attack anyway in the random check below that. The magic number 299 is used there. If max skill and max ferocity, the warrior would always double attack. I think with the bonuses you should get real close to always, but not 100%. Rogue and Bards get a discipline that gives the a 10000% bonus so that's the only guarantee I know of.

Here's how I've rewritten the mentod. What do you think?
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
	int class = GetClass();

        // The current skill level
	int skill = GetSkill(DOUBLE_ATTACK);

        // Discipline bonuses give you 100% chance to double attack
	int buffs = (spellbonuses.DoubleAttackChance + itembonuses.DoubleAttackChance) * 3;

        // The maximum value for the Class based on the server rule of MaxLevel
	int maxSkill = MaxSkill(DOUBLE_ATTACK, class, RuleI(Character, MaxLevel));

        // AA bonuses for the melee classes
	int aaBonus = GetAA(aaBestialFrenzy)*10 +
                        GetAA(aaHarmoniousAttack)*10 +
                        GetAA(aaKnightsAdvantage)*10 +
                        GetAA(aaFerocity)*10 +
                        GetAA(aaDanceofBlades)*10;


        // Half of Double Attack Skill used to check chance for Triple Attack
	if(TripleAttack) {
                // Only some Double Attack classes get Triple Attack
                if(class == MONK || class == WARRIOR || class == RANGER || class == BERSERKER) {
                        // We only get half the skill, but should get all the bonuses
                        chance = (skill/2) + buffs + aaBonus;
		}
		else {
			return false;
		}
	}
	else {
                // This is the actual Double Attack chance
		chance = skill + buffs + aaBonus;

                // You can gain skill even if you don't successfully double attack,
                // but put it here so you don't skill up on triple attacks
                CheckIncreaseSkill(DOUBLE_ATTACK);
	}

        // If your chance is greater than the RNG you are successful!
	if(chance > MakeRandomInt(0, maxSkill*.92)) {
		return true;
	}

	return false;
}
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 01:02 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3