54 lines
1.3 KiB
Plaintext
54 lines
1.3 KiB
Plaintext
int GetNextNeckIndex( int iIndex)
|
|
{
|
|
|
|
if( iIndex == 0)
|
|
iIndex = 186;
|
|
else if ( iIndex == 185)
|
|
iIndex = 181;
|
|
else if(iIndex == 180)
|
|
iIndex == 160;
|
|
else if(iIndex == 149)
|
|
iIndex == 127;
|
|
else if(iIndex == 119)
|
|
iIndex == 113;
|
|
else if(iIndex == 111)
|
|
iIndex == 108;
|
|
else if(iIndex == 107)
|
|
iIndex == 63;
|
|
else if(iIndex == 62)
|
|
iIndex == 6;
|
|
else if ( iIndex == 2)
|
|
iIndex = 1;
|
|
else if ( iIndex == 0)
|
|
iIndex = 186; //Return to the last one..
|
|
|
|
return iIndex;
|
|
}
|
|
|
|
void main()
|
|
{
|
|
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_NECK);
|
|
|
|
if( GetIsDM( oPlayer))
|
|
SendMessageToPC( oPlayer, "The index before is: " + IntToString( iIndex));
|
|
|
|
iIndex--;
|
|
iIndex = GetNextNeckIndex( 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_NECK, iIndex, TRUE);
|
|
|
|
if( GetIsObjectValid( oNewItem))
|
|
{
|
|
AssignCommand( oPlayer, ActionEquipItem( oNewItem, iSlot));
|
|
DestroyObject( oItem);
|
|
}
|
|
else
|
|
DestroyObject( oNewItem);
|
|
}
|