EN4_PRC8/_module/nss/rd_clearquest.nss

102 lines
2.9 KiB
Plaintext
Raw Permalink Normal View History

void SetPartyVariables(object oPC);
void main()
{
int iDifficulty;
int iGold;
int iXP;
int iChance;
int iRandom;
object oPC;
oPC = GetPCSpeaker();
if (GetLocalInt(oPC,"QuestType") == 1)
AddJournalQuestEntry("jCamp",12,oPC);
else
AddJournalQuestEntry("jDelivery",2,oPC);
if (GetLocalInt(oPC,"QuestAdventureZone") > 0)
{
SetLocalInt(GetModule(),"AdventureZone",0);
SetLocalInt(GetModule(),"AdvZones",0);
}
SetPartyVariables(oPC);
}
void SetPartyVariables(object oPC)
{
int iDeaths;
int iLastQuest;
int iNPCQuests;
int iIndex;
int iCount;
string sZone;
string sQuestStep;
object oGiver;
object oPartyMember = GetFirstFactionMember(oPC, TRUE);
while (GetIsObjectValid(oPartyMember) == TRUE)
{
oGiver = GetObjectByTag(GetLocalString(oPartyMember,"QuestGiver"));
iLastQuest =GetLocalInt(oPartyMember,"Quest");
SetLocalInt(oPartyMember,"LastQuest",iLastQuest);
SetLocalInt(oPartyMember,"Quest",0);
SetLocalInt(oPartyMember,"QuestStep",0);
SetLocalInt(oPartyMember,"QuestType",0);
SetLocalInt(oPartyMember,"QuestDifficulty",0);
SetLocalInt(oPartyMember,"QuestDone",0);
SetLocalInt(oPartyMember,"QuestItemUnknown",0);
SetLocalInt(oPartyMember,"SpecialQuestType",0);
SetLocalInt(oPartyMember,"QuestLevel",0);
SetLocalInt(oPartyMember,"QuestAdventureZone",0);
iCount = GetLocalInt(oPartyMember,"QuestSteps");
iIndex = 1;
while (iIndex <= iCount)
{
sQuestStep = "QuestStep" + IntToString(iIndex);
SetLocalInt(oPartyMember,sQuestStep,0);
SetLocalString(oPartyMember,sQuestStep + "Mob","");
SetLocalString(oPartyMember,sQuestStep + "Item","");
SetLocalString(oPartyMember,sQuestStep + "Token111","");
SetLocalString(oPartyMember,sQuestStep + "Token112","");
SetLocalString(oPartyMember,sQuestStep + "Token113","");
SetLocalString(oPartyMember,sQuestStep + "Response","");
SetLocalString(oPartyMember,sQuestStep + "Reply","");
SetLocalString(oPartyMember,sQuestStep + "Escort","");
SetLocalInt(oPartyMember,sQuestStep + "ItemUnknown",0);
iIndex++;
}
SetLocalInt(oPartyMember,"QuestSteps",0);
SetLocalString(oPartyMember,"QuestTargetNPC","");
SetLocalString(oPartyMember,"QuestItemTag","");
SetLocalString(oPartyMember,"QuestAttackers","");
SetLocalString(oPartyMember,"QuestGiver","");
SetLocalString(oPartyMember,"QuestTargetMob","");
SetLocalString(oPartyMember,"QuestCampType","");
SetLocalString(oPartyMember,"QuestEscort","");
sZone = GetLocalString(oPartyMember,"QuestZone");
SetLocalInt(GetModule(),sZone,0);
SetLocalString(oPartyMember,"QuestZone","");
iNPCQuests = GetLocalInt(oGiver,"QuestsCompleted");
iNPCQuests++;
SetLocalInt(oGiver,"QuestsCompleted",iNPCQuests);
SetLocalString(oGiver,"QUEST_PC" + IntToString(iNPCQuests),GetName(oPartyMember));
oPartyMember = GetNextFactionMember(oPC, TRUE);
}
}