This script (4 public functions, 2 private functions) is based on Knat's persistent quest & journal system but includes support for NWNX/ODBC. This script will help you get a persistent journal and manage persistent quest data. The zip files includes two versions, Knat's original bioware db version and my NWNX/ODBC version. Please make sure NWNX/ODBC (www.nwnx.org) is working properly before working with this script. There is are two tutorial modules included that gives you an interactive rundown on this system and quests in general. Very beginner friendly. Check the readme for more information.
Posted by Get_A_Fix at 2007-03-18 13:58:01 Voted 9.75 on 03/18/07
Get_A_Fix would like to add:
if you use NWNX2 and Fast French, simply paste the following code to the "ff_builtable.nss" script and Fast French will take care of making the correct MySQL table for this system:
(I pasted it right after the similar code that handles the pwdata table for APS)
*******************
SQLExecDirect("CREATE TABLE IF NOT EXISTS `tbl_questdata` ("+
"`ID` int auto_increment,"+
"`player_acct` varchar(64) NOT NULL default '',"+
"`player_character` varchar(64) NOT NULL default '',"+
"`szPlotID` varchar(32) NOT NULL default '',"+
"`szPlotState` varchar(4) NOT NULL default '',"+
"PRIMARY KEY (`ID`,`player_acct`,`player_character`)"+
") TYPE=MyISAM");
***************
Posted by cooldaddyo at 2006-07-11 08:31:59 Voted 10.00 on 07/11/06
I want to have the quest item drop from a mob (randomly would be ideal) rather than just be sitting in a container somewhere.
Am I still going to do that with quest_chest_dist ?
Also, do you need to add a new set of these custom scripts for each quest or is the idea to keep adding new lines inside these:
quest_a_start
quest_a_finish
quest_t_start
quest_t_progress
quest_t_retrieve
quest_t_finish
Sorry, These are old additions to check whether a player has completed a quest before rewarding again..It allows party members to help players in a group even if they have completed the quest before...they just will not get the reward...It is really just a DB check related to quest name.
Reference the previous message:
It should be for all members, I am no scripter, I just pull stuff together and make it work ;-) I have the upmost respect for all you contributors...My Arion scripter has added another function for remove item from all players too.....Which I will add here sometime today too.
Here is yet another set of questions for you. Since you are using FastFrench, what do these calls do?
if (ff_GetPCPersistentInt(oCreatureParty,GetName(OBJECT_SELF)+"ITEM")!= 1)
ff_SetPCPersistentInt(oCreatureParty,GetName(OBJECT_SELF)+"ITEM",1);
I notice you do something similar for both the XP and Gold award.
Posted by Duerfel_Cadarn at 2005-01-22 14:52:59 Voted 10.00 on 01/22/05
An awesome addition to the Vault. I've already seen it in action and think you did a great job. Can't wait to see future updates to this or other scripting efforts from you.
Just realised after I posted this, this does not use the journal way of getting gold value :| picked the wrong script, but that is easily updated inside the script to use that method also.Makzimia De Graf
DM/Creator
Island of Fredian a PW
Home of ATS/Salandra's crafting
As Grim mentioned he spoke with me, and at the time he asked me, I was busy with a few different projects, I still am, but, anyway, as a little bit of giving back to the community which I intend to do even more of shortly. Here is a finish script that does a few things. It checks all party is present, it checks for the item carried on each PC, it checks state of quest and it gives an item as well. This relies on the quest maker having made use of the journal to define XP and gold values also. Note this is an action script and would be placed in the conversation where you have just been given a reward. Keeping with Knats original ideals this would be a _a_finish script.
#include "pqj_inc"
#include "nw_i0_tool"
void main()
{
object oPC = GetFactionLeader(GetPCSpeaker());
object oItem;
object oCharacter = GetFirstFactionMember(oPC);
while (oCharacter != OBJECT_INVALID)
{
if (RetrieveQuestState("jt_journalentry", oCharacter) != 3)
{
oItem = GetItemPossessedBy(oPC, "ItemTag");
if (GetIsObjectValid(oItem)) DestroyObject(oItem);
if (GetObjectSeen(oCharacter,oPC) )
{
GiveXPToCreature(oCharacter,GetJournalQuestExperience("jt_journalentry"));
GiveGoldToCreature(oCharacter,1000);
}
}
else SendMessageToPC(oCharacter,"You have already done this quest and therefore will not receive experience");
Thanks for the additions. I just got your email and am eager to look into the things you added. I'm finishing up our persistent bindstone system right now and will look into this as soon as that get's cleaned up. It's about 95% done now.
I currently use the FastFrench version of NWNX and have just incorporated your system in successfully. I also made the changes to the inc file to support area checks and Giving gold to all party members etc....I'll send you the inc file along with any other relevant changes made to give this funtionality....then you can re-release it if you decide to use it...you may have to modify it slightly to remove any FastFrench references
In this first release, all I really did was re-write the existing functionality to use NWNX. As far as your specific questions.
"Can I just enquire if it offers the following though: "
"Area checks to ensure all party members are in the same area when receiving the reward? "
-- I'm actually very new to scripting and not well versed in the available function for determining things like this. Assuming that this type of information (same area) is available, then this seems like a logical extension of the function call. I'll put this on my list of things to look at when I look into enhancing the code.
"All party rewards with XP and Gold or items?"
-- I think I understand what you're asking but could you elaborate a bit more?
"Prevention of players doing the same quest again via another party and away from the area?"
-- if I understand this correctly, you should be able to use RetrieveQuestState prior to assigning a quest to a player.
"I hope you get good feedback on this effort you have put in."
--Thanks. I've recently begun digging into the scripting end of things and have a ton to learn, but the database extension came easy given my database experience.