Initial upload
Initial upload
This commit is contained in:
110
_module/nss/mod_shielda.nss
Normal file
110
_module/nss/mod_shielda.nss
Normal file
@@ -0,0 +1,110 @@
|
||||
int GetNextShieldIndex( object oShield)
|
||||
{
|
||||
int iIndex = GetItemAppearance( oShield, ITEM_APPR_TYPE_SIMPLE_MODEL, 0);
|
||||
iIndex++;
|
||||
int iItemtype = GetBaseItemType( oShield);
|
||||
|
||||
//shields
|
||||
if( iItemtype == BASE_ITEM_SMALLSHIELD)
|
||||
{
|
||||
if( iIndex == 0)
|
||||
iIndex = 11;
|
||||
else if( iIndex == 14)
|
||||
iIndex = 21;
|
||||
else if( iIndex == 24)
|
||||
iIndex = 31;
|
||||
else if( iIndex == 40) //CEP2.2
|
||||
iIndex = 41;
|
||||
else if( iIndex == 50)
|
||||
iIndex = 51;
|
||||
else if( iIndex == 58)
|
||||
iIndex = 61;
|
||||
else if( iIndex == 65)
|
||||
iIndex = 86;
|
||||
else if( iIndex == 89)
|
||||
iIndex = 11;
|
||||
|
||||
}
|
||||
else if( iItemtype == BASE_ITEM_LARGESHIELD)
|
||||
{
|
||||
if( iIndex == 0)
|
||||
iIndex = 11;
|
||||
else if( iIndex == 14)
|
||||
iIndex = 21;
|
||||
else if( iIndex == 24)
|
||||
iIndex = 31;
|
||||
else if( iIndex == 34) //CEP2.2
|
||||
iIndex = 41;
|
||||
else if( iIndex == 50)
|
||||
iIndex = 51;
|
||||
else if( iIndex == 89)
|
||||
iIndex = 90;
|
||||
else if( iIndex == 97)
|
||||
iIndex = 100;
|
||||
else if( iIndex == 110)
|
||||
iIndex = 111;
|
||||
else if( iIndex == 120)
|
||||
iIndex = 121;
|
||||
else if( iIndex == 130)
|
||||
iIndex = 131;
|
||||
else if( iIndex == 140)
|
||||
iIndex = 141;
|
||||
else if( iIndex == 150)
|
||||
iIndex = 151;
|
||||
else if( iIndex == 214)
|
||||
iIndex = 220;
|
||||
else if( iIndex >= 256)
|
||||
iIndex = 11;
|
||||
|
||||
}
|
||||
else if( iItemtype == BASE_ITEM_TOWERSHIELD)
|
||||
{
|
||||
if( iIndex == 0)
|
||||
iIndex = 11;
|
||||
else if( iIndex == 20)
|
||||
iIndex = 21;
|
||||
else if( iIndex == 24)
|
||||
iIndex = 31;
|
||||
else if( iIndex == 34) //CEP2.2
|
||||
iIndex = 41;
|
||||
else if( iIndex == 44)
|
||||
iIndex = 51;
|
||||
else if( iIndex == 120)
|
||||
iIndex = 121;
|
||||
else if( iIndex == 129)
|
||||
iIndex = 130;
|
||||
else if( iIndex == 140)
|
||||
iIndex = 141;
|
||||
else if( iIndex == 150)
|
||||
iIndex = 151;
|
||||
else if( iIndex == 154)
|
||||
iIndex = 181;
|
||||
else if( iIndex == 231)
|
||||
iIndex = 232;
|
||||
else if( iIndex == 238)
|
||||
iIndex = 11; //Start Over at Tower Shields
|
||||
|
||||
}
|
||||
return iIndex;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPlayer = GetPCSpeaker();
|
||||
object oShield = GetItemInSlot( INVENTORY_SLOT_LEFTHAND, oPlayer);
|
||||
|
||||
int iIndex = GetNextShieldIndex( oShield);
|
||||
|
||||
//if( GetIsDM( oPlayer))
|
||||
SendMessageToPC( oPlayer, "The index is: " + IntToString( iIndex));
|
||||
|
||||
object oNewShield = CopyItemAndModify(oShield, ITEM_APPR_TYPE_SIMPLE_MODEL, 0, iIndex, TRUE);
|
||||
|
||||
if( GetIsObjectValid( oNewShield))
|
||||
{
|
||||
AssignCommand( oPlayer, ActionEquipItem( oNewShield, INVENTORY_SLOT_LEFTHAND));
|
||||
DestroyObject( oShield);
|
||||
}
|
||||
else
|
||||
DestroyObject( oNewShield);
|
||||
}
|
Reference in New Issue
Block a user