;/ Decompiled by Champollion V1.0.1
Source   : EnhancedCameraAliasScript.psc
Modified : 2013-01-18 11:35:09
Compiled : 2013-01-18 11:40:33
User     : Lee
Computer : LEES-PC
/;
scriptName EnhancedCameraAliasScript extends ReferenceAlias

;-- Properties --------------------------------------
Float[] property GeneralXZ auto
actor property PlayerRef auto
Float[] property StandingXZ auto
Float[] property SneakingXZ auto
;
Float[] property CombataddY auto

;-- Variables ---------------------------------------
Int Right
Int Left

;-- Functions ---------------------------------------

function OnInit()

	GeneralXZ = new Float[6]
	StandingXZ = new Float[22]
	SneakingXZ = new Float[22]
;
	CombataddY = new Float[6]
endFunction

Float[] function Standing(Float[] value)

	StandingXZ = value
endFunction

; Skipped compiler generated GetState

function OnObjectUnEquipped(Form akBaseObject, ObjectReference akReference)

	self.CheckEquipment()
endFunction

; Skipped compiler generated GotoState

Float[] function Sneaking(Float[] value)

	SneakingXZ = value
endFunction

;
Float[] function AddY(Float[] value)

	CombataddY = value
endFunction
;

function CheckEquipment()

	Left = PlayerRef.GetEquippedItemType(0)
	Right = PlayerRef.GetEquippedItemType(1)
	if PlayerRef.isSneaking()
		if (Left == 0 || Right == 0) && (Left == 1 || Left == 2 || Left == 3 || Left == 4 || Left == 10 || Right == 1 || Right == 2 || Right == 3 || Right == 4 || Right == 10)
			utility.SetINIFloat("fOverShoulderCombatPosX:Camera", SneakingXZ[0])
			utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", SneakingXZ[1])
			utility.SetINIFloat("fOverShoulderCombatAddY:Camera", CombataddY[3])
		elseIf (Left == 1 || Left == 2 || Left == 3 || Left == 4 || Right == 1 || Right == 2 || Right == 3 || Right == 4) && (Left == 10 || Left == 11 || Right == 10 || Right == 11)
			utility.SetINIFloat("fOverShoulderCombatPosX:Camera", SneakingXZ[2])
			utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", SneakingXZ[3])
			utility.SetINIFloat("fOverShoulderCombatAddY:Camera", CombataddY[3])
		elseIf Left == 5 || Left == 6 || Right == 5 || Right == 6
			utility.SetINIFloat("fOverShoulderCombatPosX:Camera", SneakingXZ[4])
			utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", SneakingXZ[5])
			utility.SetINIFloat("fOverShoulderCombatAddY:Camera", CombataddY[3])
		elseIf (Left == 1 || Left == 2 || Left == 3 || Left == 4) && (Right == 1 || Right == 2 || Right == 3 || Right == 4)
			utility.SetINIFloat("fOverShoulderCombatPosX:Camera", SneakingXZ[6])
			utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", SneakingXZ[7])
			utility.SetINIFloat("fOverShoulderCombatAddY:Camera", CombataddY[3])
		elseIf Left == 0 && Right == 0
			utility.SetINIFloat("fOverShoulderCombatPosX:Camera", SneakingXZ[8])
			utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", SneakingXZ[9])
			utility.SetINIFloat("fOverShoulderCombatAddY:Camera", CombataddY[3])
		elseIf (Left == 0 || Right == 0) && (Left == 8 || Left == 9 || Right == 8 || Right == 9)
			utility.SetINIFloat("fOverShoulderCombatPosX:Camera", SneakingXZ[10])
			utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", SneakingXZ[11])
			utility.SetINIFloat("fOverShoulderCombatAddY:Camera", CombataddY[4])
		elseIf (Left == 8 || Right == 8) && (Left == 9 || Right == 9)
			utility.SetINIFloat("fOverShoulderCombatPosX:Camera", SneakingXZ[12])
			utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", SneakingXZ[13])
			utility.SetINIFloat("fOverShoulderCombatAddY:Camera", CombataddY[4])
		elseIf (Left == 8 || Left == 9 || Right == 8 || Right == 9) && (Left == 1 || Left == 2 || Left == 3 || Left == 4 || Left == 10 || Left == 11 || Right == 1 || Right == 2 || Right == 3 || Right == 4 || Right == 10 || Right == 11)
			utility.SetINIFloat("fOverShoulderCombatPosX:Camera", SneakingXZ[14])
			utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", SneakingXZ[15])
			utility.SetINIFloat("fOverShoulderCombatAddY:Camera", CombataddY[4])
		elseIf Left == 8 && Right == 8 || Left == 9 && Right == 9
			utility.SetINIFloat("fOverShoulderCombatPosX:Camera", SneakingXZ[16])
			utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", SneakingXZ[17])
			utility.SetINIFloat("fOverShoulderCombatAddY:Camera", CombataddY[4])
		elseIf Left == 7 || Right == 7
			utility.SetINIFloat("fOverShoulderCombatPosX:Camera", SneakingXZ[18])
			utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", SneakingXZ[19])
			utility.SetINIFloat("fOverShoulderCombatAddY:Camera", CombataddY[5])
		elseIf Left == 12 || Right == 12
			utility.SetINIFloat("fOverShoulderCombatPosX:Camera", SneakingXZ[20])
			utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", SneakingXZ[21])
			utility.SetINIFloat("fOverShoulderCombatAddY:Camera", CombataddY[5])
		else
			utility.SetINIFloat("fOverShoulderCombatPosX:Camera", GeneralXZ[0])
			utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", GeneralXZ[1])
			utility.SetINIFloat("fOverShoulderCombatAddY:Camera", CombataddY[3])
		endIf
	elseIf !PlayerRef.isSneaking() && !PlayerRef.isOnMount()
		if (Left == 0 || Right == 0) && (Left == 1 || Left == 2 || Left == 3 || Left == 4 || Left == 10 || Right == 1 || Right == 2 || Right == 3 || Right == 4 || Right == 10)
			utility.SetINIFloat("fOverShoulderCombatPosX:Camera", StandingXZ[0])
			utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", StandingXZ[1])
			utility.SetINIFloat("fOverShoulderCombatAddY:Camera", CombataddY[0])
		elseIf (Left == 1 || Left == 2 || Left == 3 || Left == 4 || Right == 1 || Right == 2 || Right == 3 || Right == 4) && (Left == 10 || Left == 11 || Right == 10 || Right == 11)
			utility.SetINIFloat("fOverShoulderCombatPosX:Camera", StandingXZ[2])
			utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", StandingXZ[3])
			utility.SetINIFloat("fOverShoulderCombatAddY:Camera", CombataddY[0])
		elseIf Left == 5 || Left == 6 || Right == 5 || Right == 6
			utility.SetINIFloat("fOverShoulderCombatPosX:Camera", StandingXZ[4])
			utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", StandingXZ[5])
			utility.SetINIFloat("fOverShoulderCombatAddY:Camera", CombataddY[0])
		elseIf (Left == 1 || Left == 2 || Left == 3 || Left == 4) && (Right == 1 || Right == 2 || Right == 3 || Right == 4)
			utility.SetINIFloat("fOverShoulderCombatPosX:Camera", StandingXZ[6])
			utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", StandingXZ[7])
			utility.SetINIFloat("fOverShoulderCombatAddY:Camera", CombataddY[0])
		elseIf Left == 0 && Right == 0
			utility.SetINIFloat("fOverShoulderCombatPosX:Camera", StandingXZ[8])
			utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", StandingXZ[9])
			utility.SetINIFloat("fOverShoulderCombatAddY:Camera", CombataddY[0])
		elseIf (Left == 0 || Right == 0) && (Left == 8 || Left == 9 || Right == 8 || Right == 9)
			utility.SetINIFloat("fOverShoulderCombatPosX:Camera", StandingXZ[10])
			utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", StandingXZ[11])
			utility.SetINIFloat("fOverShoulderCombatAddY:Camera", CombataddY[1])
		elseIf (Left == 8 || Right == 8) && (Left == 9 || Right == 9)
			utility.SetINIFloat("fOverShoulderCombatPosX:Camera", StandingXZ[12])
			utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", StandingXZ[13])
			utility.SetINIFloat("fOverShoulderCombatAddY:Camera", CombataddY[1])
		elseIf (Left == 8 || Left == 9 || Right == 8 || Right == 9) && (Left == 1 || Left == 2 || Left == 3 || Left == 4 || Left == 10 || Left == 11 || Right == 1 || Right == 2 || Right == 3 || Right == 4 || Right == 10 || Right == 11)
			utility.SetINIFloat("fOverShoulderCombatPosX:Camera", StandingXZ[14])
			utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", StandingXZ[15])
			utility.SetINIFloat("fOverShoulderCombatAddY:Camera", CombataddY[1])
		elseIf Left == 8 && Right == 8 || Left == 9 && Right == 9
			utility.SetINIFloat("fOverShoulderCombatPosX:Camera", StandingXZ[16])
			utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", StandingXZ[17])
			utility.SetINIFloat("fOverShoulderCombatAddY:Camera", CombataddY[1])
		elseIf Left == 7 || Right == 7
			utility.SetINIFloat("fOverShoulderCombatPosX:Camera", StandingXZ[18])
			utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", StandingXZ[19])
			utility.SetINIFloat("fOverShoulderCombatAddY:Camera", CombataddY[2])
		elseIf Left == 12 || Right == 12
			utility.SetINIFloat("fOverShoulderCombatPosX:Camera", StandingXZ[20])
			utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", StandingXZ[21])
			utility.SetINIFloat("fOverShoulderCombatAddY:Camera", CombataddY[2])
		else
			utility.SetINIFloat("fOverShoulderCombatPosX:Camera", GeneralXZ[0])
			utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", GeneralXZ[1])
			utility.SetINIFloat("fOverShoulderCombatAddY:Camera", CombataddY[0])
		endIf
	elseIf PlayerRef.isOnMount()
;		utility.SetINIFloat("fOverShoulderCombatPosX:Camera", StandingXZ[4])
;		utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", StandingXZ[5])
		utility.SetINIFloat("fOverShoulderCombatPosX:Camera", GeneralXZ[4])
		utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", GeneralXZ[5])
	endIf
endFunction

function SetCamera()

	utility.SetINIFloat("fOverShoulderPosX:Camera", GeneralXZ[0])
	utility.SetINIFloat("fOverShoulderPosZ:Camera", GeneralXZ[1])
	utility.SetINIFloat("fOverShoulderHorsePosX:Camera", GeneralXZ[2])
	utility.SetINIFloat("fOverShoulderHorsePosZ:Camera", GeneralXZ[3])
endFunction

Float[] function General(Float[] value)

	GeneralXZ = value
endFunction

function OnPlayerLoadGame()

	(self.GetOwningQuest() as enhancedcamerascript).CheckVersion()
	self.SetCamera()
	self.CheckEquipment()
endFunction

function OnObjectEquipped(Form akBaseObject, ObjectReference akReference)

	self.CheckEquipment()
endFunction
