271 lines
4.5 KiB
Plaintext
271 lines
4.5 KiB
Plaintext
|
//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--;
|
||
|
|
||
|
//**********************PLATE INDEX*****************************
|
||
|
|
||
|
if( iIndex == 185)
|
||
|
{
|
||
|
iIndex = 62;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 59)
|
||
|
{
|
||
|
iIndex = 57;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 56)
|
||
|
{
|
||
|
iIndex = 53;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 52)
|
||
|
{
|
||
|
iIndex = 37;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 36)
|
||
|
{
|
||
|
iIndex = 23;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 22)
|
||
|
{
|
||
|
iIndex = 21;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 20)
|
||
|
{
|
||
|
iIndex = 14;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 13)
|
||
|
{
|
||
|
iIndex = 51;//Start Half Plate Index
|
||
|
return iIndex;
|
||
|
}
|
||
|
|
||
|
|
||
|
//**************************HALF PLATE INDEX*****************************
|
||
|
|
||
|
|
||
|
else if( iIndex == 50)
|
||
|
{
|
||
|
iIndex = 47;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 44)
|
||
|
{
|
||
|
iIndex = 33;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 32)
|
||
|
{
|
||
|
iIndex = 30;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 29)
|
||
|
{
|
||
|
iIndex = 17;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 16)
|
||
|
{
|
||
|
iIndex = 11;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 10)
|
||
|
{
|
||
|
iIndex = 32; //Start Breast Plate Indext
|
||
|
return iIndex;
|
||
|
}
|
||
|
|
||
|
//**********************BREAST PLATE INDEX***********************
|
||
|
|
||
|
else if( iIndex == 30)
|
||
|
{
|
||
|
iIndex = 26;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 23)
|
||
|
{
|
||
|
iIndex = 63; //Start Chain Index
|
||
|
return iIndex;
|
||
|
}
|
||
|
|
||
|
//**********************CHAIN INDEX****************************
|
||
|
|
||
|
else if( iIndex == 62)
|
||
|
{
|
||
|
iIndex = 59;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 58)
|
||
|
{
|
||
|
iIndex = 56;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 53)
|
||
|
{
|
||
|
iIndex = 38;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 37)
|
||
|
{
|
||
|
iIndex = 36;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 33)
|
||
|
{
|
||
|
iIndex = 29;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 28)
|
||
|
{
|
||
|
iIndex = 22;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 21)
|
||
|
{
|
||
|
iIndex = 18;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 17)
|
||
|
{
|
||
|
iIndex = 15;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 14)
|
||
|
{
|
||
|
iIndex = 4;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 3)
|
||
|
{
|
||
|
iIndex = 49; //Start Leather Index
|
||
|
return iIndex;
|
||
|
}
|
||
|
|
||
|
|
||
|
//***********************LEATHER INDEX***********************
|
||
|
|
||
|
|
||
|
else if( iIndex == 48)
|
||
|
{
|
||
|
iIndex = 42;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 40)
|
||
|
{
|
||
|
iIndex = 27;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 26)
|
||
|
{
|
||
|
iIndex = 16;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 15)
|
||
|
{
|
||
|
iIndex = 13;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 12)
|
||
|
{
|
||
|
iIndex = 10;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 9)
|
||
|
{
|
||
|
iIndex = 40; //Leather Index..
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 39)
|
||
|
{
|
||
|
iIndex = 28;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 27)
|
||
|
{
|
||
|
iIndex = 20;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 19)
|
||
|
{
|
||
|
iIndex = 50; //Start Cloth Index
|
||
|
return iIndex;
|
||
|
}
|
||
|
|
||
|
//**********************CLOTH INDEX*********************************
|
||
|
|
||
|
else if( iIndex == 49)
|
||
|
{
|
||
|
iIndex = 39;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 38)
|
||
|
{
|
||
|
iIndex = 19;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 18)
|
||
|
{
|
||
|
iIndex = 12;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 11)
|
||
|
{
|
||
|
iIndex = 9;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 4)
|
||
|
{
|
||
|
iIndex = 3;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 2)
|
||
|
{
|
||
|
iIndex = 1;
|
||
|
return iIndex;
|
||
|
}
|
||
|
else if( iIndex == 0)
|
||
|
{
|
||
|
iIndex = 50; //Start the cloth index over again (Don't go back to plate!)
|
||
|
return iIndex;
|
||
|
}
|
||
|
|
||
|
|
||
|
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_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);
|
||
|
}
|