Exemplo n.º 1
0
int32 Client::GetACAvoid() {

	int32 avoidance = (acmod() + ((GetSkill(SkillDefense) + itembonuses.HeroicAGI/10)*16)/9);
	if (avoidance < 0)
		avoidance = 0;

	return(avoidance*1000/847);
}
Exemplo n.º 2
0
int32 Client::GetACAvoid() {

	int32 avoidance = (acmod() + ((GetSkill(SkillDefense))*16)/9);
	if (avoidance < 0)
		avoidance = 0;

	return(avoidance*1000/847);
}
Exemplo n.º 3
0
int16 Client::GetACAvoid() {

	int avoidance = (acmod() + ((GetSkill(DEFENSE) + itembonuses.HeroicAGI/10)*16)/9);
	if (avoidance < 0)
		avoidance = 0;
		
	return(avoidance*1000/847);
}
Exemplo n.º 4
0
// This is a testing formula for AC, the value this returns should be the same value as the one the client shows...
// ac1 and ac2 are probably the damage migitation and damage avoidance numbers, not sure which is which.
// I forgot to include the iksar defense bonus and i cant find my notes now...
// AC from spells are not included (cant even cast spells yet..)
int32 Client::CalcAC()
{
	// new formula
	int avoidance = (acmod() + ((GetSkill(SkillDefense) + itembonuses.HeroicAGI / 10) * 16) / 9);
	if (avoidance < 0) {
		avoidance = 0;
	}
	int mitigation = 0;
	if (m_pp.class_ == WIZARD || m_pp.class_ == MAGICIAN || m_pp.class_ == NECROMANCER || m_pp.class_ == ENCHANTER) {
		//something is wrong with this, naked casters have the wrong natural AC
//		mitigation = (spellbonuses.AC/3) + (GetSkill(DEFENSE)/2) + (itembonuses.AC+1);
		mitigation = (GetSkill(SkillDefense) + itembonuses.HeroicAGI / 10) / 4 + (itembonuses.AC + 1);
		//this might be off by 4..
		mitigation -= 4;
	}
	else {
//		mitigation = (spellbonuses.AC/4) + (GetSkill(DEFENSE)/3) + ((itembonuses.AC*4)/3);
		mitigation = (GetSkill(SkillDefense) + itembonuses.HeroicAGI / 10) / 3 + ((itembonuses.AC * 4) / 3);
		if (m_pp.class_ == MONK) {
			mitigation += GetLevel() * 13 / 10;    //the 13/10 might be wrong, but it is close...
		}
	}
	int displayed = 0;
	displayed += ((avoidance + mitigation) * 1000) / 847;	//natural AC
	//Iksar AC, untested
	if (GetRace() == IKSAR) {
		displayed += 12;
		int iksarlevel = GetLevel();
		iksarlevel -= 10;
		if (iksarlevel > 25) {
			iksarlevel = 25;
		}
		if (iksarlevel > 0) {
			displayed += iksarlevel * 12 / 10;
		}
	}
	// Shield AC bonus for HeroicSTR
	if (itembonuses.HeroicSTR) {
		bool equiped = CastToClient()->m_inv.GetItem(MainSecondary);
		if (equiped) {
			uint8 shield = CastToClient()->m_inv.GetItem(MainSecondary)->GetItem()->ItemType;
			if (shield == ItemTypeShield) {
				displayed += itembonuses.HeroicSTR / 2;
			}
		}
	}
	//spell AC bonuses are added directly to natural total
	displayed += spellbonuses.AC;
	AC = displayed;
	return (AC);
}
Exemplo n.º 5
0
// This is a testing formula for AC, the value this returns should be the same value as the one the client shows...
// ac1 and ac2 are probably the damage migitation and damage avoidance numbers, not sure which is which.
// I forgot to include the iksar defense bonus and i cant find my notes now...
// AC from spells are not included (cant even cast spells yet..)
int32 Client::CalcAC() {

	// new formula
	int avoidance = (acmod() + (GetSkill(SkillDefense)*16)/9);
	if (avoidance < 0)
		avoidance = 0;

	int mitigation = 0;
	if (m_pp.class_ == WIZARD || m_pp.class_ == MAGICIAN || m_pp.class_ == NECROMANCER || m_pp.class_ == ENCHANTER) {
		//something is wrong with this, naked casters have the wrong natural AC
//		mitigation = (spellbonuses.AC/3) + (GetSkill(DEFENSE)/2) + (itembonuses.AC+1);
		mitigation = GetSkill(SkillDefense)/4 + (itembonuses.AC+1);
		//this might be off by 4..
		mitigation -= 4;
	} else {
//		mitigation = (spellbonuses.AC/4) + (GetSkill(DEFENSE)/3) + ((itembonuses.AC*4)/3);
		mitigation = GetSkill(SkillDefense)/3 + ((itembonuses.AC*4)/3);
		if(m_pp.class_ == MONK)
			mitigation += GetLevel() * 13/10;	//the 13/10 might be wrong, but it is close...
	}
	int displayed = 0;
	displayed += ((avoidance+mitigation)*1000)/847;	//natural AC

	//Iksar AC, untested
	if (GetRace() == IKSAR) {
		displayed += 12;
		int iksarlevel = GetLevel();
		iksarlevel -= 10;
		if (iksarlevel > 25)
			iksarlevel = 25;
		if (iksarlevel > 0)
			displayed += iksarlevel * 12 / 10;
	}

	//spell AC bonuses are added directly to natural total
	displayed += spellbonuses.AC;

	AC = displayed;
	return(AC);
}