esperance
07-17-2012, 10:50 PM
Hello,
I'm learning php + mysql and my motivation is to host a browsergame.
There is an ready register- and login-system, a character creation wich calculates the attribute points of the class and race of the characters. thats all till now.
The next thing is to have some fun with quests. There are different types of quests (main quests, daily quest, special quest and so on) so i made two tables for that:
`quests`
`quest_types`
How users do the daylie quests? Thats my problem!
The should be able to choose between three quest. So first i need three quests or more to let the script randomly choose three out of them.
Actually there are six daily quests in the table `quests`.
If we say order by rand() limit 3 every time a user opens the daily quest page, he get three random quests again. thats wrong. he should get three quests once, the he has to finish one of them and the generate three new quests.
additional, i didnt saved any reward in the `quests` table, because this should be caluclated randomly too, based on the characters level.
so can you tell me HOW to get three random quests, WHERE to safe them to show them to the user for ever until he finish one of them and WHEN to calculate the reward (gold and xp) to add it to the `characters` table?
this is so hard for me to do at the moment, pls give me hints.
I'm learning php + mysql and my motivation is to host a browsergame.
There is an ready register- and login-system, a character creation wich calculates the attribute points of the class and race of the characters. thats all till now.
The next thing is to have some fun with quests. There are different types of quests (main quests, daily quest, special quest and so on) so i made two tables for that:
`quests`
`quest_types`
How users do the daylie quests? Thats my problem!
The should be able to choose between three quest. So first i need three quests or more to let the script randomly choose three out of them.
Actually there are six daily quests in the table `quests`.
If we say order by rand() limit 3 every time a user opens the daily quest page, he get three random quests again. thats wrong. he should get three quests once, the he has to finish one of them and the generate three new quests.
additional, i didnt saved any reward in the `quests` table, because this should be caluclated randomly too, based on the characters level.
so can you tell me HOW to get three random quests, WHERE to safe them to show them to the user for ever until he finish one of them and WHEN to calculate the reward (gold and xp) to add it to the `characters` table?
this is so hard for me to do at the moment, pls give me hints.