Log in

View Full Version : Skill to % chance?


Kika Maslyaka
05-16-2011, 01:55 PM
Does anyone knows an aproximate formula how does my skill in Double Attack and Dual Wield translate into actual chance to hit?

So I have DW skill at 100 - what is the actual chance?
150? 200?
DA of a 100?
DA on off hand?

thanks!

Nagash
05-16-2011, 02:30 PM
That's a very good question :) The closest I could find is the last post here (http://everquest.allakhazam.com/forum.html?forum=1&mid=108197087661488626&howmany=50), not sure how true it is though.

naez
05-16-2011, 02:35 PM
bool Client::CheckDoubleAttack(bool tripleAttack) {

// If you don't have the double attack skill, return
if(!HasSkill(DOUBLE_ATTACK) && !(GetClass() == BARD || GetClass() == BEASTLORD))
return false;

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

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

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

// Discipline bonuses give you 100% chance to double attack
sint16 buffs = spellbonuses.DoubleAttackChance + itembonuses.DoubleAttackChance;

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

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

// Bard Dance of Blades Double Attack bonus is not cumulative
if(GetAA(aaDanceofBlades)) {
aaBonus += 500;
}

// Half of Double Attack Skill used to check chance for Triple Attack
if(tripleAttack) {
// Only some Double Attack classes get Triple Attack
if((classtype == MONK) || (classtype == WARRIOR) || (classtype == RANGER) || (classtype == 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;
}

// If your chance is greater than the RNG you are successful! Always have a 5% chance to fail at max skills+bonuses.
if(chance > MakeRandomInt(0, (maxSkill + itembonuses.DoubleAttackChance + aaBonus)*1.05)) {
return true;
}

return false;
}

Kika Maslyaka
05-16-2011, 03:07 PM
Ok, to complite the calculations then, I need to know what is the maxskill?
is that per class or universal for all?

Extunarian
05-16-2011, 03:07 PM
If the public emu snippied naez posted hasn't been changed for this server, it looks like the calculation is simply

% chance to double attack = (your skill) / [(max skill for your class at max level)*1.05]

right?

Kika Maslyaka
05-16-2011, 03:09 PM
yeah but we need to know where maxskill comes from and what its set for

naez
05-16-2011, 03:14 PM
Can't recall the max skill for level 60, and dual wield is more complicated to find the calculation for (i.e. can only find HAND==14 (secondary) in attack.cpp and I don't have Visual Studio installed, +lazy)

Extunarian
05-16-2011, 03:16 PM
yeah but we need to know where maxskill comes from and what its set for

The code says it's the max your class can get to given the server's max level:

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

Doesn't really make sense to me though...if it went by your class' max skill then classes with a lower maximum skill would be at an advantage until it was maxed out, and then they would just have the same 95% chance as those with a higher max skill...

Kika Maslyaka
05-16-2011, 03:18 PM
yeah exactly. would be no point for say warrior to have higher skill than a ranger

maxskill must be universal for all classes, or it doesn't make sence

Doors
05-16-2011, 03:18 PM
All hail naez master of java

naez
05-16-2011, 04:49 PM
yeah exactly. would be no point for say warrior to have higher skill than a ranger

maxskill must be universal for all classes, or it doesn't make sence

The MaxSkill() function is used for all skills, not just universal ones. Maybe Bard/Druid tracking is capped lower than Ranger? I think casters and hybrid weapon skills have a lower cap than pure melees. Can't think of other examples but I'm sure the arguments are that way for any number of reasons, so even though class might not matter in this instance you still have to feed it in.

I think in the end just running GameParse or something to find the % would be easier than trying to reverse engineer all the different calculations. Then you find out hit/miss rates and other things related to the spirit of the original question.

Ravhin
05-16-2011, 05:00 PM
Do believe "MaxSkill" is just a constant, something like 400 in this case.