- Joined
- Jan 8, 2010
- Messages
- 493
is there an easier way to add random abilities to items other than using custom values?
OBJECTIVE:
an item is to be enchanted 1-4 times. each enchantment will add a random ability out of the set of abilities i have (33 for now). if i create a specific item from possible combinations, that would be a total of 982080 4-enchantment items (for only one type of item)
METHOD SO FAR:
if an item is enchanted, i use custom values of up to 8 digits (00000000) and add it to the item. first enchantment will use the first 2 digits (00000022), second the next 2 (00001122) and so on until sets of 2 digits have numbers other than 00. then when a unit equips that item ("equip" is different from "pick up", i triggered it) i use triggers to check the custom value of the item and add disabled spellbooks with corresponding abilities to the unit. and when the unit unequips the item, those spellbooks are also removed.
so there, i'm sorta wondering if there is another way other than using custom values because i once read somewhere that custom values should as much as possible be avoided. i tried using hashtables but then again, i realized i didn't know much about how to use it, and figured if i save the item and load it, it won't tell me what kind of abilities it supposedly have since it only loaded the item itself.
OBJECTIVE:
an item is to be enchanted 1-4 times. each enchantment will add a random ability out of the set of abilities i have (33 for now). if i create a specific item from possible combinations, that would be a total of 982080 4-enchantment items (for only one type of item)
METHOD SO FAR:
if an item is enchanted, i use custom values of up to 8 digits (00000000) and add it to the item. first enchantment will use the first 2 digits (00000022), second the next 2 (00001122) and so on until sets of 2 digits have numbers other than 00. then when a unit equips that item ("equip" is different from "pick up", i triggered it) i use triggers to check the custom value of the item and add disabled spellbooks with corresponding abilities to the unit. and when the unit unequips the item, those spellbooks are also removed.
so there, i'm sorta wondering if there is another way other than using custom values because i once read somewhere that custom values should as much as possible be avoided. i tried using hashtables but then again, i realized i didn't know much about how to use it, and figured if i save the item and load it, it won't tell me what kind of abilities it supposedly have since it only loaded the item itself.