Shargast_PRC8/_module/Chapter 1/nss/mk_pre_armorpart.nss
Jaysyn904 66a0a3e043 Initial commit
Initial commit.
2024-08-03 14:13:18 -04:00

48 lines
1.2 KiB
Plaintext

#include "mk_inc_generic"
#include "x2_inc_craft"
#include "mk_inc_craft"
int StartingConditional()
{
object oPC = GetPCSpeaker();
object oItem;
if (MK_GenericDialog_IsInState(MK_STATE_COPY, TRUE))
{
int nItem = MK_GenericDialog_GetAction();
if (nItem>=0)
{
object oSourceItem = MK_GenericDialog_GetObject(nItem);
if (GetIsObjectValid(oSourceItem))
{
oItem = CIGetCurrentModItem(oPC);
oItem = MK_CopyAppearance(oItem, oSourceItem);
CISetCurrentModItem(oPC,oItem);
int nInventorySlot = MK_GetCurrentInventorySlot(oPC);
AssignCommand(oPC, ActionEquipItem(oItem, nInventorySlot));
}
}
}
oItem = CIGetCurrentModItem(oPC);
int nRobe = GetItemAppearance(oItem,ITEM_APPR_TYPE_ARMOR_MODEL,ITEM_APPR_ARMOR_MODEL_ROBE);
int iItemAppr;
for (iItemAppr=0; iItemAppr<=17; iItemAppr++)
{
MK_GenericDialog_SetCondition(iItemAppr,
( (nRobe==0) || (MK_IsBodyPartVisible(nRobe, iItemAppr))));
}
MK_SetCurrentModParts(GetPCSpeaker(),-1, -1, 0, 0);
return TRUE;
}