Changed folder name.
Changed folder name.
This commit is contained in:
42
_module/nss/idcust_modneck.nss
Normal file
42
_module/nss/idcust_modneck.nss
Normal file
@@ -0,0 +1,42 @@
|
||||
int GetNextNeckIndex( int iIndex)
|
||||
{
|
||||
|
||||
if(iIndex == 2)
|
||||
iIndex = 3;
|
||||
else if(iIndex == 7)
|
||||
iIndex = 63;
|
||||
else if(iIndex == 64)
|
||||
iIndex == 186;
|
||||
else if(iIndex == 187)
|
||||
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_NECK);
|
||||
|
||||
if( GetIsDM( oPlayer))
|
||||
SendMessageToPC( oPlayer, "The index before is: " + IntToString( iIndex));
|
||||
|
||||
iIndex++;
|
||||
|
||||
GetNextNeckIndex( 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_NECK, iIndex, TRUE);
|
||||
|
||||
if( GetIsObjectValid( oNewItem))
|
||||
{
|
||||
AssignCommand( oPlayer, ActionEquipItem( oNewItem, iSlot));
|
||||
DestroyObject( oItem);
|
||||
}
|
||||
else
|
||||
DestroyObject( oNewItem);
|
||||
}
|
||||
Reference in New Issue
Block a user