Initial Commit

Initial Commit
This commit is contained in:
Jaysyn904
2023-09-21 19:51:32 -04:00
parent 65b5bd7fd3
commit 102ba7dab6
6400 changed files with 5741850 additions and 0 deletions

36
_module/nss/craft_ehe.nss Normal file
View File

@@ -0,0 +1,36 @@
#include "x2_inc_itemprop"
//This is actually the main function.
void script(object oItem, object oPC)
{
int nValue = GetGoldPieceValue(oItem);
if (GetItemHasItemProperty(oItem, ITEM_PROPERTY_AC_BONUS)) {SetLocalInt(oItem, "HasProperties", TRUE); return;}
DestroyObject(oItem);
object oNew = CreateItemOnObject("it_anc_helm3a", oPC);
SetLocalInt(oNew, "Prototype", TRUE);
SetItemCursedFlag(oNew, TRUE);
SetLocalString(oPC, "LastProperty", "EpicHelmet");
SetIdentified(oNew, TRUE);
}
void main()
{
object oPC = GetPCSpeaker();
int nSlot = 0;
object oItem;
//Check if the item being crafted is equipped
while (nSlot < 18)
{
oItem = GetItemInSlot(nSlot, oPC);
if (GetLocalInt(oItem, "Prototype") == TRUE) {script(oItem, oPC); return; }
nSlot++;
}
//If the item is not equipped, search for it in the inventory
oItem = GetFirstItemInInventory(oPC);
while (GetIsObjectValid(oItem))
{
if (GetLocalInt(oItem, "Prototype") == TRUE) {script(oItem, oPC); return; }
oItem = GetNextItemInInventory(oPC);
}
}