rotation llGetRootLocalRot()
Returns the local rotation of the root prim of the attachment.
If the object is not attached, it should return the root prims global rotation.
Basically this function should call llGetLocalRot with the context of the root prim of the object.
llGetRootRotation is essentually a call to llGetRot with the context being the root prim of the object. From the root prim of an attachment, llGetRot returns a combination of the attachments local rot and the avatars rotation. (This design decision was made to make it easy to implement weapons; but that is another discussion).
Because of the quirks of PRIM_ROT, you need to know the root prims local rotation when updating a child prims rotation. For non-attached objects this isn't a problem, just call llGetRootRotation, but for attached objects this is a major problem.
I'm new to scripting, but I can't figure out how to move an attached object by a global co-ordinate offset (eg upward or northward) without something like this, or even the rotation of the attachment point. How can I compensate when the local position is given and set in the frame of the attachment but the local rotation is given and set in the frame of the avatar, so I have no idea of the position coordinate system I'm using?