I have written a program for calculating the best skillpointallocation with limited points to maximize the fireballdamage in Diablo 2.
But there is a case where it's slightly off, because of the way you have to put points into prerequisiteskills.
The formula for the fireballdamage is:
damage$=$fireballbasedamage$\times (1.23+(0.07\times ($masterypoints+firemastery+fireskills$))+($fire percentage on gear$)/ 100 )\times ( 1 + ( 0.14 \times ( $synergy$)))$
where fireballbasedamage is the damage without any synergypoints nor mastery but with +skills and +fireball.
masterypoints are spent points into the mastery.
firemastery are additional points from gear (as you see it makes no difference, wether you have 20 hard points without any gear or only 20 points with gear).
fireskills are any skills that the gear grants, wether it is +sorceress or +fireskills (again it makes no difference).
synergy are hard points into the synergies, namely Firebolt and Meteor.
The first point into Meteor requires 3 points into its requisiteskills.
And now I'm looking for an elegant solution (not bruteforce) for the following problem:
Hard points into Fireball$=20$
Firebolt$=20$ (one of the synergies, it can't go higher than this)
$0\leq$masterypoints$<20$
Let $x$ be the rest of skillpoints to allocate.
How big has $x$ to be, that it makes sense to put $3$ points into the requisiteskills of Meteor to eventually put points into Meteor, rather than simply putting them into Firemastery?
In dependancy of all other unknown variables.
For simplicity firemastery and fireskills can be added together and therefore be called $y$ and is fixed.
fire percentage on gear is now $z$ and is fixed
Therefore the formula changes to
damage$=$fireballbasedamage$\times (1.23+(0.07\times ($masterypoints$+y))+z/100)\times (1+(0.14\times ($synergy$)))$
Obviously $x=$ additional points into the firemastery$+$ additional points into synergy.
Also for $x\leq 3$ it's trivial, and you should put all points into the mastery.
I don't know how to tackle this problem except by bruteforce (aka unelegant).
Let me know if anything is unclear or if I used too many words for describing the problem.
For completeness, the fireballbasedamage is calculated by skilllevel and not linear:
Level 1-8 9-16 17-22 23-28 >28
Min Fire Damage (6.5*slvl)-0.5 (11.5*slvl)-40.5 (14*slvl)-80.5 (16.5*slvl)-135.5 (19*slvl)-205.5
Max Fire Damage (7.5*slvl)+6.5 (12.5*slvl)-33.5 (15*slvl)-73.5 (17.5*slvl)-128.5 (20*slvl)-198.5