onEnter:
#include "nwnx_sql"
//
void ExecuteThis(object oPC)
{
int nProgressQuestTo = 861251;
AddJournalQuestEntry("xenq_ud_yathrinquest", nProgressQuestTo, oPC, FALSE);
SetPersistentInt(oPC, "xenq_ud_yathrinquest", nProgressQuestTo);
object oPassport = GetItemPossessedBy(oPC,"pc_tracker");
SetLocalInt(oPassport,"xenq_ud_yathrinquest", nProgressQuestTo);
int nCurrentRank = GetPersistentInt(oPC, "RANK", "RP_Rank");
SetPersistentInt(oPC, "RANK", (nCurrentRank + 1), 0, "RP_Rank");
DelayCommand(10.0, SendMessageToPC(oPC, "You are in the Melee Magthere; rich with lore about the Drow race, Underdark and the Dark Seldarine. Take your time..."));
DelayCommand(60.0, SendMessageToPC(oPC, "You learn some new interesting lore that you did not know of before"));
DelayCommand(60.01, GiveXPToCreature(oPC, 200));
DelayCommand(120.0, SendMessageToPC(oPC, "Your continuous study reveals new knowledge"));
DelayCommand(120.01, GiveXPToCreature(oPC, 200));
DelayCommand(180.02, SendMessageToPC(oPC, "Your dedicated study bears precious fruits of knowledge"));
DelayCommand(180.03, GiveXPToCreature(oPC, 200));
DelayCommand(300.0, SendMessageToPC(oPC, "You have learned and revised all you can, you best not let the Yathrin wait forever."));
DelayCommand(300.01, AddJournalQuestEntry("xenq_ud_yathrinquest", 861252, oPC, FALSE));
DelayCommand(300.02, SetPersistentInt(oPC, "xenq_ud_yathrinquest", 861252));
DelayCommand(300.03, SetLocalInt(oPassport,"xenq_ud_yathrinquest", 861252));
DelayCommand(300.04, SetPersistentInt(oPC, "RANK", (nCurrentRank + 1), 0, "RP_Rank"));
}
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC))
return;
location lLoc = GetLocation(OBJECT_SELF);
object oExecutor = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_ipoint ", lLoc, FALSE, "executor_" + GetName(oPC));
// should use something better than GetName ... eg, ObjectToString(oPC), perhaps ...
// ( names can have funny characters that should need to be filtered )
// there's a thread on the Bioware forums here about the persistency of ObjectToString() ..... somewhere.
int nQuestEntry = 861250;
if (GetJournalEntry("xenq_ud_yathrinquest", oPC) == nQuestEntry)
{
AssignCommand(oExecutor, ExecuteThis(oPC));
}
}onExit:
#include "nwnx_sql"
void main()
{
object oPC = GetExitingObject();
// if (!GetIsPC(oPC)) return;
if (!GetIsOwnedByPlayer(oPC))
return;
object oExecutor = GetNearestObjectByTag("executor_" + GetName(oPC));
if (GetIsObjectValid(oExecutor))
{
DestroyObject(oExecutor, 0.01);
int nQuestEntry = 861251;
if (GetJournalEntry("xenq_ud_yathrinquest", oPC) == nQuestEntry)
{
int nProgressQuestTo = 861252;
AddJournalQuestEntry("xenq_ud_yathrinquest", nProgressQuestTo, oPC, FALSE);
SetPersistentInt(oPC, "xenq_ud_yathrinquest", nProgressQuestTo);
object oPassport = GetItemPossessedBy(oPC, "pc_tracker");
SetLocalInt(oPassport,"xenq_ud_yathrinquest", nProgressQuestTo);
int nCurrentRank = GetPersistentInt(oPC, "RANK", "RP_Rank");
SetPersistentInt(oPC, "RANK", (nCurrentRank + 1), 0, "RP_Rank");
}
}
}I don't have "nwnx_sql" so can't compile this, but the idea is there. ( with a few extra things that may or may not be relevant )