Changed folder name.
Changed folder name.
This commit is contained in:
42
_module/nss/idcust_prevbelt.nss
Normal file
42
_module/nss/idcust_prevbelt.nss
Normal file
@@ -0,0 +1,42 @@
|
||||
int GetNextBeltIndex( int iIndex)
|
||||
{
|
||||
|
||||
if( iIndex == 185)
|
||||
iIndex = 63;
|
||||
if( iIndex == 62)
|
||||
iIndex = 16;
|
||||
if( iIndex == 2)
|
||||
iIndex = 0;
|
||||
if( iIndex < 0)
|
||||
iIndex = 186;
|
||||
|
||||
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);
|
||||
}
|
Reference in New Issue
Block a user