Initial upload
Initial upload
This commit is contained in:
53
_module/nss/idcust_prevpelvs.nss
Normal file
53
_module/nss/idcust_prevpelvs.nss
Normal file
@@ -0,0 +1,53 @@
|
||||
int GetNextBeltIndex( int iIndex)
|
||||
{
|
||||
if( iIndex == 185)
|
||||
iIndex = 175;
|
||||
else if( iIndex == 174)
|
||||
iIndex = 161;
|
||||
else if( iIndex == 160)
|
||||
iIndex = 159;
|
||||
else if( iIndex == 152)
|
||||
iIndex = 151;
|
||||
else if(iIndex == 149)
|
||||
iIndex == 122;
|
||||
else if(iIndex == 119)
|
||||
iIndex == 118;
|
||||
else if(iIndex == 111)
|
||||
iIndex == 63;
|
||||
else if(iIndex == 62)
|
||||
iIndex == 37;
|
||||
else if(iIndex == 2)
|
||||
iIndex == 1;
|
||||
else if(iIndex == 0)
|
||||
iIndex == 186;
|
||||
|
||||
|
||||
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);
|
||||
}
|
Reference in New Issue
Block a user