Quest persistence work

Quest persistence work.
This commit is contained in:
Jaysyn904
2022-07-06 00:35:22 -04:00
parent 4af27ed685
commit ee912d2da9
55 changed files with 3670 additions and 61 deletions

View File

@@ -1,6 +1,6 @@
void main()
{
// Set destroyable.
// Set destroyable.
SetIsDestroyable(TRUE, FALSE, FALSE);
// Remove plot/immoral/lootable flags JUST in case.
SetPlotFlag(OBJECT_SELF, FALSE);

View File

@@ -53,4 +53,11 @@ void main()
SignalEvent(OBJECT_SELF, EventUserDefined(1007));
}
craft_drop_items(oKiller);
}
//:: Execute Default NPC OnDeath script
ExecuteScript("nw_c2_default7", OBJECT_SELF);
//:: Execute PRC NPC OnDeath script
ExecuteScript("prc_npc_death", OBJECT_SELF);
}

View File

@@ -0,0 +1,37 @@
//::///////////////////////////////////////////////
//:: qst_altar_2nd.nss
//:: Copyright (c) 2022 Project RATDOG
//:://////////////////////////////////////////////
/*
Sets stage #2 for the "Lost Altar" quest.
This destroys the altar.
*/
//:://////////////////////////////////////////////
//:: Created By: Jaysyn
//:: Created On: 20220705
//:://////////////////////////////////////////////
#include "pqj_inc"
void main()
{
//:: Declare major variables
object oPC = GetPCSpeaker();
//:: Set quest stage & update DB.
AddPersistentJournalQuestEntry("lostaltar", 2, oPC);
//:: Destroy Altar
//:: Set destroyable.
SetIsDestroyable(TRUE, FALSE, FALSE);
//:: Remove plot/immoral/lootable flags JUST in case.
SetPlotFlag(OBJECT_SELF, FALSE);
SetImmortal(OBJECT_SELF, FALSE);
SetLootable(OBJECT_SELF, FALSE);
//:: Destroy Altar
DestroyObject(OBJECT_SELF);
}

View File

@@ -0,0 +1,24 @@
//::///////////////////////////////////////////////
//:: qst_altar_3rd.nss
//:: Copyright (c) 2022 Project RATDOG
//:://////////////////////////////////////////////
/*
Sets stage #3 for the "Lost Altar" quest.
*/
//:://////////////////////////////////////////////
//:: Created By: Jaysyn
//:: Created On: 20220705
//:://////////////////////////////////////////////
#include "pqj_inc"
void main()
{
//:: Declare major variables
object oPC = GetPCSpeaker();
//:: Set quest stage & update DB.
AddPersistentJournalQuestEntry("lostaltar", 3, oPC);
}

View File

@@ -0,0 +1,33 @@
//::///////////////////////////////////////////////
//:: qst_altar_start.nss
//:: Copyright (c) 2022 Project RATDOG
//:://////////////////////////////////////////////
/*
Ends & rewards the "Lost Altar" quest.
*/
//:://////////////////////////////////////////////
//:: Created By: Tolen
//:: Created On: 8/15/2005 10:59:16 PM
//:://////////////////////////////////////////////
#include "pqj_inc"
#include "nw_i0_tool"
void main()
{
//:: Declare major variables
object oPC = GetPCSpeaker();
object oItemToTake;
//:: Give the PC's party some XP
RewardPartyXP(250, oPC);
//:: Set quest stage & update DB.
AddPersistentJournalQuestEntry("lostaltar", 4, oPC);
//:: Remove plot item from PC's inventory
oItemToTake = GetItemPossessedBy(oPC, "ZEP_HOLYSYMBOLhec");
if(GetIsObjectValid(oItemToTake) != 0)
DestroyObject(oItemToTake);
}

View File

@@ -0,0 +1,24 @@
//::///////////////////////////////////////////////
//:: qst_altar_start.nss
//:: Copyright (c) 2022 Project RATDOG
//:://////////////////////////////////////////////
/*
Start & tracks the "Lost Altar" quest.
*/
//:://////////////////////////////////////////////
//:: Created By: Jaysyn
//:: Created On: 20220705
//:://////////////////////////////////////////////
#include "pqj_inc"
void main()
{
//:: Declare major variables
object oPC = GetPCSpeaker();
//:: Set quest stage & update DB.
AddPersistentJournalQuestEntry("lostaltar", 1, oPC);
}

View File

@@ -0,0 +1,30 @@
//::///////////////////////////////////////////////
//:: qst_ch_altar04.nss
//:: Copyright (c) 2022 Project RATDOG
//:://////////////////////////////////////////////
/*
Checks that the "Lost Altar" quest has been
completed with the altar of Hecate intact.
*/
//:://////////////////////////////////////////////
//:: Created By: Jaysyn
//:: Created On: 20220705
//:://////////////////////////////////////////////
#include "pqj_inc"
int StartingConditional()
{
//: Declare major variables
object oPC = GetPCSpeaker();
int nInt;
//:: Inspect quest state
nInt = RetrieveQuestState("lostaltar", oPC);
//nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYlostaltar");
if (nInt >= 4)
return TRUE;
return FALSE;
}

View File

@@ -0,0 +1,29 @@
//::///////////////////////////////////////////////
//:: qst_ch_altar_nf.nss
//:: Copyright (c) 2022 Project RATDOG
//:://////////////////////////////////////////////
/*
Checks that the "Lost Altar" quest hasn't
been completed.
*/
//:://////////////////////////////////////////////
//:: Created By: Jaysyn
//:: Created On: 20220702
//:://////////////////////////////////////////////
#include "pqj_inc"
int StartingConditional()
{
//: Declare major variables
object oPC = GetPCSpeaker();
int nInt;
//:: Inspect quest state
nInt = RetrieveQuestState("lostaltar", oPC);
//nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYlostaltar");
if (nInt >= 4)
return FALSE;
return TRUE;
}

View File

@@ -0,0 +1,36 @@
//::///////////////////////////////////////////////
//:: qst_ch_door01.nss
//:: Copyright (c) 2022 Project RATDOG
//:://////////////////////////////////////////////
/*
Checks for the "Master of the Door" quest
having been started.
*/
//:://////////////////////////////////////////////
//:: Created By: Tolen
//:: Created On: ???
//:://////////////////////////////////////////////
#include "pqj_inc"
int StartingConditional()
{
//:: Declare major variables
object oPC = GetPCSpeaker();
int nInt;
int nGP = GetGold(oPC);
//:: Check to see if the PC has 1000 gp.
if ( GetGold(oPC) < 1000 )
return FALSE;
//:: Inspect local variables
nInt = RetrieveQuestState("door", oPC);
//nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYdoor");
if (!nInt == 1)
return FALSE;
return TRUE;
}

View File

@@ -0,0 +1,36 @@
//::///////////////////////////////////////////////
//:: qst_ch_door01g.nss
//:: Copyright (c) 2022 Project RATDOG
//:://////////////////////////////////////////////
/*
Checks for the "Master of the Door" quest
having been started & if the PC has 1000gp.
*/
//:://////////////////////////////////////////////
//:: Created By: Tolen
//:: Created On: ???
//:://////////////////////////////////////////////
#include "pqj_inc"
int StartingConditional()
{
//:: Declare major variables
object oPC = GetPCSpeaker();
int nInt;
int nGP = GetGold(oPC);
//:: Check to see if the PC has 1000 gp.
if ( GetGold(oPC) < 1000 )
return FALSE;
//:: Inspect local variables
nInt = RetrieveQuestState("door", oPC);
//nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYdoor");
if (!nInt == 1)
return FALSE;
return TRUE;
}

View File

@@ -0,0 +1,28 @@
//::///////////////////////////////////////////////
//:: qst_ch_kngsly01.nss
//:: Copyright (c) 2022 Project RATDOG
//:://////////////////////////////////////////////
/*
Checks for Stage #1 of the "Saving Sir
Kingsley" quest.
*/
//:://////////////////////////////////////////////
//:: Created By: Jaysyn
//:: Created On: 20220705
//:://////////////////////////////////////////////
#include "pqj_inc"
int StartingConditional()
{
//: Declare major variables
object oPC = GetPCSpeaker();
int nInt;
//:: Inspect quest state
nInt = RetrieveQuestState("kingsley", oPC);
if (!nInt == 1)
return FALSE;
return TRUE;
}

View File

@@ -0,0 +1,34 @@
//::///////////////////////////////////////////////
//:: qst_ch_kngsly01g.nss
//:: Copyright (c) 2022 Project RATDOG
//:://////////////////////////////////////////////
/*
Checks for Stage #1 of the "Saving Sir
Kingsley" quest & if the PC has 1000gp for
the Oracle.
*/
//:://////////////////////////////////////////////
//:: Created By: Jaysyn
//:: Created On: 20220705
//:://////////////////////////////////////////////
#include "pqj_inc"
int StartingConditional()
{
//: Declare major variables
object oPC = GetPCSpeaker();
int nInt;
int nGP = GetGold(oPC);
//:: Check to see if the PC has 1000 gp.
if ( GetGold(oPC) < 1000 )
return FALSE;
//:: Inspect quest state
nInt = RetrieveQuestState("kingsley", oPC);
if (!nInt == 1)
return FALSE;
return TRUE;
}

View File

@@ -0,0 +1,27 @@
//::///////////////////////////////////////////////
//:: qst_door_end.nss
//:: Copyright (c) 2022 Project RATDOG
//:://////////////////////////////////////////////
/*
Ends "Master of the Door" quest.
*/
//:://////////////////////////////////////////////
//:: Created By: Jaysyn
//:: Created On: 20220705
//:://////////////////////////////////////////////
#include "pqj_inc"
#include "nw_i0_tool"
void main()
{
//:: Declare major variables
object oPC = GetPCSpeaker();
//:: Set quest stage & update DB.
AddPersistentJournalQuestEntry("door", 2, oPC);
//:: Give the PC's party XP
RewardPartyXP(1000, oPC);
}

View File

@@ -0,0 +1,24 @@
//::///////////////////////////////////////////////
//:: qst_kngsly_2nd.nss
//:: Copyright (c) 2022 Project RATDOG
//:://////////////////////////////////////////////
/*
Sets stage #2 for the "Saving Sir Kingsley"
quest from Sir Jerry.
*/
//:://////////////////////////////////////////////
//:: Created By: Tolen
//:: Created On: 9/7/2005 10:02:59 PM
//:://////////////////////////////////////////////
#include "pqj_inc"
void main()
{
//:: Declare major variables
object oPC = GetPCSpeaker();
//:: Set quest stage & update DB.
AddPersistentJournalQuestEntry("kingsley", 2, oPC);
}

View File

@@ -0,0 +1,27 @@
//::///////////////////////////////////////////////
//:: qst_kngsly_3rd.nss
//:: Copyright (c) 2022 Project RATDOG
//:://////////////////////////////////////////////
/*
Sets stage #3 for the "Saving Sir Kingsley"
quest from Sir Jerry.
*/
//:://////////////////////////////////////////////
//:: Created By: Tolen
//:: Created On: 9/7/2005 10:02:59 PM
//:://////////////////////////////////////////////
#include "pqj_inc"
void main()
{
//:: Declare major variables
object oPC = GetPCSpeaker();
//:: Set quest stage & update DB.
AddPersistentJournalQuestEntry("kingsley", 1, oPC);
//:: Give the PC Kingley's Amulet
CreateItemOnObject("item066", oPC, 1);
}

View File

@@ -14,12 +14,11 @@
#include "pqj_inc"
void main()
{
{
//:: Declare major variables
object oPC = GetPCSpeaker();
object oPC = GetPCSpeaker();
//:: Set quest stage & update DB.
AddPersistentJournalQuestEntry("kingsley", 1, oPC);
}
AddPersistentJournalQuestEntry("kingsley", 1, oPC);
}

View File

@@ -9,10 +9,18 @@
int StartingConditional()
{
//: Declare major variables
object oPC = GetPCSpeaker();
int nGP = GetGold(oPC);
// Make sure the PC speaker has these items in their inventory
if(!HasItem(GetPCSpeaker(), "TeakwoodBox"))
return FALSE;
//:: Check to see if the PC has 1000 gp.
if ( GetGold(oPC) < 1000 )
return FALSE;
return TRUE;
// Make sure the PC speaker has these items in their inventory
if(!HasItem(GetPCSpeaker(), "TeakwoodBox"))
return FALSE;
return TRUE;
}

View File

@@ -1,11 +1,28 @@
// Port PC
///////////////////////////////////////////////////
// Clears all actions and jumps the caller to the provided object.
// (Useful when this needs to be delayed.)
void ClearAndJumpToObject(object oDestination);
void ClearAndJumpToObject(object oDestination)
{
ClearAllActions();
JumpToObject(oDestination);
}
void main()
{
object oPC = GetLastUsedBy(); // Get the user of the object
object oDest = GetObjectByTag("pirate1"); // way point tag.
if(GetIsPC(oPC))
{
AssignCommand(oPC,JumpToObject(oDest));
}
effect eVFX;
object oTarget;
// Get the creature who triggered this event.
object oPC = GetLastUsedBy();
// Find the location to which to teleport.
oTarget = GetWaypointByTag("WP_PIRATE01");
// Teleport the PC.
eVFX = EffectVisualEffect(VFX_IMP_UNSUMMON);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oPC);
DelayCommand(1.0, AssignCommand(oPC, ClearAndJumpToObject(oTarget)));
}