Ancordia_PRC8/_module/nss/craft_notphysdmg.nss
Jaysyn904 102ba7dab6 Initial Commit
Initial Commit
2023-09-21 19:51:32 -04:00

37 lines
965 B
Plaintext

#include "x2_inc_itemprop"
//This is actually the main function.
int script(object oItem, object oPC)
{
if (GetLocalString(oPC, "Parameter") == "Slashing" || GetLocalString(oPC, "Parameter") == "Bludgeoning"
|| GetLocalString(oPC, "Parameter") == "Piercing") return FALSE;
return TRUE;
}
int StartingConditional()
{
object oPC = GetPCSpeaker();
int nSlot = 0;
object oItem;
int nResult;
//Check if the item being crafted is equipped
while (nSlot < 18)
{
oItem = GetItemInSlot(nSlot, oPC);
if (GetLocalInt(oItem, "Prototype") == TRUE)
nResult = script(oItem, oPC);
nSlot++;
}
//If the item is not equipped, search for it in the inventory
oItem = GetFirstItemInInventory(oPC);
while (GetIsObjectValid(oItem))
{
if (GetLocalInt(oItem, "Prototype") == TRUE)
nResult = script(oItem, oPC);
oItem = GetNextItemInInventory(oPC);
}
return nResult;
}