/* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Forsettii's Quest Builder System. Version 1.0 Created for Layonara Online Forsettii Forsettii@yahoo.com April 7, 2004 Quest Style 2 : Give Rewards Script (Used for Solo Quests) Variables: Quest_Name - Same as Journal Entry gold_2_give - Amount of Gold Given item_2_take - Item to Take #1 item_2_give - Item Given to player for finishing quest xp is given to Player from the Journal num_item - Total number of Items the Quest Giver will take from the Player. UpdateJournal - Function used when All items collected to update Journal. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ #include "nw_i0_tool" void UpdateJournal(object oPC, string sName, string sGve_Item) { SetLocalInt(oPC, sName, 3); AddJournalQuestEntry(sName, 3, oPC, FALSE, FALSE, FALSE); // Give the speaker the items CreateItemOnObject(sGve_Item, oPC, 1); } void main() { string sName = GetLocalString(OBJECT_SELF, "quest_name"); string sQst_Num = sName + "_N"; int iGold = GetLocalInt(OBJECT_SELF, "gold_2_give"); int iXp = GetJournalQuestExperience(sName); string sGet_Item = GetLocalString(OBJECT_SELF, "item_2_take"); string sGve_Item = GetLocalString(OBJECT_SELF, "item_2_give"); int iTotal = GetLocalInt(OBJECT_SELF, "num_item"); object oPC = GetPCSpeaker(); // Remove PC from Party since this is an individual Quest RemoveFromParty(oPC); // Give the speaker some gold GiveGoldToCreature(oPC, iGold); // Give the speaker some XP (XP to Party) GiveXPToCreature(oPC, iXp); // Remove items from the player's inventory object oItem = GetObjectByTag(sGet_Item); if(GetIsObjectValid(oItem) != 0) DestroyObject(oItem); // Set the variables int iNum = GetLocalInt(oPC, sQst_Num); iNum++; //Testing string sNum = IntToString(iNum); string sMax = IntToString(iTotal); string sMessage = ("You have collected " + sNum + " of " + sMax + " items."); SendMessageToPC(oPC, sMessage); SetLocalInt(oPC, sQst_Num, iNum); if(iNum >= iTotal) { UpdateJournal(oPC, sName, sGve_Item); } }