Battledale_PRC8/_module/nss/idcust_prevrobes.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

58 lines
1.2 KiB
Plaintext

int GetNextRobeIndex( int iIndex)
{
if (iIndex == 179) //CEP2.2
iIndex == 173;
else if( iIndex == 120)
iIndex = 118;
else if( iIndex == 109)
iIndex = 38;
else if( iIndex == 37)
iIndex = 33;
else if( iIndex == 29)
iIndex = 21;
else if( iIndex == 19)
iIndex = 10;
else if( iIndex == 9)
iIndex = 6;
else if( iIndex == 2)
iIndex = 187;
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_ROBE);
if( GetIsDM( oPlayer))
SendMessageToPC( oPlayer, "The index before is: " + IntToString( iIndex));
iIndex--;
iIndex = GetNextRobeIndex( 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_ROBE, iIndex, TRUE);
if( GetIsObjectValid( oNewItem))
{
AssignCommand( oPlayer, ActionEquipItem( oNewItem, iSlot));
DestroyObject( oItem);
}
else
DestroyObject( oNewItem);
}