Spell scribing - Code snippets
Code snippets complete, with a radix sort =)
A command to scribe all spells for someone would be useful.
There are serveral ways to go about this, one would to be on #scribespells <level>.. search all spells, if they are <= level and the character level, add them to the spellbook in the first availible space. Another way would be to do that, sort that list by level (assend or desend), maybe by basic type(icon) or by affects..
Level 1 Pet L1 Buff L1 Nuke L2 Nuke L2 Buff L3 Buff L3 Pet
L1 Pet L3 Pet L1 Buff L2 Buff L3 Buff L1 Nuke L2 Nuke
all would be pretty simple to implement, but would require O(n), assuming 5000 spells, thats 5000 + (sorting)
Another way if on load, create spell lists for each class, have them arranged by level and class and maybe type then when someone requested the spells, you would use a lot less O, and if more than one person did this, the saving would be tremendous.
So far, the precreated lists are the most appropriate and should be relatively easy to make. However, not having experience with the general code it is quite hard. If anyone needs help with the coding of the searching, sorting, I can help and will be working on it, but I would not be able to merge it easily.
ed. Need to do a better sort and get rid of index operator
|