GC2 Skill Allocator

Needs["GC2`", NotebookDirectory[]<>"GC2_Common.wl"];
P[x_]:=x*(x+1)/2;

tc=240;
b=240;
l=180;
t=120;
c=90;
r=60;
a = 60;
P[tc]+P[b]+P[l]+P[t]+P[c]+P[r]+P[a]
{Mana[tc,b,l,t, a],Kill[tc,b,c,r, a],GlobalPower[tc,b,l,t,c,r,a]}

S=100000;
Clear[tc,b,l,t,c,r,a];

NMaximize[{GlobalPower[tc,b,l,t,c,r,a], P[tc]+P[b]+P[l]+P[t]+P[c]+P[r]+P[a]≤S,tc≥120,b≥120, l≥120,t≥60,c≥45, r≥30,a≥60}, {tc,b,l,t,c,r,a},Integers, MaxIterations-> 1000]

NMaximize[{Mana[tc,b,l,t,a], P[tc]+P[b]+P[l]+P[t]+P[a]≤S,tc≥45,b ≥45, l≥45,t≥45,a≥30},{tc,b,l,t,a},Integers, MaxIterations-> 1000]

NMaximize[{Kill[tc,b,c,r,a], P[tc]+P[b]+P[c]+P[r]+P[a]≤S,tc≥45,b ≥45,c≥45, r≥45,a≥30},{tc,b,c,r,a},Integers, MaxIterations-> 1000]

Non premium

gl8= 0.491;
gc11= 1.142;
Mn[tc_,l_,t_,a_]:=TCs[tc]*Leech[l]*Traps[t]*AmpsMana[tc, a];
Kn[tc_,c_,r_,a_]:=TCd[tc]*TCs[tc]*Crit[c]*Reson[r]*AmpsKill[tc, a];
GPn[tc_,l_,t_,c_,r_,a_]:=Mn[tc,l,t,a]^(gc11/(1-gl8))*Kn[tc,c,r,a]
S=10000;
Clear[tc,b,l,t,c,r,a];

NMaximize[{GPn[tc,l,t,c,r,a], P[tc]+P[l]+P[t]+P[c]+P[r]+P[a]≤S,tc≥45, l≥45,t≥30,c≥24, r≥18,a≥24}, {tc,l,t,c,r,a},Integers, MaxIterations-> 1000]

Exporter loop

Off[General::stop];
Export[NotebookDirectory[]<>"skill_table.csv",
Prepend[
{#[[1]],#[[2,1]],tc,b,l,t,c,r,a}/.#[[2,2]]&/@
ParallelTable[{S,#}&@Quiet@
NMaximize[{GlobalPower[tc,b,l,t,c,r,a], Total[P/@{tc,b,l,t,c,r,a}]≤S,Floor[Sqrt[2S]/100]≤#≤Floor[Sqrt[2S]]&/@{tc,b,l,t,c,r,a}}, {tc,b,l,t,c,r,a},Integers, MaxIterations-> 1000]
,{S,10000,400000,5000}
],{"Skill Points","Global Power","True Colors","Bloodbound","Leech","Traps","Critical Hit","Resonance","Amps"}
]
]

Off[General::stop];
Export[NotebookDirectory[]<>"skill_table_np_black.csv",
Prepend[
{#[[1]],#[[2,1]],tc,l,t,c,r,a}/.#[[2,2]]&/@
ParallelTable[{S,#}&@Quiet@
NMaximize[{GlobalPower[tc,0,l,t,c,r,a], Total[P/@{tc,l,t,c,r,a}]≤S,Floor[Sqrt[2S]/100]≤#≤Floor[Sqrt[2S]]&/@{tc,l,t,c,r,a}}, {tc,l,t,c,r,a},Integers, MaxIterations-> 1000]
,{S,5000,30000,5000}
],{"Skill Points","Global Power","True Colors","Leech","Traps","Critical Hit","Resonance","Amps"}
]
]

Off[General::stop];
Export[NotebookDirectory[]<>"skill_table_np_noblack.csv",
Prepend[
{#[[1]],#[[2,1]],tc,l,t,c,r,a}/.#[[2,2]]&/@
ParallelTable[{S,#}&@Quiet@
NMaximize[{GPn[tc,l,t,c,r,a], Total[P/@{tc,l,t,c,r,a}]≤S,Floor[Sqrt[2S]/100]≤#≤Floor[Sqrt[2S]]&/@{tc,l,t,c,r,a}}, {tc,l,t,c,r,a},Integers, MaxIterations-> 1000]
,{S,5000,30000,5000}
],{"Skill Points","Global Power","True Colors","Leech","Traps","Critical Hit","Resonance","Amps"}
]
]