Ref Me
Ref Who
Ref Shield
Short C
Short M
Long KEY
Begin OnAdd
set Who to Getcontainer
set Me to GetBaseObject
set Shield to Who.GetEquippedObject 13
end
Begin OnEquip
setWeaponType 0
set Who to Getcontainer
If Shield != 0
Who.UnequipItem Shield
endif
set C to 1
end
begin MenuMode 1
set Shield to Who.GetEquippedObject 13
If Shield != 0 && Who.GetEquipped Me
Who.UnequipItem Shield
endif
SetWeaponType 1
set M to 1
end
Begin OnUnEquip
setWeaponType 0
set C to 0
end
Begin OnDrop
set c to 0
end
Begin GameMode
if Who.GetEquipped Me && C == 0
SetWeaponType 0
If Shield != 0
Who.UnequipItem Shield
endif
set C to 1
endif
if M == 1 && Who.IsWeaponOut == 0
setWeaponType 0
set M to 0
endif
If C == 1 && Who.IsWeaponOut
set KEY to GetControl 8
SetWeaponType 1
set C to 2
elseIf C == 2 && IsKeyPressed2 KEY
setWeaponType 0
elseIf C == 2 && Who.IsWeaponOut == 0
setWeaponType 0
Message " "
Message " "
Who.UnequipItem Me
Who.equipItem Me
set c to 1
endif
If Who.GetEquipped Me == 0 && C == 1
setWeaponType 0
set C to 0
endif