Initial upload
Initial upload
This commit is contained in:
41
_module/nss/set_cloak_next.nss
Normal file
41
_module/nss/set_cloak_next.nss
Normal file
@@ -0,0 +1,41 @@
|
||||
|
||||
int GetNextCloakIndex( object oCloak)
|
||||
{
|
||||
int iIndex = GetItemAppearance( oCloak, ITEM_APPR_TYPE_SIMPLE_MODEL, 0);
|
||||
iIndex++;
|
||||
int iItemtype = GetBaseItemType( oCloak);
|
||||
|
||||
if ( iIndex ==0)
|
||||
iIndex = 1;
|
||||
else if( iIndex == 32)
|
||||
iIndex = 51; //CEP2.2
|
||||
else if( iIndex == 65)
|
||||
iIndex = 99;
|
||||
else if( iIndex >= 100)
|
||||
iIndex = 1;
|
||||
|
||||
return iIndex;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
object oPC = GetPCSpeaker();
|
||||
object oPlayer = oPC;
|
||||
object oCloak = GetItemInSlot(INVENTORY_SLOT_CLOAK, oPC);
|
||||
|
||||
int iIndex = GetNextCloakIndex(oCloak);
|
||||
|
||||
if( GetIsDM( oPlayer))
|
||||
SendMessageToPC( oPlayer, "The index is: " + IntToString( iIndex));
|
||||
|
||||
object oNewCloak = CopyItemAndModify(oCloak, ITEM_APPR_TYPE_SIMPLE_MODEL, 0, iIndex, TRUE);
|
||||
|
||||
if( GetIsObjectValid(oNewCloak))
|
||||
{
|
||||
AssignCommand( oPlayer, ActionEquipItem(oNewCloak, INVENTORY_SLOT_CLOAK));
|
||||
DestroyObject( oCloak);
|
||||
}
|
||||
else
|
||||
DestroyObject( oNewCloak);
|
||||
}
|
Reference in New Issue
Block a user