//:://///////////////////////////////////////////// //:: Name : Item Combination Set Up Script Revision 2 //:: FileName : chest_spawn //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* */ //::////////////////////////////////////////////// //:: Created By: Giolon //:: Created On: 9/16/02, Last Rev on 10/2/02 //::////////////////////////////////////////////// #include "array_functions" /* Ok, this basically sets up the chest the first time it is opened up. Here is a template for adding new recipes: // x is the number ID of the recipe. All recipe numbers must be in sequence, starting from 1. case X: sRecipeName = "Recipe 1"; //Name your recipe whatever you want. SetLocalArrayString(oChest, "RECIPE", i, sRecipeName); nNumComponents = 2; //The number of components in the recipe. SetLocalArrayInt(oChest, "NUM_COMPONENTS", i, nNumComponents); //Add one of these lines for each component in the recipe. // *WARNING* The first item of every recipe must be an item unique to that recipe! SetLocalArrayString(oChest, sRecipeName, 1, "ITEM_1_TAG"); SetLocalArrayString(oChest, sRecipeName, 2, "ITEM_2_TAG"); //This is blueprint resref of the reward item.. SetLocalString(oChest, sRecipeName + "Reward", "reward_res_ref"); //Set the first line below to 1 if you want this to be a 1 time recipe. SetLocalInt(oChest, sRecipeName + "ONE_TIME_RECIPE", 0); SetLocalInt(oChest, sRecipeName + "ALREADY_MADE", 0); break; */ void main() { object oChest = OBJECT_SELF; int bAlreadySetUp = GetLocalInt(oChest, "IS_SET_UP"); if (!bAlreadySetUp) { int nNumRecipes = 1; // This is the number of recipes. Be sure to update // this value as you add recipes. SetLocalInt(oChest, "NUM_RECIPES", nNumRecipes); SetLocalInt(oChest, "ENABLE_ONE_TIME_RECIPES", 1); //Set this to 0 if you don't need support for one time use recipes. string sRecipeName; int nNumComponents; int i; for (i = 1; i <= nNumRecipes; i ++) { switch (i) { /* Note that Recipe 1 and 2 share one of the same items. This is ok because the item is not the first (key) item in either recipe. */ case 1: sRecipeName = "Staff of Stars"; SetLocalArrayString(oChest, "RECIPE", i, sRecipeName); nNumComponents = 1; SetLocalArrayInt(oChest, "NUM_COMPONENTS", i, nNumComponents); SetLocalArrayString(oChest, sRecipeName, 1, "BrokenStaffofStars"); SetLocalString(oChest, sRecipeName + "Reward", "staffofstars"); SetLocalInt(oChest, sRecipeName + "ONE_TIME_RECIPE", 1); SetLocalInt(oChest, sRecipeName + "ALREADY_MADE", 0); break; } } } SetLocalInt(oChest, "IS_SET_UP", 1); }