PWE_PRC8/_module/nss/ek_mpool_spawn.nss
Jaysyn904 ee1dc35889 Initial Commit
Initial Commit
2025-04-03 10:29:41 -04:00

173 lines
6.7 KiB
Plaintext

//::///////////////////////////////////////////////
//:: 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 = 6; // 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", 0); //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 = "The Dragon Wand";
SetLocalArrayString(oChest, "RECIPE", i, sRecipeName);
nNumComponents = 2;
SetLocalArrayInt(oChest, "NUM_COMPONENTS", i, nNumComponents);
SetLocalArrayString(oChest, sRecipeName, 1, "DragonHeart");
SetLocalArrayString(oChest, sRecipeName, 2, "DarkAdamantine");
SetLocalString(oChest, sRecipeName + "Reward", "TheDragonWand");
SetLocalInt(oChest, sRecipeName + "ONE_TIME_RECIPE", 0);
SetLocalInt(oChest, sRecipeName + "ALREADY_MADE", 0);
break;
case 2: sRecipeName = "The Outsider Wand";
SetLocalArrayString(oChest, "RECIPE", i, sRecipeName);
nNumComponents = 2;
SetLocalArrayInt(oChest, "NUM_COMPONENTS", i, nNumComponents);
SetLocalArrayString(oChest, sRecipeName, 1, "DarkAdamantine");
SetLocalArrayString(oChest, sRecipeName, 2, "MagicalOrb");
SetLocalString(oChest, sRecipeName + "Reward", "theoutsiderwan");
SetLocalInt(oChest, sRecipeName + "ONE_TIME_RECIPE", 0);
SetLocalInt(oChest, sRecipeName + "ALREADY_MADE", 0);
break;
case 3: sRecipeName = "The Spirit Wand";
SetLocalArrayString(oChest, "RECIPE", i, sRecipeName);
nNumComponents = 2;
SetLocalArrayInt(oChest, "NUM_COMPONENTS", i, nNumComponents);
SetLocalArrayString(oChest, sRecipeName, 1, "LichKingSkull");
SetLocalArrayString(oChest, sRecipeName, 2, "CrimsonCrystal");
SetLocalString(oChest, sRecipeName + "Reward", "TheSpiritWand");
SetLocalInt(oChest, sRecipeName + "ONE_TIME_RECIPE", 0);
SetLocalInt(oChest, sRecipeName + "ALREADY_MADE", 0);
break;
case 4: sRecipeName = "The Beast Wand";
SetLocalArrayString(oChest, "RECIPE", i, sRecipeName);
nNumComponents = 2;
SetLocalArrayInt(oChest, "NUM_COMPONENTS", i, nNumComponents);
SetLocalArrayString(oChest, sRecipeName, 1, "TrollQueenHead");
SetLocalArrayString(oChest, sRecipeName, 2, "CrimsonCrystal");
SetLocalString(oChest, sRecipeName + "Reward", "TheBeastWand");
SetLocalInt(oChest, sRecipeName + "ONE_TIME_RECIPE", 0);
SetLocalInt(oChest, sRecipeName + "ALREADY_MADE", 0);
break;
case 5: sRecipeName = "The Golem Wand";
SetLocalArrayString(oChest, "RECIPE", i, sRecipeName);
nNumComponents = 2;
SetLocalArrayInt(oChest, "NUM_COMPONENTS", i, nNumComponents);
SetLocalArrayString(oChest, sRecipeName, 1, "IronGolemHand");
SetLocalArrayString(oChest, sRecipeName, 2, "SapphireCrystal");
SetLocalString(oChest, sRecipeName + "Reward", "TheGolemWand");
SetLocalInt(oChest, sRecipeName + "ONE_TIME_RECIPE", 0);
SetLocalInt(oChest, sRecipeName + "ALREADY_MADE", 0);
break;
case 6: sRecipeName = "The Animal Wand";
SetLocalArrayString(oChest, "RECIPE", i, sRecipeName);
nNumComponents = 2;
SetLocalArrayInt(oChest, "NUM_COMPONENTS", i, nNumComponents);
SetLocalArrayString(oChest, sRecipeName, 1, "WhiteWolfHead");
SetLocalArrayString(oChest, sRecipeName, 2, "SapphireCrystal");
SetLocalString(oChest, sRecipeName + "Reward", "TheAnimalWand");
SetLocalInt(oChest, sRecipeName + "ONE_TIME_RECIPE", 0);
SetLocalInt(oChest, sRecipeName + "ALREADY_MADE", 0);
break;
}
}
}
SetLocalInt(oChest, "IS_SET_UP", 1);
}