PoA_PRC8/_module/nss/idcust_prevshin.nss

48 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

2022-10-07 14:20:31 -04:00
int GetNextShinIndex( int iIndex)
{
if( iIndex == 185)
iIndex = 63;
if( iIndex == 62)
iIndex = 21;
if( iIndex == 2)
iIndex = 1;
if( iIndex == 0)
iIndex = 186;
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_LSHIN);
if( GetIsDM( oPlayer))
SendMessageToPC( oPlayer, "The index before is: " + IntToString( iIndex));
iIndex--;
iIndex = GetNextShinIndex( 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_LSHIN, iIndex, TRUE);
object oNewItem2 = CopyItemAndModify( oNewItem, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHIN, iIndex, TRUE);
DestroyObject( oNewItem);
if( GetIsObjectValid( oNewItem2))
{
AssignCommand( oPlayer, ActionEquipItem( oNewItem2, iSlot));
DestroyObject( oItem);
}
else
DestroyObject( oNewItem2);
}