View Single Post
  #14  
Old 01-22-2014, 09:20 PM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,065
Torankusu is a jewel in the roughTorankusu is a jewel in the rough
Quote:
Originally Posted by fowlplay4 View Post
You would use: {{"str",1},{"dex",2}}

Using an array would make it harder to query against for statistical purposes, but if it's just being used to load/save then you would be fine doing it that way.
this could be useful..

Quote:
I.e. Calculate how many items that have more than 5 strength enchanted exist.

SELECT COUNT(*)
FROM CharacterItems, Enchantments
WHERE Enchantments.CharacterItemID = CharacterItems.ID
AND enchantment = 'str' AND enchantmentvalue > 5;

If you design your system properly the only part that cares how that information is loaded and stored should be easy to change from a column in an array, to it's own table if you decide.
dumb question, but, is this modeled after the enchantment table having two separate columns - one for the enchantment name, and the other referencing the value? (str + 5).

ENCHANTMENTS
ID - ItemID - Enchantment - EnchantmentValue
1 - 5 - str - 5


--What would happen if I had an item (itemID 5..) that had multiple enchantments?
ex: str + 5 , dex + 2 ?

Sorry for the redundant questions.
__________________
Quote:
Originally posted by Spark910
Think befreo you type.
Reply With Quote