What is the best way to structure this database?
View Single Post
06-13-2008, 04:03 PM
Join Date: Nov 2007
Originally Posted by
dschreck, that is exactly how I first created it, only problem is that monsters can drop more then one item at a time, also that certain item can be in more then one quantity. Just making 2 rows doesn't work because then I can't count the rows to see how many times it has been killed.
You insert into the lookup table multiple times....
Orc Drops 1 Hide, 1 Weapon
INSERT INTO drops VALUES (monster_id_of_orc_goes_here, item_id_of_hide_goes_here);
INSERT INTO drops VALUES (monster_id_of_orc_goes_here, item_id_of_weapon_goes_here);
Not sure what you'd do with Gold... but that would probably go into their items...
Another thing to remember, is that with an MMO you really only need to record when someone picks up an item, and keeps it in their inventory.
But if you're just trying to record what items drop off of what monster, the drops look up table should work fine.
Where I Ramble:
What I do:
Zynga Game Network
Senior Software Engineer at
View Public Profile
Send a private message to dschreck
Visit dschreck's homepage!
Find More Posts by dschreck