So, I'm using shadow mountain's Transmutation Chest system to simulate Diablo II's horadric chest.
What it is supposed to do is: If Player has 3 equal gems (in this case, runes) and let's say the runes are called "Vex", so he puts the 3 runes (not stacked) into the chest, and the chest will destroy the runes and give an Item (let's call it, Vex Sword).
So, the first script (which is being used on a Chest and it activates on "OnClose") is this:
Spoiler
// Transmutation chest
// Built for Shadow Mountain
// www.shadowmountain.netfirms.com
// Built by Mohobie
//
// Debug string left in place for those who wish to manipulate the script.
// This is the only script from the Transmutation chest system that needs to
// be in the module it's intended to be added to. The module
// "Shadow Mountain Transmutation Chest", which is included in the
// bundle should be used to create and expand the database.
//
// NOTE: Does not take into account item stacks.
//
void main()
{
int count = 0;
object oPC = GetLastClosedBy(); //Know what pc to give the new item to
object oItem = GetFirstItemInInventory();// Get item to start loop with
string sItem1, sItem2, sItem3, sItem;
if (!GetIsObjectValid(oItem))
return;
//SpeakString("debug, Start counter.",TALKVOLUME_TALK);
while(GetIsObjectValid(oItem))// main loop
{
count++;
if(count == 1)
{
sItem1 = GetTag(oItem);
sItem = GetResRef(oItem);
}
else if(count == 2)
sItem2 = GetTag(oItem);
else if(count == 3)
sItem3 = GetTag(oItem);
else if(count > 3) //Too many items in the chest
{
SpeakString("You have too many items in the transmutation chest.",TALKVOLUME_TALK);
return;
}
oItem = GetNextItemInInventory();
}
//SpeakString("debug, Start same item check.",TALKVOLUME_TALK);
if(sItem1 == sItem2 && sItem2 == sItem3)
{
//SpeakString("debug, Items passed likeness check",TALKVOLUME_TALK);
oItem = GetFirstItemInInventory();
string sItem2 = GetCampaignString("SM_Cube_DB",sItem);
if(sItem2 == "") //3 of a kind but no 'upgrade' availible
{
SpeakString("These Items cannot be transmuted.",TALKVOLUME_TALK);
return;
}
while(GetIsObjectValid(oItem))// remove contents of the chest
{
DestroyObject(oItem);
oItem = GetNextItemInInventory();
}
//Successfull transmution
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_POLYMORPH), oPC);
SpeakString("Your items have been transmuted.",TALKVOLUME_TALK);
//SpeakString("Debug, resref check",TALKVOLUME_TALK);
//SpeakString(sItem2,TALKVOLUME_TALK);
CreateItemOnObject(sItem2, oPC);
}
else // Items do not fit requirements or have no 'upgrade'
{
SpeakString("These Items cannot be transmuted.",TALKVOLUME_TALK);
}
}
So, as you can see, it'll look for "SM_Cube_DB" to see if the items are eligible to be "transmuted" or not. The thing is, I don't have this "SM_Cube_DB". I know what to do, I just don't know how to do(script) it...
Do you have the Shadow Mountain module? According to the comments at the top of the script you posted, that's what will create and expand the database you're missing.
Okay, so GetCampaignString() is similar to GetLocalString(), but it targets a database instead of a normal object. The module had a special script that would populate the database with these strings. What the bit in your script is doing is asking the database for a string variable whose name matches your item's resref. You could make a script that would populate your database with strings OnModuleLoad or...
...you could just replace this line with an if/else chain that sets the item to be created based on sItem:
if (sItem == "this_item")
sItem2 = "uber_item";
else if (sItem == "this_other_item")
sItem2 = "this_not_so_uber_item";
else
sItem2 = "this_terrible_item";