SVN Revision 2475 - Data Quests part 1

View and discuss the latests SVN commits, to ensure the best efficiency in our work.

Moderators: Support Team, Developer Team

SVN Revision 2475 - Data Quests part 1

Postby DOLBot » Mon Jul 26, 2010 2:27 am

Commit from tolakram

Log Messages
- Added: Primary Keys with an attribute of AutoIncrement will now eliminate the tablename_id column from any new table that uses them.
- Added: The ability to declare indexes spanning multiple columns

- Added: Data Driven Quests. This is a work in progress, the only quest type that's been thoroughly tested is the collection type. Further information will be in commit post on the forums.

- Bugfix: ToA fixed door support was accidentally set to GM only.
- Bugfix: Item command, create blank should now work as expected

Files Changed:
MODIFY - DOLSharp/trunk/DOLDatabase/Attributes/DataElement.cs
MODIFY - DOLSharp/trunk/DOLDatabase/Attributes/PrimaryKey.cs
MODIFY - DOLSharp/trunk/DOLDatabase/Connection/DataConnection.cs
MODIFY - DOLSharp/trunk/DOLDatabase/DOLDatabase.csproj
MODIFY - DOLSharp/trunk/DOLDatabase/Handlers/MySQLObjectDatabase.cs
MODIFY - DOLSharp/trunk/DOLDatabase/ObjectDatabase.cs
ADD - DOLSharp/trunk/DOLDatabase/Tables/CharacterXDataQuest.cs
ADD - DOLSharp/trunk/DOLDatabase/Tables/DataQuest.cs
MODIFY - DOLSharp/trunk/GameServer/GameServer.csproj
MODIFY - DOLSharp/trunk/GameServer/commands/gmcommands/GMinfo.cs
MODIFY - DOLSharp/trunk/GameServer/commands/gmcommands/door.cs
MODIFY - DOLSharp/trunk/GameServer/commands/gmcommands/item.cs
MODIFY - DOLSharp/trunk/GameServer/commands/gmcommands/mob.cs
MODIFY - DOLSharp/trunk/GameServer/events/gameobjects/ReceiveMoneyEventArgs.cs
MODIFY - DOLSharp/trunk/GameServer/events/gameobjects/SourceEventArgs.cs
MODIFY - DOLSharp/trunk/GameServer/gameobjects/GameLiving.cs
MODIFY - DOLSharp/trunk/GameServer/gameobjects/GameNPC.cs
MODIFY - DOLSharp/trunk/GameServer/gameobjects/GameObject.cs
MODIFY - DOLSharp/trunk/GameServer/gameobjects/GamePlayer.cs
MODIFY - DOLSharp/trunk/GameServer/packets/Client/168/DoorRequestHandler.cs
MODIFY - DOLSharp/trunk/GameServer/packets/Server/PacketLib168.cs
MODIFY - DOLSharp/trunk/GameServer/quests/QuestsMgr/AbstractQuest.cs
MODIFY - DOLSharp/trunk/GameServer/quests/QuestsMgr/BaseQuest.cs
MODIFY - DOLSharp/trunk/GameServer/quests/QuestsMgr/QuestMgr.cs
MODIFY - DOLSharp/trunk/GameServer/serverproperty/ServerProperties.cs

View Changes:
http://dolserver.svn.sourceforge.net/do ... v&rev=2475
User avatar
DOLBot
DOL Bot
 
Posts: 1933
Joined: Sat Jan 08, 2011 1:23 pm

Re: SVN Revision 2475 - Data Quests part 1

Postby Tolakram » Mon Jul 26, 2010 2:37 am

Data Driven Quests, or DataQuests.

These are quests that can be set up in the DB rather than needing a script. It's a big undertaking but in 2 days I was able to get collection quests working and a simple interact, accept, interact with a target to finish quests. I will be adding more support over the next week or so until it's complete.

So the best way to see how these work is via an example.

Insert the following into your database. This will place 3 test mobs in Cotswold, Albion, to demonstrate the quests. Basically click on the Accept NPC to get a quest, then interact with Finish NPC to end the quest and get a reward. Do this 5 times and you will have 5 items. Now interact with Collect NPC, he will tell you he's looking for those items you just got. Hand over those items one by one *Stacked items NOT supported yet) and he will give you a small XP reward. Once you hit the limit, 5 in this case, he will no longer accept the items or tell you he's looking for them (need to verify if that is live like).

Known Issue #1: The quest indicator does not toggle correctly when accepting a data quest.


Code: Select all
INSERT INTO `itemtemplate` (`ItemTemplate_ID`, `Id_nb`, `Name`, `Level`, `Durability`, `MaxDurability`, `Condition`, `MaxCondition`, `Quality`, `DPS_AF`, `SPD_ABS`, `Hand`, `Type_Damage`, `Object_Type`, `Item_Type`, `Color`, `Emblem`, `Effect`, `Weight`, `Model`, `Extension`, `Bonus`, `Bonus1`, `Bonus2`, `Bonus3`, `Bonus4`, `Bonus5`, `ExtraBonus`, `Bonus1Type`, `Bonus2Type`, `Bonus3Type`, `Bonus4Type`, `Bonus5Type`, `ExtraBonusType`, `IsPickable`, `IsDropable`, `MaxCount`, `PackSize`, `Charges`, `MaxCharges`, `SpellID`, `ProcSpellID`, `Realm`, `IsTradable`, `Bonus6`, `Bonus7`, `Bonus8`, `Bonus9`, `Bonus10`, `Bonus6Type`, `Bonus7Type`, `Bonus8Type`, `Bonus9Type`, `Bonus10Type`, `Charges1`, `MaxCharges1`, `SpellID1`, `ProcSpellID1`, `PoisonSpellID`, `PoisonMaxCharges`, `PoisonCharges`, `CanDropAsLoot`, `AllowedClasses`, `CanUseEvery`, `PackageID`, `Flags`, `BonusLevel`, `Description`, `IsIndestructible`, `IsNotLosingDur`, `LevelRequirement`, `Price`, `ClassType`) VALUES ('6a29db76-8b09-48f2-bf88-8f29f4a627b4', 'collect_test', 'Collect Test', 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 488, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, '0', 0, '', 0, 0, 'Turn this item into Collect NPC to receive an XP reward!', 0, 0, 0, 0, '');

INSERT INTO `dataquest` (`ID`, `Name`, `StartType`, `StartName`, `StartRegionID`, `AcceptText`, `Description`, `SourceName`, `SourceText`, `StepType`, `StepText`, `TargetName`, `TargetText`, `CollectItemTemplate`, `MaxCount`, `MinLevel`, `MaxLevel`, `RewardMoney`, `RewardXP`, `FinalRewardItemTemplates`) VALUES (1, 'Collect Items', 1, 'Collect NPC', 1, NULL, 'Hello, I\'m looking for some items called Collect Test.  If you find any of these please return them to me.  I will reward you for the effort!', 'Collect NPC;1', 'Ah, I\'ve been looking for some of these, thank you!  Please accept this as a token of my appreciation!', NULL, NULL, NULL, NULL, 'collect_test', 5, 1, 50, '0', '100', NULL);

INSERT INTO `dataquest` (`ID`, `Name`, `StartType`, `StartName`, `StartRegionID`, `AcceptText`, `Description`, `SourceName`, `SourceText`, `StepType`, `StepText`, `TargetName`, `TargetText`, `CollectItemTemplate`, `MaxCount`, `MinLevel`, `MaxLevel`, `RewardMoney`, `RewardXP`, `FinalRewardItemTemplates`) VALUES (2, 'Accept and Finish', 0, 'Accept NPC', 1, 'Start Words', 'Good day!  Please say the [Start Words] to start your quest.', 'Accept NPC;1', 'Thanks for accepting this quest, I hope you succeed in your ventures!', '5', 'Interact with Finish NPC to complete this quest.', 'Finish NPC;1', 'You are now finished with this quest!', NULL, 5, 1, 50, '500', '500', 'collect_test');

INSERT INTO `mob` (`Mob_ID`, `ClassType`, `Name`, `Guild`, `X`, `Y`, `Z`, `Speed`, `Heading`, `Region`, `Model`, `Size`, `Level`, `Realm`, `EquipmentTemplateID`, `ItemsListTemplateID`, `Flags`, `AggroLevel`, `AggroRange`, `MeleeDamageType`, `RespawnInterval`, `FactionID`, `NPCTemplateID`, `Race`, `BodyType`, `HouseNumber`, `Brain`, `PathID`, `MaxDistance`, `BoatOwnerID`, `Strength`, `Constitution`, `Dexterity`, `Quickness`, `Intelligence`, `Piety`, `Empathy`, `Charisma`, `PackageID`, `RoamingRange`, `IsCloakHoodUp`, `Gender`, `VisibleWeaponSlots`) VALUES ('4d01e39d-bbdc-4a0c-9dd8-b4296b10c8d1', 'DOL.GS.GameNPC', 'Collect NPC', '', 559159, 511617, 2323, 200, 117, 1, 10, 50, 1, 1, '', '', 16, 0, 0, 2, 1, 0, -1, 0, 0, 0, '', '', 0, '', 26, 30, 30, 30, 30, 30, 30, 30, '', 0, 0, 0, 255);

INSERT INTO `mob` (`Mob_ID`, `ClassType`, `Name`, `Guild`, `X`, `Y`, `Z`, `Speed`, `Heading`, `Region`, `Model`, `Size`, `Level`, `Realm`, `EquipmentTemplateID`, `ItemsListTemplateID`, `Flags`, `AggroLevel`, `AggroRange`, `MeleeDamageType`, `RespawnInterval`, `FactionID`, `NPCTemplateID`, `Race`, `BodyType`, `HouseNumber`, `Brain`, `PathID`, `MaxDistance`, `BoatOwnerID`, `Strength`, `Constitution`, `Dexterity`, `Quickness`, `Intelligence`, `Piety`, `Empathy`, `Charisma`, `PackageID`, `RoamingRange`, `IsCloakHoodUp`, `Gender`, `VisibleWeaponSlots`) VALUES ('a48c26d2-d6a1-4f30-948b-bc353c9ff2ca', 'DOL.GS.GameNPC', 'Accept NPC', '', 559275, 511629, 2324, 200, 4067, 1, 10, 50, 1, 1, '', '', 16, 0, 0, 2, 1, 0, -1, 0, 0, 0, '', '', 0, '', 26, 30, 30, 30, 30, 30, 30, 30, '', 0, 0, 0, 255);

INSERT INTO `mob` (`Mob_ID`, `ClassType`, `Name`, `Guild`, `X`, `Y`, `Z`, `Speed`, `Heading`, `Region`, `Model`, `Size`, `Level`, `Realm`, `EquipmentTemplateID`, `ItemsListTemplateID`, `Flags`, `AggroLevel`, `AggroRange`, `MeleeDamageType`, `RespawnInterval`, `FactionID`, `NPCTemplateID`, `Race`, `BodyType`, `HouseNumber`, `Brain`, `PathID`, `MaxDistance`, `BoatOwnerID`, `Strength`, `Constitution`, `Dexterity`, `Quickness`, `Intelligence`, `Piety`, `Empathy`, `Charisma`, `PackageID`, `RoamingRange`, `IsCloakHoodUp`, `Gender`, `VisibleWeaponSlots`) VALUES ('da2edbd7-f996-4083-95a9-c744da79af30', 'DOL.GS.GameNPC', 'Finish NPC', '', 559387, 511622, 2332, 200, 59, 1, 10, 50, 1, 1, '', '', 16, 0, 0, 2, 1, 0, -1, 0, 0, 0, '', '', 0, '', 26, 30, 30, 30, 30, 30, 30, 30, '', 0, 0, 0, 255);


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

Re: SVN Revision 2475 - Data Quests part 1

Postby Tolakram » Mon Jul 26, 2010 3:40 am

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

Re: SVN Revision 2475 - Data Quests part 1

Postby geshi » Mon Jul 26, 2010 11:32 am

Are these supposed to be the kill item quests? where special mobs drop "kill items" and you hand them into an npc and they give you XP??
geshi
Contributor
 
Posts: 1826
Joined: Tue Oct 21, 2008 9:16 pm

Re: SVN Revision 2475 - Data Quests part 1

Postby Tolakram » Mon Jul 26, 2010 12:01 pm

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

Re: SVN Revision 2475 - Data Quests part 1

Postby geshi » Mon Jul 26, 2010 1:47 pm

Sweet <3 I loved these on live, thanks :D

Though on live you don't start the quest.. is this optional? :mrgreen:
geshi
Contributor
 
Posts: 1826
Joined: Tue Oct 21, 2008 9:16 pm

Re: SVN Revision 2475 - Data Quests part 1

Postby Tolakram » Mon Jul 26, 2010 2:04 pm

You don;t have to start it. Best run the examples I provided. There are two types of quests that work right now, collection and interaction. Collection does not start and does not go into your quest log. If you talk to the collector he will tell you what he is looking for, and if you give him one of those items he will say thanks and reward you. AFAIK it's very close to live like.

The interact quest is simply an example of accepting a quest and interacting with another npc to end it. Useless, but proof of concept and helped test the core data quest code.

If you look at my quest types and enums you'll see what I will be supporting once I have time to code it all. Ah, but this file was accidentally left out of this commit.

Here's a copy of the enum declaration for quest and step types that will be supported.

Code: Select all
      /// <summary>
      /// How does this quest start
      /// </summary>
      public enum eStartType : byte
      {
         Standard = 0,      // Talk to npc, accept quest, go through steps
         Collection = 1,      // player turns drops into npc for xp, quest not added to player quest log
         AutoStart = 2,      // quest is auto started simply by interacting with start object
         KillComplete = 3,   // Killing the Start NPC grants and finished the quest, similar to One Time Drops
      }

      /// <summary>
      /// The type of each quest step
      /// </summary>
      public enum eStepType : byte
      {
         Kill = 0,         // Kill the target to advance the quest
         KillFinish = 1,      // Killing the target finishes the quest and gives the reward
         Deliver = 2,      // Deliver an item to the target to advance the quest
         DeliverFinish = 3,   // Deliver an item to the target to finish the quest
         Interact = 4,      // Interact with the target to advance the step
         InteractFinish = 5,   // Interact with the target to finish the quest
         Whisper = 6,      // Whisper to the target to advance the quest
         WhisperFinish = 7,   // Whisper to the target to finish the quest
      }

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

Re: SVN Revision 2475 - Data Quests part 1

Postby geshi » Mon Jul 26, 2010 2:25 pm

Sweet, thanks.
geshi
Contributor
 
Posts: 1826
Joined: Tue Oct 21, 2008 9:16 pm

Re: SVN Revision 2475 - Data Quests part 1

Postby Tolakram » Mon Jul 26, 2010 2:50 pm

I'm also working on a /makequest command ... that will be a while off as it's pretty complex, but basically will help you build one of these in game. It should also be fairly easy to make a quest builder application to build these as well, though I have no plans to do that.

The concept for each of the columns is fairly straightforward, I might as well document it here. Remember these are not meant to replace scripted quests and will never support all the features available to quests. The intent here is to create an engine that will work for 70% to 80% of the simple old style quests, provide a mechanism for collection quests, and provide a mechanism for the accept/kill/reward quests, like the champion quests. If you need the fancy dialog or extended features you will need to script it. There's an outside chance I may be able to support the RewardQuest dialog as an option in the future ... I'm still working on the logistics of that.


Name: The name of the quest
StartType: one of the eStartType values
StartName: The name of the NPC who offers the quest
StartRegionID: The region ID this NPC is in
AcceptText: Text used to accept the quest, can be null
Description: Description of the quest to show players who are not yet doing the quest

Now the serialized columns.

Primary separator is the pipe | and the secondary separator, when needed, is the semi-colon ;

For every step there must be an entry in the following columns. The entry can be empty (||) if the step does not need it. If you are just doing a single step quest some of these can be null, as noted above. For multi step quests, which are not supported yet, every step must have an entry, even it it's empty or 0. Some columns can remain null if no steps use them, like AdvanceText for example, but if just one step uses AdvanceText then text, even if blank, must be serialized for every step.

I reserve the right to change these rules if they don't work out. :)

SourceName: NPCName;RegionID|NPCName;RegionID... Can't be null and the first entry must be the same as StartName and StartRegionID

SourceText: Text|Text||Text... every quest needs at least one entry here, it should be the text the first npc says after quest accept. Can be empty if source for a step has no quest.

StepType: 0|1|3|2... every step must have a type, needs to be an eStepType value. Can be null for collection quests

StepText: text|text|text... This text appears in the players journal, if applicable. Can be null for collection quests

AdvanceText: text|text||text... Whisper text to advance a step or end a quest. Can be null if no advance text is used

TargetName: NPCName;RegionID|NPCName;RegionID... every step needs a target, this can be null for collection quests.

TargetText: text|text... Can be null if no targets have text

CollectitemTemplate: idnb|idnb||idnb... This is the item required to turn in per step. Can be null or can have empty values if step does not require turn in.

MaxCount: Number of times a player can do this quest. Can't be null.

Minlevel, MaxLevel: can't be null

RewardMoney: 10|0|0|100... Reward money for each step. Must be 0 or a value, can't be null

RewardXP: 1000000|0|0|100000000... Reward XP for each step. Must be 0 or a value, can't be null

FinalRewardItemTemplates: idnb|idnb|idnb... Rewards to give player on quest completion. One or more allowed or can be null. Inventory is checked when quest is finished and finish will not happen unless player has enough room to accept all reward items.
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: SVN Revision 2475 - Data Quests part 1

Postby Roozzz » Mon Jul 26, 2010 2:50 pm

This sounds excellent, the various options should give a lot of options to tinker with :)
Quidquid latine dictum sit, altum videtur
Roozzz
Database Team
 
Posts: 1943
Joined: Wed Dec 06, 2006 11:00 am

Re: SVN Revision 2475 - Data Quests part 1

Postby Merec » Thu Jul 29, 2010 7:25 pm

Thats sounds like something I can put into an application :D

Very great job!
Merec
Developer
 
Posts: 428
Joined: Thu Mar 08, 2007 8:58 am
Website: http://www.merec.org
Location: NRW, Germany

Re: SVN Revision 2475 - Data Quests part 1

Postby Tolakram » Thu Jul 29, 2010 7:43 pm

Yea merec, most certainly a quest builder!

Just wait a few more releases till is stabilizes. :) Still making test quests and finding silly design errors I need to correct.
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: SVN Revision 2475 - Data Quests part 1

Postby Tolakram » Sun Aug 29, 2010 12:10 pm

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

Re: SVN Revision 2475 - Data Quests part 1

Postby Phen » Sun Aug 29, 2010 3:04 pm

make sure you target the questgiver do /mob refreshquests after adding the quests into the DB to have them added on-the-fly,or you could bang your head a few times after typing /mob reload and wondering what you did wrong. Or until you aks Tola why it's not working. :D
Phen
Storm GM
 
Posts: 674
Joined: Thu Jun 12, 2008 12:55 am
Yahoo Messenger: KerzedSoul@yahoo.com

Re: SVN Revision 2475 - Data Quests part 1

Postby Graveen » Sun Aug 29, 2010 8:43 pm

Merec wrote:Thats sounds like something I can put into an application :D

Very great job!


Wow ! :mrgreen:
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


Return to “%s” DOL SVN Commits

Who is online

Users browsing this forum: No registered users and 1 guest