AutoQuest Automated Quest System Revision 1.0 by Mike Steinmann, Faras@Morgaelin The following system is provided as-is. The author takes no responsibility for the contents of the code or any possible damage that could result in the use thereof. This work is the product of the author and is to be given proper credit if used in any way, shape, or form. ----------------------------------------------------------------------------- 1. Introduction This quest system was written for one purpose, easy expansion on both the builder's and coder's end. The system in a nutshell is trigger based and comes with five basic types. The main hunk of code is self contained and located in autoquest_trigger_check(). But thats not an introduction =). Its fairly compact once the db booting and basic parsing functions are installed. When I originally wrote this code, I meant for it to be used with things such as scripts and mobprogs. This allows further extension of what quests can be used for. For example, having a quest complete check in the scripts to only allow people who completed a specfic quest or certain amount of quests. The possibilities are endless. PLEASE GIVE ME CREDIT! I don't ask for much, just some recognition that I did write this code... Besides, I did. Makes sense, no? 2. Quest file format # ~ ~ ~ S VNUM : Virtual number of the quest SHORTDESC : For internal use, for listing of quests, etc LONGDESC : Used by list_quests INFO : Showed to character when then type list , to provide further information on a quest. TYPE : Trigger check type QM VNUM : Vnum of a mob with the questmaster specproc which will offer this quest. FLAGS : As of current there is only one flag (1 << 0) which is the REPEATABLE toggle. This flag does not flag the quest as completed during the check thus it can be done over and over. TARGET : VNUM of target. This is either a mob, object, or room vnum depending on the quest type. EXPERIENCE : Amount of experience rewarded for completing the quest. NEXT QUEST : See note later on, links to next quest vnum VAL0 - VAL3: Spare values for future triggers 3. Quest types OBJECT : Get an object ROOM : Enter a room FIND MOB : Find a mob KILL MOB : Kill a mob SAVE MOB : Kill all non charmed mobs in room besides the target mob RETURN OBJ : Give object to mob with vnum 4. NEXT_QUEST (and linked stuff) The next quest feature has a lot of error checking in it which may break the chain, so I'm going to go and list the checks it makes. To end a chain next quest is either -1, not a valid quest, or the player already completed the next quest. NOTE: Repeatable quests are never flagged completed. 5. What the system does not do You will need to add 0.qst to your lib/world/qst index file (after creating that). That sets up a first quest so index will boot without error. The system at this point in time does NOT assign the questmaster specproc in olc. This was done for several reasons. The first and foremost being the problems of too many questmasters and not enough quests, and then always there's the hassle of assigning and removing that proc when they don't have anymore quests. On my mud I have dynamic addition of specprocs and questmaster is restricted to higher levels, so do what you wish with that. The system lacks many triggers or flags. Anything you add I would greatly appreciate to receive and include in later releases. This is just a bare skeleton for quests. 6. How the autoquest system works? Autoquest is a trigger based system, meaning it checks for a specific thing, and if you do/have it you complete the quest. Pretty simple, eh? Well there's some things to complicate it. Quests can automatically link to another quest meaning when you finish one, you're set to do another. And then there's figuring out exactly what you have to do, and more. Basic commands goes kinda like this: At the questmaster: LIST : Lists all available quests that questmaster offers. LIST ## : Lists the information on a particluar quest a qm offers. JOIN ## : Joins a quest the qm offers, as long as you don't have a current quest. Thats it! Nothing real complex on the user end. QSTAT and QLIST are provide for purely informational purposes. As for qedit: -- Quest number : [1] Quest zone: [0] 1) Name : sample quest 2) Description : Find an elemental, wherever it may be. 3) Information : In this quest, it is your goal to find an elemental. What does this mean? Well its that nifty ole test entry so load mob 20 and go to it, and it should work. (ps-this is testing long descs) 4) Questmaster : 1 -- Puff 5) Type : Find mob 6) Flags : NOBITS 7) Target vnum : 20 8) Experience : 1000 9) Next quest : -1 A) Values : 0 0 0 0 Q) Quit Enter choice : NAME : Used only internally for qlist, basic organization. DESC : What shows up in list INFO : What shows up in list ## QM : Who offers this quest (must have questmaster specproc) TYPE : Type of trigger (see earlier section) FLAGS : Quest flags, ie: REPEATABLE TARGET : Specific quest target, Find mob its the mob's vnum, etc. Basically common sense. EXP : Exp rewarded for completing a quest NEXT : The next quest which will be assigned upon completing that quest, -1 completes the entire quest (no more) VALUES : Extra values dependant on what type of trigger. 7. Problems? If I forgot something, or you have an idea or something to add just mail me at claywar@rjsonline.net. I appreciate any ideas. DO NOT however mail me asking for a patch. Installing it by hand lets you actually learn something about what this code does, and the basic theory it follows. Also, I don't have much time to patch it against stock. =)