well its just an example, the current one is already working in my script
setarray .@str[1],30000,30050,30100; // item IDs of lvl 1/2/3/.... enchantmentStones
setarray .@dex[1],30001,30051,30101
// ^ the same with int / agi / vit / luk
_statpoints:
mes "["+strnpcinfo(1)+"]";
mes "And wich statpoint should I apply?";
set .@menu,select("Str:Dex:Int:Vit:Agi:Luk");
switch (.@menu) {
case 1:
set .@bonus, callfunc("GetBonusLevel", .@str, .@currentBonus, .@maxEnchantmentLevel, .@defaultEnchantmentLevel);
break;
case 1:
set .@bonus, callfunc("GetBonusLevel", .@dex, .@currentBonus, .@maxEnchantmentLevel, .@defaultEnchantmentLevel);
break;
currently, there is a switch with 6 cases for each attribute ^ like this
And i want to remove the switch somehow. Because in my opinion its nasty code :<
The result should look some kind of this (you can see my following example as pseudocode) and i would like to know how i can realize that
setarray .@str[1],30000,30050,30100; // item IDs of lvl 1/2/3/.... enchantmentStones
setarray .@dex[1],30001,30051,30101
// ^ the same with int / agi / vit / luk
_statpoints:
mes "["+strnpcinfo(1)+"]";
mes "And wich statpoint should I apply?";
set .@selectedMenuOption,select(.@str,.@dex); <----- if i select str, .@selectedMenuOption should be the array .@str
set .@bonus, callfunc("GetBonusLevel", .@selectedMenuOption, .@currentBonus, .@maxEnchantmentLevel, .@defaultEnchantmentLevel);
I hope its kinda understandable now ^^'