Memory Of Function

Transmutation
Level: Cleric */Oracle * 7, Sorcerer */Wizard * 7
Components: V, S, powdered skymetal worth 10,000 gp
Casting Time: 1 Standard Action
Range: touch
Target: object or construct touched
Duration: instantaneous
Saving Throw: Will negates
Spell Resistance: yes
  Even a Broken Object remembers what it means to be a functioning whole. You restore a Broken Object or damaged construct to a functional state, as if it were new and intact.
  Any pieces missing from the Object or construct remain missing. Significant missing pieces may prevent proper functioning. If the Object uses charges, the Object becomes fully charged. A timeworn Object becomes fully charged, but doesn't lose the timeworn condition (this spell is one of the few ways a timeworn item can be recharged). For 1 hour after this spell is cast on a timeworn Object, that Object does not suffer any chance of glitching. Other consumables such as ammunition are not restored.
  When this spell is cast upon a damaged construct, all hit point damage dealt to that construct is healed. When this spell is cast upon a destroyed construct, it is restored to full functionality and full hit points, provided no significant portion of the destroyed construct (such as an entire limb) is missing. Constructs brought back in this fashion regain their memories up to the moment of their destruction and have no particular inclination to serve the caster.
  If you attempt to cast this spell on an Object or a construct that has been destroyed for more than 10 years per Caster Level you possess, the spell fails.