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

44 lines
1.6 KiB
Plaintext

/* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Forsettii's Quest Builder System.
Version 1.0
Created for Layonara Online
Forsettii Forsettii@yahoo.com
April 7, 2004
Mail Quest - This Script give the reward and add on to the quest.
Variables: mail_2_get - This the the mail to be delivered.
gold_4_mail - amount of gold to give for delivering mail.
xp - Given by the Journal.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
#include "nw_i0_tool"
void main()
{
string sGet_Item = GetLocalString(OBJECT_SELF, "mail_2_get");
string sLastPlace = GetStringRight(sGet_Item, 2);
int iQst_Pos = StringToInt(sLastPlace);
string sRem_Quest = GetStringRight(sGet_Item, GetStringLength(sGet_Item)-6);
string sName = GetStringLeft(sRem_Quest, 6);
int iGold = GetLocalInt(OBJECT_SELF, "gold_4_Mail");
int iXp = GetJournalQuestExperience(sName);
object oPC = GetPCSpeaker();
RemoveFromParty(oPC);
// Give the speaker some gold
GiveGoldToCreature(oPC, iGold);
// Give the speaker some XP (XP to Party)
GiveXPToCreature(oPC, iXp);
// Take the Mail.
object oItem = GetObjectByTag(sGet_Item);
if(GetIsObjectValid(oItem) != 0)
DestroyObject(oItem);
// Set the variables
SetLocalInt(oPC, sName, iQst_Pos);
AddJournalQuestEntry(sName, iQst_Pos, oPC, TRUE, FALSE, FALSE);
}