Aller au contenu

Photo

Re-setting quest's journal after reset


  • Veuillez vous connecter pour répondre
1 réponse à ce sujet

#1
Omnifarious'

Omnifarious'
  • Members
  • 3 messages

Hi i'm having a bit of a dilema i need to re apply a player's journal update status after a server reset heres what i have in my on enter script. take note im using NWNX2 already i just need a better script

 

#include "aps_include"
 
/// Blooded 1
 
void main()
{
 
object oPC = GetEnteringObject();
 
if (!GetIsPC(oPC)) return;
 
if (GetPersistentInt(oPC, "Blooded", "pwdata")!= 1)
   return;
 
AddJournalQuestEntry("Blooded", 1, oPC, FALSE, FALSE);
}
 
Okay heres what the problem is the script above will re apply the journal entry for the quest "Blooded" 1 but when not the second part of the quest  so when i make the script look like this it only applys the first part even if they have the second part 
 
#include "aps_include"
 
/// Blooded 1
 
void main()
{
 
object oPC = GetEnteringObject();
 
if (!GetIsPC(oPC)) return;
 
if (GetPersistentInt(oPC, "Blooded", "pwdata")!= 1)
   return;
 
AddJournalQuestEntry("Blooded", 1, oPC, FALSE, FALSE);
 
 
/// Blooded2
 
 
if (!GetIsPC(oPC)) return;
 
if (GetPersistentInt(oPC, "Blooded", "pwdata")!= 2)
   return;
 
AddJournalQuestEntry("Blooded", 2, oPC, FALSE, FALSE);
}
 
when the player is on the second part of the quest it will only apply the first part because they have both of the persistent integers i need a script that will overwrite the first integer to apply the second integer only if they have the second integer or just a whole new script in general that takes care of it can anybody help. take note that this script is NWNX mod

 

 



#2
Squatting Monk

Squatting Monk
  • Members
  • 445 messages
You're just trying to restore the quest state to what it was before the reset, yes? Do this:
#include "aps_include"
 
void main()
{
    object oPC = GetEnteringObject();
    int nState = GetPersistentInt(oPC, "Blooded", "pwdata");
    
    // Restore the PC's quest state only if he's started the quest.
    if (nState)
        AddJournalQuestEntry("Blooded", nState, oPC, FALSE, FALSE);
}
Also, this sort of thing is better suited to the scripting forum even though it's NWNX-related.