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

41 lines
1.6 KiB
Plaintext

#include "x2_inc_itemprop"
void main()
{
object oPC = GetPCSpeaker();
//Place any items in the main hand or the off-hand in the inventory
object oCopied;
int nCursed;
if (GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC) != OBJECT_INVALID)
{
nCursed = GetItemCursedFlag(GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC));
oCopied = CopyItem(GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC), oPC, TRUE);
if (oCopied != OBJECT_INVALID) DestroyObject(GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC));
if (nCursed == TRUE) SetItemCursedFlag(oCopied, TRUE);
nCursed = FALSE;
}
if (GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC) != OBJECT_INVALID)
{
nCursed = GetItemCursedFlag(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC));
oCopied = CopyItem(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC), oPC, TRUE);
if (oCopied != OBJECT_INVALID) DestroyObject(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC));
if (nCursed == TRUE) SetItemCursedFlag(oCopied, TRUE);
nCursed = FALSE;
}
//The end of this chunk of code
itemproperty ipAdd;
object oItem = GetFirstItemInInventory(oPC);
while (GetIsObjectValid(oItem))
{
if (GetLocalInt(oItem, "Prototype") == TRUE)
{
ipAdd = ItemPropertyUnlimitedAmmo(IP_CONST_UNLIMITEDAMMO_PLUS1);
IPSafeAddItemProperty(oItem, ipAdd);
SetLocalString(oPC, "LastProperty", "Ammo");
SetLocalInt(oPC, "SubType", -1);
return;
}
oItem = GetNextItemInInventory(oPC);
}
}