Initial Commit
Initial Commit
This commit is contained in:
23
_module/nss/x4_pcequip.nss
Normal file
23
_module/nss/x4_pcequip.nss
Normal file
@@ -0,0 +1,23 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user