51 lines
1.1 KiB
Plaintext
51 lines
1.1 KiB
Plaintext
|
int GetNextBeltIndex( int iIndex)
|
||
|
{
|
||
|
|
||
|
if( iIndex == 2)
|
||
|
iIndex = 3;
|
||
|
|
||
|
if( iIndex == 38)
|
||
|
iIndex = 151;
|
||
|
|
||
|
if( iIndex == 152)
|
||
|
iIndex = 153;
|
||
|
|
||
|
if( iIndex == 155)
|
||
|
iIndex = 156;
|
||
|
|
||
|
if( iIndex == 157)
|
||
|
iIndex = 158;
|
||
|
|
||
|
if( iIndex > 159)
|
||
|
iIndex = 1;
|
||
|
|
||
|
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_PELVIS);
|
||
|
|
||
|
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_PELVIS, iIndex, TRUE);
|
||
|
|
||
|
if( GetIsObjectValid( oNewItem))
|
||
|
{
|
||
|
AssignCommand( oPlayer, ActionEquipItem( oNewItem, iSlot));
|
||
|
DestroyObject( oItem);
|
||
|
}
|
||
|
else
|
||
|
DestroyObject( oNewItem);
|
||
|
}
|