;/ Decompiled by Champollion V1.0.1
Source   : OghmaInfiniumScript.psc
Modified : 2012-12-07 12:05:41
Compiled : 2012-12-07 12:05:44
User     : Daedalus
Computer : Daedalus
/;
scriptName OghmaInfiniumScript extends ObjectReference

;-- Properties --------------------------------------
book property MySelf auto
message property ChoiceMessage auto
Bool property HasBeenRead auto
quest property DA04 auto
Int property Advancement auto


;-- Variables ---------------------------------------

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

; Skipped compiler generated GotoState

; Skipped compiler generated GetState

function ReadOghmaInfinium(Bool fromWorld)

	if HasBeenRead as Bool || !DA04.GetStageDone(200)
		return
	endIf
	Int choice = ChoiceMessage.Show(0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000)
	if choice == 0

	elseIf choice == 1
		game.AddPerkPoints(7)
		game.GetPlayer().ModActorValue("Health", 200 as Float)
        if StorageUtil.HasIntValue(none, "volatileSkillXP")
            StorageUtil.AdjustIntValue(none, "volatileSkillXP", 250000)
        else
            StorageUtil.SetIntValue(none, "volatileSkillXP", 250000)
        endif
	elseIf choice == 2
		game.AddPerkPoints(7)
		game.GetPlayer().ModActorValue("Stamina", 200 as Float)
        if StorageUtil.HasIntValue(none, "volatileSkillXP")
            StorageUtil.AdjustIntValue(none, "volatileSkillXP", 250000)
        else
            StorageUtil.SetIntValue(none, "volatileSkillXP", 250000)
        endif
	elseIf choice == 3
		game.AddPerkPoints(7)
		game.GetPlayer().ModActorValue("Magicka", 200 as Float)
        if StorageUtil.HasIntValue(none, "volatileSkillXP")
            StorageUtil.AdjustIntValue(none, "volatileSkillXP", 250000)
        else
            StorageUtil.SetIntValue(none, "volatileSkillXP", 250000)
        endif
	endIf
	if choice != 0
		HasBeenRead = true
		utility.Wait(0.100000)
		Int oghmasInfinium = game.GetPlayer().GetItemCount(MySelf as form)
		game.GetPlayer().RemoveItem(MySelf as form, oghmasInfinium, false, none)
		if fromWorld && oghmasInfinium == 0
			self.Delete()
		endIf
	endIf
endFunction

function OnActivate(ObjectReference reader)

	if reader != game.GetPlayer() as ObjectReference || self.IsActivationBlocked()
		return
	endIf
	utility.WaitMenuMode(2.00000)
	self.ReadOghmaInfinium(true)
endFunction

function OnEquipped(actor reader)

	if reader != game.GetPlayer()
		return
	endIf
	utility.WaitMenuMode(2.00000)
	self.ReadOghmaInfinium(false)
endFunction
