View Single Post
  #8  
Old 01-21-2014, 12:50 PM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,065
Torankusu has a spectacular aura aboutTorankusu has a spectacular aura about
Quote:
Originally Posted by fowlplay4 View Post
Here's how I would do it:

Characters

ID - Account

1 - Toran
2 - Toran

Index on Account

Items

ID - Itemname

1 - Apple
2 - Orange
3 - Banana
4 - Grape
5 - Sword

Index on Itemname

CharacterItems

ID - CharacterID - ItemID - Quantity

1 - 1 - 1 - 2
2 - 1 - 2 - 1
3 - 2 - 3 - 4
4 - 2 - 4 - 3
Awesome, that makes a bit more sense.

One thing I am wondering however, is say that for example I have a sword [itemid - 5], and I have a user's character that owns two of them.

CharacterItems

ID - CharacterID - ItemID - Quantity

1 - 1 - 1 - 2
2 - 1 - 2 - 1
3 - 2 - 3 - 4
4 - 2 - 4 - 3
5 - 1 - 5 - 2

Simple enough,
But what if I wanted to offer an option to enchant one of those two swords?
Would this be viable?

CharacterItems

ID - CharacterID - ItemID - Quantity - Enchantments

1 - 1 - 1 - 2 - Null
2 - 1 - 2 - 1 - Null
3 - 2 - 3 - 4 - Null
4 - 2 - 4 - 3 - Null
5 - 1 - 5 - 1 - str+1
6 - 1 - 5 - 1 - Null

Or is there a better alternative?

Thanks again for the help, ill see if I cant get this set up tonight to test with.
__________________
Quote:
Originally posted by Spark910
Think befreo you type.
Reply With Quote