Battledale_PRC8/_module/nss/idcust_modlhand.nss
Jaysyn904 4dba880acb Added ACP v4.1
Added ACP v4.1. Full compile.  Updated module name.  Updated release archive.
2024-09-08 18:23:43 -04:00

61 lines
1.3 KiB
Plaintext

int GetNextHandIndex( int iIndex)
{
if( iIndex == 2)
iIndex = 3;
else if( iIndex == 10)
iIndex = 63;
else if( iIndex == 64)
iIndex = 109; //CEP2.2
else if( iIndex == 114)
iIndex = 121;
else if( iIndex == 123)
iIndex = 150;
else if( iIndex == 156)
iIndex = 175;
else if( iIndex >= 176)
iIndex = 181;
else if( iIndex == 182)
iIndex = 186;
else if( iIndex >= 187)
iIndex = 1;
return iIndex;
}
void main()
{
//First line of the item customization script
object oPlayer = GetPCSpeaker();
int iSlot = GetLocalInt( OBJECT_SELF, "iSlot");
object oItem = GetItemInSlot( iSlot, oPlayer);
int iIndex = GetItemAppearance( oItem, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LHAND);
if( GetIsDM( oPlayer))
SendMessageToPC( oPlayer, "The index before is: " + IntToString( iIndex));
iIndex++;
iIndex = GetNextHandIndex( iIndex);
if( GetIsDM( oPlayer))
SendMessageToPC( oPlayer, "The index after is: " + IntToString( iIndex));
object oNewItem = CopyItemAndModify( oItem, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LHAND, iIndex, TRUE);
if( GetIsObjectValid( oNewItem))
{
AssignCommand( oPlayer, ActionEquipItem( oNewItem, iSlot));
DestroyObject( oItem);
}
else
DestroyObject( oNewItem);
}