equipping items to a user's account
Moderator: General Moderators
equipping items to a user's account
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.
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Re: equipping items to a user's account
You should probably have a database table for the characters, a table for the equipment, and a table that relates the two.
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.
Code: Select all
`characters`
ID | Name | Level | STA | STR | DEX | INT
`equipment`
ID | Slot | Defense
`character_equipment`
Character_ID | Equipment_ID