Marrok is the forger inside the Shining Knights Arms and Armour in chapter 1 of the OC. Silverblade is Barun Silverblade, he's the forger in chapter 3.
Yes, the crafting is done through conversation. After checking if there are items in the forge, the guy will then check if a valid item can be made. However, after creating an item once, if you try to create the same item again, it puts you through the conversation where he can't make an item.
This is the script for the valid item:
//::///////////////////////////////////////////////
//:: Valid Item
//:: Copyright © 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Returns true if a valid item can be made.
*/
//:://////////////////////////////////////////////
//:: Created By: Brent
//:: Created On: November 2001
//:://////////////////////////////////////////////
#include "NW_O0_ITEMMAKER"
int StartingConditional()
{
int iResult;
iResult = GetIsValidCombination(FALSE) == TRUE;
return iResult;
}
The invalid script is the same except 'GetIsValidCombination(FALSE) == TRUE' is 'GetIsValidCombination(FALSE) == FALSE'.
This is probably the part in itemmaker script where the GetIsValidCombination thing is:
//::///////////////////////////////////////////////
//:: GetCombo
//:: Copyright © 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Returns -1 if an invalid combination otherwise
returns the index into the array
*/
//:://////////////////////////////////////////////
//:: Created By:
//:: Created On:
//:://////////////////////////////////////////////
int GetIsValidCombination(int bDeleteItem, object oContainer=OBJECT_INVALID)
{
string sReagent1, sReagent2;
// * if not container specified then assume the
// * forge
if (GetIsObjectValid(oContainer) == FALSE)
{
oContainer = GetObjectByTag(GetLocalString(OBJECT_SELF,"NW_L_MYFORGE"));
}
object oItem = GetFirstItemInInventory(oContainer);
int bValid = GetIsObjectValid(oItem);
int i = 0;
int nArrayPosition = -1;
object oDeleteItem1, oDeleteItem2;
while (bValid == TRUE)
{
i = i + 1;
if (i == 1)
{
sReagent1 = GetTag(oItem);
oDeleteItem1 = oItem;
}
if (i == 2)
{
sReagent2 = GetTag(oItem);
oDeleteItem2 = oItem;
}
oItem = GetNextItemInInventory(oContainer);
bValid = GetIsObjectValid(oItem);
if (i > 2)
bValid = FALSE;
}
object oMagicalItem = OBJECT_INVALID;
object oReagent = OBJECT_INVALID;
if (IsMisc(oDeleteItem1) == TRUE)
{
// * assume other item must be 'magical item'
oMagicalItem = oDeleteItem2;
oReagent = oDeleteItem1;
}
else
{
// * assume first item is the magical item
oMagicalItem = oDeleteItem1;
oReagent = oDeleteItem2;
}
dbSpeak("reagent " + GetTag(oReagent));
dbSpeak("magicitem " + GetTag(oMagicalItem));
// * not enough or too many items
if ( (i <=0) || (i >= 3) )
{
nArrayPosition = -1;
}
else
{
nArrayPosition = GetItemPosition(oMagicalItem);
// dbSpeak("armor value : " + IntToString(GetItemACValue(oMagicalItem)));
// dbSpeak("224 : " + IntToString(nArrayPosition));
if (nArrayPosition != -1)
{
string sArrayReagent1 = GetLocalArrayString(OBJECT_SELF,"NW_COMBO_REAGENT_1", nArrayPosition);
dbSpeak("Array Reagent1 = " + sArrayReagent1);
// * Is one of the items the proper BaseItemType
// * Is one of the items the proper reagent
if ( (sArrayReagent1 == GetTag(oReagent)) && (IsValidBaseItem(oMagicalItem, nArrayPosition)) )
{
// * set the VALIDITEM local
SetValidItem(nArrayPosition);
SetValidItemCost(nArrayPosition);
SetValidItemCostToken(nArrayPosition);
if (bDeleteItem == TRUE)
{
// * blanks out the reward
SetLocalArrayString(OBJECT_SELF,"NW_COMBO_REWARD",nArrayPosition,"");
// * clear the basetype as well
SetLocalArrayInt(OBJECT_SELF,"NW_COMBO_BASETYPE",nArrayPosition,BASE_ITEM_INVALID);
//dbSpeak("AFTER DELETE BASE IN ARRAY: " + IntToString(GetLocalArrayInt(OBJECT_SELF,"NW_COMBO_BASETYPE", nArrayPosition)));
// * found a match
DestroyObject(oDeleteItem1);
DestroyObject(oDeleteItem2);
}
return TRUE;
}
else
{
nArrayPosition = -1;
dbSpeak("DEBUG: Reagent + Basetype not a match");
}
}
}
// * if there is a valid item then return true
if (nArrayPosition != -1)
{
return TRUE;
}
else
{
return FALSE;
}
}
Modifié par SVKnight, 16 août 2012 - 02:38 .