50 lines
1.2 KiB
Plaintext
50 lines
1.2 KiB
Plaintext
int GetNextBeltIndex( int iIndex)
|
|
{
|
|
|
|
if( iIndex == 18)
|
|
iIndex = 20;
|
|
else if( iIndex == 22)
|
|
iIndex = 63;
|
|
else if( iIndex == 64)
|
|
iIndex = 110; //CEP2.2
|
|
else if(iIndex == 116)
|
|
iIndex == 150;
|
|
else if(iIndex == 157)
|
|
iIndex == 167;
|
|
else if(iIndex == 169)
|
|
iIndex == 186;
|
|
else if(iIndex == 187)
|
|
iIndex == 0;
|
|
|
|
|
|
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_BELT);
|
|
|
|
if( GetIsDM( oPlayer))
|
|
SendMessageToPC( oPlayer, "The index before is: " + IntToString( iIndex));
|
|
|
|
iIndex++;
|
|
iIndex = GetNextBeltIndex( 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_BELT, iIndex, TRUE);
|
|
|
|
if( GetIsObjectValid( oNewItem))
|
|
{
|
|
AssignCommand( oPlayer, ActionEquipItem( oNewItem, iSlot));
|
|
DestroyObject( oItem);
|
|
}
|
|
else
|
|
DestroyObject( oNewItem);
|
|
}
|