#17918 - 08/17/08 09:17 AM
Improved DK Quest Creator MOD
|
gamefreak888
Rice Krispies
Registered: 09/06/07
Posts: 215
|
Offline
|
|
I'm using the DK Quest Creator Mod 1.0 on my game and I'd like to improve it. I know I'm not the owner of the mod but I'm not going to put my version 2.0 on the DK Mod Index website.
I'd like to create quests with multiple locations which you need to visit. Like: "Kill 9 boars. They're located between: 3N 0E, 6N 0E, 3N 3E and 6N 3E."
And I can use some help with that!
I was thinking to put an if function somewhere in quest.php, which checks whether the quest has a second target latitude and longitude. So I put two fields in the quest table called 2lon and 2lat.
Like (don't look at the bad coding :P):
if questrow["2lon"]=/ 0 WHERE questrow["id"]=$questid {
Now there will be a function that displays the text:
"{{endtekst2}}"
That says something like:
"You've killed 1 Boar, 8 to go!"
And then I somehow have to copy and paste the whole quest script beneath that, so that the quest is still in your 'Active Quest Log' and that you can still go to some location. One small edit is that I must replace lat and long with 2lat and 2lon.
At the end of that, there will be a small else function, for when the quest only has one target long and lat, which displays the Quest complete screen.
Does anyone have tips, comments? Am I forgetting something/doing something terribly wrong?
|
|
Top
|
|
|
#17920 - 08/17/08 12:37 PM
Re: Improved DK Quest Creator MOD
[Re: Fayt]
|
gamefreak888
Rice Krispies
Registered: 09/06/07
Posts: 215
|
Offline
|
|
I'm sorry but I can't do anything with your answer. You're right, but people like my game better with quests than without. And DK is a text-based browser-based MMORPG, so people are not expecting quests like those in World of Warcraft or Final Fantasy.
And even limited quests can be nice if you create a nice story around them and create your own small updates like NPC's who can give you quests.
EDIT:
Wait, I just got an idea. I think it is relatively easy to create a script that adds another quest to your quest log after you've completed a quest. So you just create 9 quests about killing those boars and once you've completed the first one the second one will be shown in your quest log.
Edited by basleijser (08/17/08 12:38 PM)
|
|
Top
|
|
|
#17930 - 08/18/08 09:48 AM
Re: Improved DK Quest Creator MOD
[Re: gamefreak888]
|
gamefreak888
Rice Krispies
Registered: 09/06/07
Posts: 215
|
Offline
|
|
I'll describe it a bit more detailed so that it is easier to help.
I've got to edit the following part of quest.php:
if ($questrow["drop_id"] != 0) { $dropcode = "dropcode='".$questrow["drop_id"]."',"; $page .= "You have earned a reward for completing this quest. <a href=\"index.php?do=questdrop\">Click here</a> to reveal and equip the item, or you may also move on and continue <a href=\"index.php\">exploring</a>."; } else { $dropcode = ""; $page .= "You can now continue <a href=\"index.php\">exploring</a>."; } } $updatequestquery = doquery("UPDATE {{table}} SET status='1' where quest_id='".$userrow["currentquestid"]."' AND user_id='".$userrow["id"]."' LIMIT 1", "questprogress"); $updatequery = doquery("UPDATE {{table}} SET currentaction='Exploring',level='$newlevel',maxhp='$newhp',maxmp='$newmp',maxtp='$newtp',strength='$newstrength',dexterity='$newdexterity',attackpower='$newattack',defensepower='$newdefense', $newspell currentfight='0',currentmonster='0',currentmonsterhp='0',currentmonstersleep='0',currentmonsterimmune='0',currentuberdamage='0',currentuberdefense='0',$dropcode experience='$newexp',gold='$newgold',currentquestid='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); unset($questrow); $title = "Quest Completed!"; display($page, $title); die(); }
When I know how to edit that part I can also edit the part about quests with a boss.
I've created two new MySQL fields to the quest table: 2ndquest 2ndquest_id
What I want is simple: after you've completed the quest, a new quest will be added to your quest log, but you do not need to accept it and go to a town, it will be added automatically.
So I first create an if function that checks whether the quest has an 2ndquest.
if ($questrow["2ndquest"] != 0) { Here comes a script that adds the 2nd quest to your quest log } else { Here comes the rest of the script that says the quest is complete }
I've tried multiple scripts for the update part, like:
$query = doquery("INSERT INTO {{table}} SET id='',user_id='".$user_id."',quest_id='" . $questrow["2ndquest_id"] . "',status='0',latitude='".$quest_lat."',longitude='".$quest_long."'", "questprogress") or die(mysql_error());
But it is not working. I had a final code like this:
if ($questrow["2ndquest"] != 0) { $query = doquery("INSERT INTO {{table}} SET id='',user_id='".$user_id."',quest_id='" . $questrow["2ndquest_id"] . "',status='0',latitude='".$quest_lat."',longitude='".$quest_long."'", "questprogress") or die(mysql_error()); } else { if ($questrow["drop_id"] != 0) { $dropcode = "dropcode='".$questrow["drop_id"]."',"; $page .= "You have earned a reward for completing this quest. <a href=\"index.php?do=questdrop\">Click here</a> to reveal and equip the item, or you may also move on and continue <a href=\"index.php\">exploring</a>."; } else { $dropcode = ""; $page .= "You can now continue <a href=\"index.php\">exploring</a>."; } } $updatequestquery = doquery("UPDATE {{table}} SET status='1' where quest_id='".$userrow["currentquestid"]."' AND user_id='".$userrow["id"]."' LIMIT 1", "questprogress"); $updatequery = doquery("UPDATE {{table}} SET currentaction='Exploring',level='$newlevel',maxhp='$newhp',maxmp='$newmp',maxtp='$newtp',strength='$newstrength',dexterity='$newdexterity',attackpower='$newattack',defensepower='$newdefense', $newspell currentfight='0',currentmonster='0',currentmonsterhp='0',currentmonstersleep='0',currentmonsterimmune='0',currentuberdamage='0',currentuberdefense='0',$dropcode experience='$newexp',gold='$newgold',currentquestid='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); unset($questrow); $title = "Quest Completed!"; display($page, $title); die(); } }
Perhaps I made some coding mistakes. But it is not working. Can anyone help?
|
|
Top
|
|
|
#17934 - 08/18/08 11:53 AM
Re: Improved DK Quest Creator MOD
[Re: Fayt]
|
gamefreak888
Rice Krispies
Registered: 09/06/07
Posts: 215
|
Offline
|
|
Huh but why? You're a moderator!!
|
|
Top
|
|
|
#17940 - 08/18/08 10:44 PM
Re: Improved DK Quest Creator MOD
[Re: Fayt]
|
AnmanIndustries
Cookie Crisp
   
Registered: 03/21/05
Posts: 2876
Loc: Planet Stupid, AKA Earth
|
Offline
|
|
In reference to your first thing, it will be easier to a SET order of quest items. Kill a boar HERE first, then HERE, then HERE and so on. That way it will be easier to track from a user side and easier to script as its linear. I didnt read the rest. Ive been in a major car accident and work is also busy so Im just stopping by at the moment.
|
|
Top
|
|
|
#17945 - 08/19/08 02:45 AM
Re: Improved DK Quest Creator MOD
[Re: Fayt]
|
AnmanIndustries
Cookie Crisp
   
Registered: 03/21/05
Posts: 2876
Loc: Planet Stupid, AKA Earth
|
Offline
|
|
I didnt hit anyone. Im a safe driver. I did however, use this as an excuse to buy a skyline.
I also dont beleive its a good idea to have an auto quest feature. Makes the user feel trapped in his quest items.
|
|
Top
|
|
|
#17953 - 08/20/08 05:43 PM
Re: Improved DK Quest Creator MOD
[Re: Fayt]
|
AnmanIndustries
Cookie Crisp
   
Registered: 03/21/05
Posts: 2876
Loc: Planet Stupid, AKA Earth
|
Offline
|
|
No no, I think its a good idea, in the fact that the quests can be AUTO maticaly generated and such. But to automatically get one right after another, kinds makes it more of a burden/obligation than a choice.
|
|
Top
|
|
|
#17959 - 08/21/08 01:27 AM
Re: Improved DK Quest Creator MOD
[Re: Fayt]
|
gamefreak888
Rice Krispies
Registered: 09/06/07
Posts: 215
|
Offline
|
|
@AnmanIndustries,
True, but I wasn't planning on doing that with all quests. If you create a quest like: "Kill three bandits, they're around 5N 6E, then it's very annoying to go back to town after you've slain a bandit to pick up the location of the next one. But if you create a script that automatically adds a quest with the location of the second bandit to your quest log, you can have much more complicated quests.
|
|
Top
|
|
|
|
|