Files
HeroesStone_PRC8/_module/nss/qst_gv_mail_itm.nss
Jaysyn904 1eefc84201 Initial Commit
Initial Commit.
2025-09-14 15:40:46 -04:00

46 lines
1.3 KiB
Plaintext

/* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Forsettii's Quest Builder System.
Version 1.0
Created for Layonara Online
Forsettii Forsettii@yahoo.com
April 7, 2004
Used to Give Mail items in a Mail Quest
Variables: Quest_Name - Same as Journal Entry
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
#include "nw_i0_tool"
void main()
{
string sName = GetLocalString(OBJECT_SELF, "quest_name");
object oPC = GetPCSpeaker();
// Inspect local variables
int iQst = GetLocalInt(oPC, sName);
iQst++;
int iValue = iQst + 1;
string sQst = IntToString(iValue);
int length = GetStringLength(sQst);
if (length == 1)
{
sQst = "_0" + sQst;
}
else if (length == 2)
{
sQst = "_" + sQst;
}
// Remove PC from Party since this is an individual Quest
RemoveFromParty(oPC);
string sMail2Give = "quest_" + sName + sQst;
// Next line used for Troubleshooting
// SendMessageToPC(oPC, sMail2Give);
// Give the speaker the items
CreateItemOnObject(sMail2Give, oPC, 1);
SetLocalInt(oPC, sName, iQst);
AddJournalQuestEntry(sName, iQst, oPC, FALSE, FALSE, FALSE);
}