DataQuest Examples

A place to submit .patch fixes for the DOL SVN

Moderator: Developer Team

DataQuest Examples

Postby Tolakram » Sun Nov 07, 2010 12:59 pm

We need more of these. All of the D2 quests are dataquests, made by placing the steps in the dataquest table and then going to the quest giver and using the /mob refreshquests command to load/reload any changes.

Let me go ahead and describe a couple.

Den of Evil
This is a simple quest that starts with an interact, followed by a mob kill, then ends with an interact.

ID: 23 - unique ID of this quest, assigned automatically.
Name: The Den of Evil
StartType: 0 - starts with a whisper of the correct word or words
StartName: Akara - the name of the npc or object that has this quest
StartRegionID: 10012 - the region of the above object
AcceptText: cave - this is the text that when said to the npc grants the quest

Description: "Scouts have found a nearby [cave] filled with shadowy creatures and horrors from beyond the grave." - This is the text show to the player who is being offered the quest. Note that [cave] has to be the same as the AcceptText so when the user clicks the quest will be accepted.

SourceName: Akara;10012|Corpsefire;10025 - This npc or object starts each step. So for the first step the source always equals the quest giver. Because this quest has 3 steps, but the final step is a finish step so no source is needed. So in this quest we go from Akara to Corpsefire and back to Akara. Two sources, Akara and Corspefire.

SourceText: "The cave is located to the east southeast, near the edge of the valley. I am told an evil being named Corpsefire has taken up residence in the lower level somewhere. Kill him and put a stop to this evil.|" - here we need source text for each source. Text for each step is separated by | and in this case Corpsefire has no source text, but we must provide for it anyway, thus the | at the end of the string. This will be parsed as two entries. THe location of the cave followed by an empty string.

Step Type: 0|5 - These are the types of steps on this quest. 0 = Kill, 5 = InteractFinish This means our first task is to kill something and once that is done we need to go back to an npc or object and interact with it to finish the quest.

StepText: "Find the cave and kill Corpsefire.|Return to Akara for your reward." - This is the text shown in the quest log for each active step. Two steps, two strings seperated by |

StepItemTemplates: Not used here. This is the item template given to the player at the conclusion of a step.

AdvanceText: Not used for this quest. If the quest needed a whisper to advance the step it would go here.

TargetName: Corpsefire;10025|Akara;10012 - similar to sourcename this holds the target of each step in the format name;regionid. In this case we have to kill CorspeFire, that's target one, then return to Akara, that's target two.

TargetText: "|" - This is the text the target displays prior to advancing a step. If we had whisper steps then this might be something like: So you;re here to [kill] me? and kill would be the AdvanceText for this step. Must have text for each step so here we end up with two empty strings.

CollectItemTemplate: NULL - not used, this is the item that needs to be handed to someone to finish a step

MaxCount: 1 - players can only do this quest once.
MinLevel: 1 - players level 1 and above can do this quest
MaxLevel: 100 - any levle up to 100 can do this quest

RewardMoney: 0|0 - this is the money rewarded at the end of each step, and must include the final step. Here we give 0 money for killing Corpsefire and 0 for returning to Akara and finishing the quest. I have changed this so if no step rewards money you can leave this column null.

RewardXP: 0|0 - same as above, reward for each step including the final step.

OptionalRewardItemTemplates: NULL - this is not used, though I do use the field for one dataquest with a custom (scripted) quest step. I hope to support reward style quests at some point, but not yet.

FinalRewardItemTemplates: d2_xprp_stone - this is a list of items we give the player when the quest if finished. Here they get a nice Mythical item with a 25% bonus to XP and RP.

FinishText: "You have done it! You have my gratitude, please accept this for your efforts." - Text said when quest is completed

QuestDependency: NULL - not used here but this is a list of quest names (either scripted or another data quest) the user must have finished before being offered this quest.

ClassType: NULL - not used here but is the fully qualified name of a script that will be called prior to finishing each step.

AllowedClasses: NULL - not used here, this restricts the classes that can be offered this quest.

Code: Select all
INSERT INTO `dataquest` (`ID`, `Name`, `StartType`, `StartName`, `StartRegionID`, `AcceptText`, `Description`, `SourceName`, `SourceText`, `StepType`, `StepText`, `StepItemTemplates`, `AdvanceText`, `TargetName`, `TargetText`, `CollectItemTemplate`, `MaxCount`, `MinLevel`, `MaxLevel`, `RewardMoney`, `RewardXP`, `OptionalRewardItemTemplates`, `FinalRewardItemTemplates`, `FinishText`, `QuestDependency`, `ClassType`, `AllowedClasses`) VALUES (23, 'The Den of Evil', 0, 'Akara', 10012, 'cave', 'Scouts have found a nearby [cave] filled with shadowy creatures and horrors from beyond the grave.', 'Akara;10012|Corpsefire;10025', 'The cave is located to the east southeast, near the edge of the valley.  I am told an evil being named Corpsefire has taken up residence in the lower level somewhere.  Kill him and put a stop to this evil.||', '0|5', 'Find the cave and kill Corpsefire.|Return to Akara for your reward.|', '', NULL, 'Corpsefire;10025|Akara;10012', '||', '||', 1, 1, 100, '0|0', '0|0', NULL, 'd2_xprp_stone', 'You have done it!  You have my gratitude, please accept this for your efforts.', NULL, NULL, NULL);

- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: DataQuest Examples

Postby Tolakram » Sun Nov 07, 2010 1:00 pm

Next up

The Summoner
Another kill and return, but this one adds multiple whisper steps and requires an item to do the last step.

ID: 12
Name: The Summoner
StartType: 0
StartName: Jerhyn
StartRegionID: 10022
AcceptText: a portal

Description: "Just before he was captured Atma's husband had found [a portal] that grants entrance into the Arcane Sanctuary."

SourceName: Jerhyn;10022|Jerhyn;10022|Jerhyn;10022|The Summoner;10024 - notice here I wanted multiple whisper steps so the player keeps having to talk to Jerhyn to get more text.

SourceText: It is said that the summoner knows the secret to entering the tomb of Tal Rasha, where Baal is [imprisoned]|It says here to interact with a portal stone that contains the markings [IV]. Atma's husband found these stones along our northeast border.|Go find stone marked IV and gain entrance to the Arcane Sanctuary. Once inside find and defeat The Summoner and bring back whatever you find. Good luck!| - Note the pipe at the end. We need one extra string sicne the summoner is a source of the last step but says nothing. Generally I simply place a couple if || at the end of each text string to avoid any errors. :)

Step Type: 6|6|0|3 - Whisper, Whisper, Kill, Interact to complete.

StepText: Ask Jerhyn where Baal is [imprisoned]|Ask about the stone marked [IV]|Find the portal stone marked IV along the northeast border, go into the Arcane Sanctuary and defeat the Summoner.|Return what you have found to Jerhyn.|

StepItemTemplates: |||d2_talrasha_book - At the beginning of the 4th step, after the summoner is killed, the quest player will be given this book.

AdvanceText: "imprisoned|IV||" - this is the text used to advance each of the whisper steps above. Remember each step needs a string, so if you have one whisper step but 10 steps total you will need to make sure you have 10 total advance texts.

TargetName: Jerhyn;10022|Jerhyn;10022|The Summoner;10024|Jerhyn;10022

TargetText: "|||Did you find anything?" - remember this is the text the target shows before advancing a step. The final step is a interact step, but requires I give an item, so I remind the player with some text.

CollectItemTemplate: "|||d2_talrasha_book" - these are paired up with StepItemTemplates. In this case the 4th step gives the player an item and requires the item be turned in to finish the step.

MaxCount: 1
MinLevel: 35
MaxLevel: 100
RewardMoney: NULL
RewardXP: NULL
OptionalRewardItemTemplates: NULL
FinalRewardItemTemplates:
FinishText: "I need to look over this book, the secret is in here somewhere..."
QuestDependency: "Find Radament" - players must complete Find Radament before being offered this quest
ClassType: NULL
AllowedClasses: NULL

Code: Select all
INSERT INTO `dataquest` (`ID`, `Name`, `StartType`, `StartName`, `StartRegionID`, `AcceptText`, `Description`, `SourceName`, `SourceText`, `StepType`, `StepText`, `StepItemTemplates`, `AdvanceText`, `TargetName`, `TargetText`, `CollectItemTemplate`, `MaxCount`, `MinLevel`, `MaxLevel`, `RewardMoney`, `RewardXP`, `OptionalRewardItemTemplates`, `FinalRewardItemTemplates`, `FinishText`, `QuestDependency`, `ClassType`, `AllowedClasses`) VALUES (12, 'The Summoner', 0, 'Jerhyn', 10022, 'a portal', 'Just before he was captured Atma\'s husband had found [a portal] that grants entrance into the Arcane Sanctuary.', 'Jerhyn;10022|Jerhyn;10022|Jerhyn;10022|The Summoner;10024', 'It is said that the summoner knows the secret to entering the tomb of Tal Rasha, where Baal is [imprisoned]|It says here to interact with a portal stone that contains the markings [IV].  Atma\'s husband found these stones along our northeast border.|Go find stone marked IV and gain entrance to the Arcane Sanctuary.  Once inside find and defeat The Summoner and bring back whatever you find.  Good luck!||', '6|6|0|3', 'Ask Jerhyn where Baal is [imprisoned]|Ask about the stone marked [IV]|Find the portal stone marked IV along the northeast border, go into the Arcane Sanctuary and defeat the Summoner.|Return what you have found to Jerhyn.|', '|||d2_talrasha_book', 'imprisoned|IV||', 'Jerhyn;10022|Jerhyn;10022|The Summoner;10024|Jerhyn;10022', '|||Did you find anything?', '|||d2_talrasha_book', 1, 35, 100, '0|0|0|0', '0|0|0|0', NULL, NULL, 'I need to look over this book, the secret is in here somewhere...', 'Find Radament', NULL, NULL);

- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: DataQuest Examples

Postby Tolakram » Sun Nov 07, 2010 1:02 pm

Coldcrow

This is another kill and return quest except I added a custom script so I could give a unique item (which has to be generated as an ItemUnique) at the end.

In this case I have the script use OptionalRewardItemTemplates to determine what item(s) to create.

...

OptionalRewardItemTemplates: "1d2_u_charm_necklace" - the format for this string is #id_nb|id_nb|... The # at the start of the string is intended to tell RewardQuest how many optional items can be chosen.

...

ClassType: DOL.Storm.D2Quest_GiveUnique - this is my custom class to give an item.

These custom steps must inherit from the IDataQuestStep interface:

Code: Select all
   public interface IDataQuestStep
   {
      bool Execute(DataQuest dataQuest, GamePlayer player, int step, bool isFinish);
   }


Code: Select all
   public class D2Quest_GiveUnique : IDataQuestStep
   {
      public bool Execute(DataQuest dataQuest, GamePlayer player, int step, bool isFinish)
      {
         if (isFinish && dataQuest.OptionalRewards.Count > 0)
         {
            lock (player.Inventory)
            {
               if (player.Inventory.IsSlotsFree(dataQuest.OptionalRewards.Count, eInventorySlot.FirstBackpack, eInventorySlot.LastBackpack))
               {
                  foreach (string idnb in dataQuest.OptionalRewards)
                  {
                     ItemTemplate drop = GameServer.Database.FindObjectByKey<ItemTemplate>(idnb);
                     ItemUnique unique = LootGeneratorUniqueItem_D2.GenerateUniqueItemFromDrop(drop, Math.Max((byte)30, player.Level));
                     GameServer.Database.AddObject(unique);
                     GameInventoryItem_D2 invitem = new GameInventoryItem_D2(unique);
                     player.Inventory.AddItem(eInventorySlot.FirstEmptyBackpack, invitem);
                  }
               }
               else
               {
                  player.Out.SendMessage("You need " + dataQuest.OptionalRewards.Count + " free slots in your backpack to finish this quest!", eChatType.CT_Important, eChatLoc.CL_SystemWindow);
                  return false;
               }
            }
         }

         return true;
      }
   }


As you can see above I check to see if this is the finishing step and give the item(s) I see in the OptionalRewards string. Interesting I coded a minimum item level of 30 ... hmmm.

Code: Select all
INSERT INTO `dataquest` (`ID`, `Name`, `StartType`, `StartName`, `StartRegionID`, `AcceptText`, `Description`, `SourceName`, `SourceText`, `StepType`, `StepText`, `StepItemTemplates`, `AdvanceText`, `TargetName`, `TargetText`, `CollectItemTemplate`, `MaxCount`, `MinLevel`, `MaxLevel`, `RewardMoney`, `RewardXP`, `OptionalRewardItemTemplates`, `FinalRewardItemTemplates`, `FinishText`, `QuestDependency`, `ClassType`, `AllowedClasses`) VALUES (157, 'Coldcrow', 0, 'Akara', 10012, 'unseemly', 'Our scouts have found another cave, just south of here, that has been taken over by [unseemly] types.', 'Akara;10012|Coldcrow;10030', 'An evil minion named Coldcrow has moved into the cave just south of here. This danger is much to close, we must defeat her, please go into the cave and eliminate this threat for us!||', '0|5', 'Find the cave just south of Costwold and kill Coldcrow.|Return to Akara for your reward.|', NULL, NULL, 'Coldcrow;10030|Akara;10012', '||', '||', 1, 1, 100, '0|0', '0|0', '1d2_u_charm_necklace', '', 'You have done it again!  You have my gratitude, please accept this for your efforts.', 'The Den of Evil', 'DOL.Storm.D2Quest_GiveUnique', NULL);

- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: DataQuest Examples

Postby Tolakram » Sun Nov 07, 2010 1:03 pm

Finally, a simple kill and finish quest. I use these for the Council members of D2. If you kill one and have not finished the quest before, and are of the minimum level, you are granted and finish the quest in one step and the quest goes in your finished quest log. I have another quest that has each of my 6 Council kill quests as QuestDependency

StartType: 3 - this is the KillComplete start type

Name, StartType, StartName, StartRegionID, MaxCount, MinLevel, and MaxLevel are the only other columns that need values, the rest can be null.

Code: Select all
INSERT INTO `dataquest` (`ID`, `Name`, `StartType`, `StartName`, `StartRegionID`, `AcceptText`, `Description`, `SourceName`, `SourceText`, `StepType`, `StepText`, `StepItemTemplates`, `AdvanceText`, `TargetName`, `TargetText`, `CollectItemTemplate`, `MaxCount`, `MinLevel`, `MaxLevel`, `RewardMoney`, `RewardXP`, `OptionalRewardItemTemplates`, `FinalRewardItemTemplates`, `FinishText`, `QuestDependency`, `ClassType`, `AllowedClasses`) VALUES (160, 'Bremm Sparkfist', 3, 'Bremm Sparkfist', 10031, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 50, 100, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: DataQuest Examples

Postby Graveen » Sun Nov 07, 2010 1:13 pm

Excellent tutorial. Thank you.

Stephen told me he 'd try to adapt quest designer to work with DataQuest.
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: DataQuest Examples

Postby geshi » Sun Nov 07, 2010 1:29 pm

Thanks for the examples :)
geshi
Contributor
 
Posts: 1826
Joined: Tue Oct 21, 2008 9:16 pm

Re: DataQuest Examples

Postby Apo » Sun Nov 07, 2010 6:37 pm

Thank you for the examples, this helps me to add an translation support for it on the dol language repo.
Apo
Contributor
 
Posts: 341
Joined: Sun May 22, 2005 10:21 pm
Location: Germany

Re: DataQuest Examples

Postby Tolakram » Wed Dec 01, 2010 10:20 pm

bump, dataquest examples. There will be a mod going live today or tomorrow to add collecttemplate support at each step. In addition, it appears sourcenpc is not used anywhere and may be removed int he next commit.
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: DataQuest Examples

Postby bedrock1977 » Wed Dec 01, 2010 10:39 pm

Thanks man... I must of been blind. I'm going to start adding some quests and see what I can get done with it.
User avatar
bedrock1977
DOL Novice
 
Posts: 90
Joined: Sun Dec 18, 2005 12:53 am
Website: http://percival.dyndns-ip.com:8080
Location: California

Re: DataQuest Examples

Postby bedrock1977 » Thu Dec 02, 2010 5:08 am

Ok been hammering away at this for a good three hours or so. I understand pretty much all of it and can get collection quests down like no other. Multiple quest steps are a toughy plus even more tricky with more than one NPC to speak with but I understand a bit more now after trial and error. I'm going to come up with a simple excel spread sheet that breaks down the quest parts in an easier format to read while entering the data into MySQL. I was attempting to read straight from an online quest DB like allakhazam on the fly and that wasn't happenin lol.

Great tool and kudos to those who made it happen.

One question, when choosing an accept quest for a standard quest type, is there no option to have it prompt the player if they wish to accept the quest? For example, I was attempting to do the quest Half Ogre, All Man in Cotswold with the NPC Madissair but could not come to this type of a prompt as AcceptText automatically accepted the quest with no prompt involved. I'm sure I'm just missing something so wanted to ask the experts. :)
User avatar
bedrock1977
DOL Novice
 
Posts: 90
Joined: Sun Dec 18, 2005 12:53 am
Website: http://percival.dyndns-ip.com:8080
Location: California

Re: DataQuest Examples

Postby Tolakram » Thu Dec 02, 2010 10:06 am

Nope, I did not implement an are you sure dialog. Maybe in the future. :)
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: DataQuest Examples

Postby -Shawn- » Sun Mar 13, 2011 4:17 pm

Question, can dataquests be used as sort of a taskmaster? ex: Go kill 10 mobs and come back to me or is it only step by step like Interact, kill, interact, etc.


Otherwise I can just code the quest was just wondering :D Cause these dataquests are awesome and easy to make
viewtopic.php?f=6&t=14984

Sky is the limit.
-Shawn-
DOL Devotee
 
Posts: 305
Joined: Tue Nov 24, 2009 1:47 am
Location: New York

Re: DataQuest Examples

Postby Tolakram » Mon Mar 14, 2011 3:26 am

Step by step only.
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: DataQuest Examples

Postby -Shawn- » Mon Mar 14, 2011 7:02 pm

Thank you for your reply tola
viewtopic.php?f=6&t=14984

Sky is the limit.
-Shawn-
DOL Devotee
 
Posts: 305
Joined: Tue Nov 24, 2009 1:47 am
Location: New York


Return to “%s” DOL Code Contributions

Who is online

Users browsing this forum: No registered users and 1 guest