Initial Commit
Initial Commit
This commit is contained in:
38
_module/nss/craft_noabthrows.nss
Normal file
38
_module/nss/craft_noabthrows.nss
Normal file
@@ -0,0 +1,38 @@
|
||||
#include "x2_inc_itemprop"
|
||||
|
||||
//This is actually the main function.
|
||||
int script(object oItem, object oPC)
|
||||
{
|
||||
if (GetLocalString(oPC, "LastProperty") == "StrengthAbility" || GetLocalString(oPC, "LastProperty") == "DexterityAbility" ||
|
||||
GetLocalString(oPC, "LastProperty") == "ConstitutionAbility" || GetLocalString(oPC, "LastProperty") == "IntelligenceAbility" ||
|
||||
GetLocalString(oPC, "LastProperty") == "WisdomAbility" || GetLocalString(oPC, "LastProperty") == "CharismaAbility"
|
||||
|| GetLocalString(oPC, "LastProperty") == "Throws" || GetLocalString(oPC, "LastProperty") == "Enhancement" || GetLocalString(oPC, "LastProperty") == "AC") 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;
|
||||
}
|
||||
Reference in New Issue
Block a user