From: Anders R. <ma...@us...> - 2003-11-01 14:44:35
|
Update of /cvsroot/planeshift/planeshift/src/server/bulkobjects In directory sc8-pr-cvs1:/tmp/cvs-serv20543/src/server/bulkobjects Modified Files: psnpcdialog.cpp psnpcdialog.h Log Message: - Removed old quest system. Index: psnpcdialog.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/bulkobjects/psnpcdialog.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** psnpcdialog.cpp 1 Nov 2003 11:24:31 -0000 1.7 --- psnpcdialog.cpp 1 Nov 2003 14:44:31 -0000 1.8 *************** *** 343,354 **** UpdateAntecedents(resp); - // search quest keyword to see if quest started or ended - char *pEvent = strstr((const char *)resp->response[which], "$quest_"); - if (pEvent!=NULL) - { - printf("Quest event found! %s", pEvent); - InsertQuestEvent(pEvent, currentClient->GetActor() ); - } - break; } --- 343,346 ---- *************** *** 363,407 **** return resp; - } - - int psNPCDialog::InsertQuestEvent(char *eventName, gemActor * actor) - { - char buffer[1024]; - - psString questName (eventName); - psString sep ("_"); - int spos = questName.FindSubString( sep, 0 ) + 1; - int epos = questName.FindSubStringReverse(sep, questName.Length()); - - csString temp (""); - temp.Append(questName + spos, epos-spos); - printf("InsertQuestEvent quest name: %s", temp.GetData()); - - csString command( "" ); - // set as started - if (strstr(eventName, "start")!=NULL) - { - command.Append( "INSERT INTO player_quests "); - sprintf( buffer, "(player_id,quest_name,started) VALUES (%llu, \"%s\", \"%s\" )", actor->GetPlayerID(), temp.GetData(),"Y"); - command.Append( buffer ); - - // set as completed - } - else if (strstr(eventName, "end")!=NULL) - { - command.Append( "UPDATE player_quests SET COMPLETED='Y' "); - sprintf( buffer, " WHERE player_id=%llu AND quest_name='%s' ", actor->GetPlayerID(), temp.GetData() ); - command.Append( buffer ); - psserver->GetProgressionManager()->ProcessEvent("quest_"+questName,actor); - } - printf("InsertQuestEvent 3 %s ", command.GetData()); - if (!db->Command(command.GetData())) - { - Error2("db ERROR: %s", db->GetLastError()); - Error2("LAST QUERY: %s", db->GetLastQuery()); - return 0; - } - else - return 1; } --- 355,358 ---- Index: psnpcdialog.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/bulkobjects/psnpcdialog.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** psnpcdialog.h 24 Oct 2003 07:37:40 -0000 1.4 --- psnpcdialog.h 1 Nov 2003 14:44:31 -0000 1.5 *************** *** 90,94 **** void SubstituteKeywords(); void CleanPunctuation(psString& str); - int InsertQuestEvent(char *eventName, gemActor *actor); public: --- 90,93 ---- |