Page 1 of 1
equipping items to a user's account
Posted: Wed Aug 04, 2010 5:23 am
by xwhitchx
ok i have a browser game that im working on, and i would like to know how to code something so i can equipped items to the user so there stats will go up or down based off the item. my datebase is in mysql. so if anyone has any input on this plz let me know, or point me the right way.
Re: equipping items to a user's account
Posted: Wed Aug 04, 2010 5:51 am
by superdezign
You should probably have a database table for the characters, a table for the equipment, and a table that relates the two.
Code: Select all
`characters`
ID | Name | Level | STA | STR | DEX | INT
`equipment`
ID | Slot | Defense
`character_equipment`
Character_ID | Equipment_ID
It is up to your application to calculate the implied stats (i.e. attack, defense, etc.) based off of the combination of the character stats and the equipment. It is also up to your application to ensure that a character does have 2 items in the same slot, etc.