![]() |
|
|
|
#1
|
||||
|
Quote:
| |||
|
|
||||
|
#2
|
||||
|
Quote:
__________________
| |||
|
|
||||
|
#3
|
|||
|
Atk affects the skewness of the hit distribution curve. General rule on live during Velious was that 10 atk = 1% dps increase at around 1000 atk vs level 60ish npcs. There's going to be some second derivative action going on making it hard to predict exactly how atk alters the curve, especially without hard numbers.
| ||
|
Last edited by koros; 02-21-2014 at 11:33 AM..
|
|
||
|
#5
|
|||
|
I was just about to post that (was reading attack.cpp myself).
Important part: Code:
// This is called when the Mob is the one being hit
int32 Mob::GetMeleeMitDmg(Mob *attacker, int32 damage, int32 minhit,
float mit_rating, float atk_rating)
{
float d = 10.0;
float mit_roll = MakeRandomFloat(0, mit_rating);
float atk_roll = MakeRandomFloat(0, atk_rating);
if (atk_roll > mit_roll) {
float a_diff = atk_roll - mit_roll;
float thac0 = atk_rating * RuleR(Combat, ACthac0Factor);
float thac0cap = attacker->GetLevel() * 9 + 20;
if (thac0 > thac0cap)
thac0 = thac0cap;
d -= 10.0 * (a_diff / thac0);
} else if (mit_roll > atk_roll) {
float m_diff = mit_roll - atk_roll;
float thac20 = mit_rating * RuleR(Combat, ACthac20Factor);
float thac20cap = GetLevel() * 9 + 20;
if (thac20 > thac20cap)
thac20 = thac20cap;
d += 10.0 * (m_diff / thac20);
}
if (d < 0.0)
d = 0.0;
else if (d > 20.0)
d = 20.0;
float interval = (damage - minhit) / 20.0;
damage -= ((int)d * interval);
damage -= (minhit * itembonuses.MeleeMitigation / 100);
damage -= (damage * spellbonuses.MeleeMitigation / 100);
return damage;
}
Code:
if (GetClass() == WIZARD || GetClass() == MAGICIAN ||
GetClass() == NECROMANCER || GetClass() == ENCHANTER)
mitigation_rating = ((GetSkill(SkillDefense) + itembonuses.HeroicAGI/10) / 4.0) + armor + 1;
else
mitigation_rating = ((GetSkill(SkillDefense) + itembonuses.HeroicAGI/10) / 3.0) + (armor * 1.333333) + 1;
mitigation_rating *= 0.847;
mitigation_rating = mod_mitigation_rating(mitigation_rating, attacker);
if (attacker->IsClient())
attack_rating = (attacker->CastToClient()->CalcATK() + ((attacker->GetSTR()-66) * 0.9) + (attacker->GetSkill(SkillOffense)*1.345));
else
attack_rating = (attacker->GetATK() + (attacker->GetSkill(SkillOffense)*1.345) + ((attacker->GetSTR()-66) * 0.9));
attack_rating = attacker->mod_attack_rating(attack_rating, this);
damage = GetMeleeMitDmg(attacker, damage, minhit, mitigation_rating, attack_rating);
__________________
Realtime auction logger: http://ahungry.com/eqauctions/
| ||
|
|
|||
|
#6
|
|||
|
lol, haven't seen code with THAC0's in it for a while.
__________________
The Ancient Ranger
Awake again. | ||
|
|
|||
|
#7
|
|||
|
Skill does increase ATK, but it's not ATK that affects chance to hit.
__________________
Gnawlunzs Phrogphry
Master Angler, Baker, Cadger, Drunk "If you can't eat a frog, then eat two." | ||
|
|
|||
|
#8
|
|||
|
So I'm at work Monday and just looking at all this code (I didn't look during the weekend, I was busy playing, duh).
I'm able to decipher bits and pieces of the code but it looks like there are variables that are referenced elsewhere in the code. It's like trying to read a book in Spanish when you only know half the language. Does anyone know how floats work? Specifically these functions float mit_roll = MakeRandomFloat(0, mit_rating); float atk_roll = MakeRandomFloat(0, atk_rating); MakeRandomFloat is some sort of function with the inputs of "0" and "mit_rating" or "atk_rating" which are calculated elsewhere. What does MakeRandomFloat do? THAC0 stands for "To Hit AC 0" correct? | ||
|
Last edited by Mirana; 02-24-2014 at 09:40 AM..
|
|
||
|
#9
|
||||
|
Quote:
MakeRandomFloat(a,b) will return a random value between a and b. MakeRandomFloat(0, 10) will return a random real number between 0 and 10. You are correct on THAC0. | |||
|
Last edited by imajester; 02-24-2014 at 10:10 AM..
|
|
|||
|
#10
|
||||
|
Quote:
It's making a roll between 0 and the rating. | |||
|
|
||||
![]() |
|
|