//NOTE: I don't know who originally created this system, however //Genisys (Guile) modified this on 9/15/08 for 1.69 int GetLastTorsoIndex( object oItem) { int iIndex = GetItemAppearance( oItem, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_TORSO); iIndex--; //****************************CLOTHING INDEX********************************* if( iIndex == 162) //CEP2.2 { iIndex = 159; } else if( iIndex == 149) { iIndex = 119; } else if( iIndex == 118) { iIndex = 116; } else if( iIndex == 115) { iIndex = 114; } else if( iIndex == 112) { iIndex = 111; } else if( iIndex == 109) { iIndex = 50; } else if( iIndex == 49) { iIndex = 39; } else if( iIndex == 38) { iIndex = 19; } else if( iIndex == 18) { iIndex = 12; } else if( iIndex == 11) { iIndex = 9; } else if( iIndex == 4) { iIndex = 3; } else if( iIndex == 2) { iIndex = 1; } else if( iIndex == 0) { iIndex = 177; } //Start Over On Clothes... //****************************LEATHER INDEX****************************** //AC 1 else if( iIndex == 39) { iIndex = 28; } else if( iIndex == 27) { iIndex = 20; } else if( iIndex == 19) { iIndex = 49; //Start Studded Leather Index } //***************STUDDED LEATHER INDEX ************************ //AC 2 else if( iIndex == 48) { iIndex = 42; } else if( iIndex == 40) { iIndex = 27; } else if( iIndex == 26) { iIndex = 16; } else if( iIndex == 15) { iIndex = 13; } else if( iIndex == 12) { iIndex = 10; } else if( iIndex == 09) { iIndex = 40; //Start Over with Leath Index.. } //*******************CHAIN INDEX********************** //AC 3 else if( iIndex == 120) //CEP2.2 { iIndex = 44; } else if( iIndex == 42) { iIndex = 29; } else if( iIndex == 28) { iIndex = 22; } else if( iIndex == 21) { iIndex = 118; //Start with Chain Shirt } //********************CHAIN SHIRT INDEX*********************** //AC 4 else if( iIndex == 117) { iIndex = 115; } else if( iIndex == 114) { iIndex = 112; } else if( iIndex == 111) { iIndex = 63; } else if( iIndex == 62) { iIndex = 59; } else if( iIndex == 58) { iIndex = 56; } else if( iIndex == 53) { iIndex = 38; } else if( iIndex == 37) { iIndex = 36; } else if( iIndex == 33) { iIndex = 18; } else if( iIndex == 17) { iIndex = 15; } else if( iIndex == 14) { iIndex = 4; } else if( iIndex == 3) { iIndex = 210; //Start with Chain Mail Armor } //*****************CHAIN MAIL INDEX****************************** //AC 5 else if( iIndex == 209) { iIndex = 117; } else if( iIndex == 116) { iIndex = 32; } else if( iIndex == 30) { iIndex = 26; } else if( iIndex == 23) { iIndex = 129; //Start Over with Chain Index.. } //********************** BREAST PLATE INDEX ********************* //AC 6 else if( iIndex == 119) { iIndex = 48; } else if( iIndex == 47) { iIndex = 45; } else if( iIndex == 44) { iIndex = 30; } else if( iIndex == 29) { iIndex = 17; } else if( iIndex == 16) { iIndex = 11; } else if( iIndex == 10) { iIndex =52; //Start Half-Plate Index } //*************************HALF PLATE INDEX********************* //AC 7 else if( iIndex == 50) { iIndex = 47; } else if( iIndex == 45) { iIndex = 33; } else if( iIndex == 32) { iIndex = 186; //Start Plate Index } //********************** PLATE INDEX ************************** //AC 8 else if( iIndex == 185) //CEP2.2 { iIndex = 62; } else if( iIndex == 59) { iIndex = 57; } else if( iIndex == 56) { iIndex = 53; } else if( iIndex == 52) { iIndex = 37; } else if( iIndex == 36) { iIndex = 23; } else if( iIndex == 22) { iIndex = 21; } else if( iIndex == 20) { iIndex = 14; } else if( iIndex == 13) { iIndex = 120; //Start with Breast Plates } //Tell us which # to use... return iIndex; //PROTOTYPE END } ////////////////////////////////////////////////////////////////////////////// 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_TORSO); if( GetIsDM( oPlayer)) SendMessageToPC( oPlayer, "The index before is: " + IntToString( iIndex)); iIndex = GetLastTorsoIndex( oItem); if( GetIsDM( oPlayer)) SendMessageToPC( oPlayer, "The index after is: " + IntToString( iIndex)); object oNewItem = CopyItemAndModify( oItem, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_TORSO, iIndex, TRUE); if( GetIsObjectValid( oNewItem)) { AssignCommand( oPlayer, ActionEquipItem( oNewItem, iSlot)); DestroyObject( oItem); } else DestroyObject( oNewItem); }