Initial upload
Initial upload
This commit is contained in:
60
_module/nss/idcust_modrobes.nss
Normal file
60
_module/nss/idcust_modrobes.nss
Normal file
@@ -0,0 +1,60 @@
|
||||
int GetNextRobeIndex( int iIndex)
|
||||
{
|
||||
if (iIndex == 1)
|
||||
iIndex == 3;
|
||||
|
||||
else if( iIndex == 7)
|
||||
iIndex = 10;
|
||||
|
||||
else if( iIndex == 11)
|
||||
iIndex = 20;
|
||||
|
||||
else if( iIndex == 22)
|
||||
iIndex = 30;
|
||||
|
||||
else if( iIndex == 34)
|
||||
iIndex = 38;
|
||||
|
||||
else if( iIndex == 39)
|
||||
iIndex = 110; //CEP2.2
|
||||
|
||||
else if( iIndex == 119)
|
||||
iIndex = 121;
|
||||
|
||||
else if( iIndex == 174)
|
||||
iIndex = 180;
|
||||
|
||||
else if( iIndex == 188)
|
||||
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_ROBE);
|
||||
|
||||
if( GetIsDM( oPlayer))
|
||||
SendMessageToPC( oPlayer, "The index before is: " + IntToString( iIndex));
|
||||
|
||||
iIndex++;
|
||||
iIndex = GetNextRobeIndex( 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_ROBE, iIndex, TRUE);
|
||||
|
||||
if( GetIsObjectValid( oNewItem))
|
||||
{
|
||||
AssignCommand( oPlayer, ActionEquipItem( oNewItem, iSlot));
|
||||
DestroyObject( oItem);
|
||||
}
|
||||
else
|
||||
DestroyObject( oNewItem);
|
||||
}
|
Reference in New Issue
Block a user