I know a few of you are currently working on equipment maps right now, so maybe you can help... don't worry, I don't need anything nearly as comprehensive as the things you've got!
All I want to do is have a map of one-handed +spell damage weapons, with their values, then, if I just so happen to have more than one in my inventory, it will calculate whichever is best (based on the spell damage value) and equip that one.
So far, all I've been successful with is creating the map and returning the spell damage value of the item with the following code.
I'm honestly not even sure if that's the best structure for the map, or if it should be defined with the items and ints switched, and I really have absolutely no clue as to how to go about calculating which is "best", even though I've looked through the wiki, the tutorials on ASH and maps, and searched through tons of threads and scripts on this board.
Can anyone at least point me in the right direction of some documentation that might explain how I would go about doing this, or, if one exists and I missed it, an example script that does something similar?
All I want to do is have a map of one-handed +spell damage weapons, with their values, then, if I just so happen to have more than one in my inventory, it will calculate whichever is best (based on the spell damage value) and equip that one.
So far, all I've been successful with is creating the map and returning the spell damage value of the item with the following code.
Code:
int [item] oneHanded;
oneHanded[$item[star spatula]] = 15;
oneHanded[$item[silver shrimp fork]] = 14;
oneHanded[$item[oversized pizza cutter]] = 13;
oneHanded[$item[chopsticks]] = 12;
oneHanded[$item[iron pasta spoon]] = 10;
oneHanded[$item[huge spoon]] = 10;
oneHanded[$item[Knob Goblin melon baller]] = 8;
oneHanded[$item[filthy pestle]] = 7;
oneHanded[$item[jack flapper]] = 5;
oneHanded[$item[shiny butcherknife]] = 5;
oneHanded[$item[Knob Goblin spatula]] = 4;
oneHanded[$item[gnollish slotted spoon]] = 3;
oneHanded[$item[gnollish pie server]] = 3;
oneHanded[$item[eggbeater]] = 2;
oneHanded[$item[little paper umbrella]] = 1;
oneHanded[$item[corn holder]] = 1;
foreach key in oneHanded {
if(item_amount(key) > 0 && can_equip(key)) {
print("You have and can equip " + oneHanded[key] + ".");
}
}
I'm honestly not even sure if that's the best structure for the map, or if it should be defined with the items and ints switched, and I really have absolutely no clue as to how to go about calculating which is "best", even though I've looked through the wiki, the tutorials on ASH and maps, and searched through tons of threads and scripts on this board.

Can anyone at least point me in the right direction of some documentation that might explain how I would go about doing this, or, if one exists and I missed it, an example script that does something similar?