Awesome mod! We use it at
http://www.weplayciv.com and it's very popular with our players.
However there is a SEVERE error in how the AR and DR are calculated. Using the supplied formulas the effect of a promotion affects every unit in the army, not a single unit. Also to note in the original formula, natural attack/defense bonus of the Civ is not calculated unless the player has a promotion (multiply by zero issue). Thus the most efficient use of converting gold to AR/DR is to purchase level 1 or 2 promotions. Forget upgrades as the bonus is massively less than spending the equivalent on promotions. Like I'm talking many thousands of AR/DR points.
So with that in mind I've created new formulas to calculate both ratings correctly, where a promotion is only applied to a single unit and upgrades affect the entire army. This has fixed all the inbalance for us.
The below code replaces the same functions in functions_conquest.php in your Conquest folder in the forums.
Code:
function fetch_offense($player)
{
global $vbulletin;
$weapons = $vbulletin->db->query_read("SELECT * FROM ".TABLE_PREFIX."conquest_stock AS conquest_stock
LEFT JOIN ".TABLE_PREFIX."conquest_weapons AS conquest_weapons ON conquest_stock.stockID = conquest_weapons.weaponID
WHERE conquest_stock.playerID = ".$player[playerID]." AND conquest_stock.stockType = 'weapon'
ORDER BY conquest_weapons.wPower DESC
");
$count = array();
while ($weapon = $vbulletin->db->fetch_array($weapons))
{
for ($i = 0; $i < $weapon[stockCount]; $i++)
{
array_push($count, ($player[oPower] * ($weapon[wPower] / 100)));
}
}
$power = 1 + ((array_sum(array_slice($count, 0, $player[pTroops])) + ($player[pTroops] * $player[oPower])) * ((100 + $player[nOffense]) / 100));
return $power;
}
function fetch_defense($player)
{
global $vbulletin;
$armours = $vbulletin->db->query_read("SELECT * FROM ".TABLE_PREFIX."conquest_stock AS conquest_stock
LEFT JOIN ".TABLE_PREFIX."conquest_armours AS conquest_armours ON conquest_stock.stockID = conquest_armours.armourID
WHERE conquest_stock.playerID = ".$player[playerID]." AND conquest_stock.stockType = 'armour'
ORDER BY conquest_armours.aPower DESC
");
$count = array();
while ($armour = $vbulletin->db->fetch_array($armours))
{
for ($i = 0; $i < $armour[stockCount]; $i++)
{
array_push($count, ($player[dPower] * ($armour[aPower] / 100)));
}
}
$power = 1 + ((array_sum(array_slice($count, 0, $player[pTroops])) + ($player[pTroops] * $player[dPower])) * ((100 + $player[nDefense]) / 100));
return $power;
}