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

24 lines
945 B
Plaintext

void main()
{
object oItem;
int nSlot;
oItem = GetFirstItemInInventory(OBJECT_SELF);
while (GetIsObjectValid(oItem))
{
if (GetLocalInt(oItem, "X4ToEquip") == TRUE)
{
if (GetBaseItemType(oItem) == BASE_ITEM_ARMOR) nSlot = INVENTORY_SLOT_CHEST;
else if (GetBaseItemType(oItem) == BASE_ITEM_CLOAK) nSlot = INVENTORY_SLOT_CLOAK;
else if (GetBaseItemType(oItem) == BASE_ITEM_SMALLSHIELD) nSlot = INVENTORY_SLOT_LEFTHAND;
else if (GetBaseItemType(oItem) == BASE_ITEM_LARGESHIELD) nSlot = INVENTORY_SLOT_LEFTHAND;
else if (GetBaseItemType(oItem) == BASE_ITEM_TOWERSHIELD) nSlot = INVENTORY_SLOT_LEFTHAND;
else if (GetBaseItemType(oItem) == BASE_ITEM_HELMET) nSlot = INVENTORY_SLOT_HEAD;
else nSlot = INVENTORY_SLOT_RIGHTHAND;
SetLocalInt(oItem, "X4ToEquip", FALSE);
ActionEquipItem(oItem, nSlot); return;
}
oItem = GetNextItemInInventory(OBJECT_SELF);
}
}