;/ Decompiled by Champollion V1.0.1
Source   : NA_StartSexStandardScript.psc
Modified : 2015-09-22 22:40:27
Compiled : 2015-09-22 22:40:43
User     : tma
Computer : TMA-LT
/;
scriptName na_startsexstandardscript extends ReferenceAlias

;-- Properties --------------------------------------
ReferenceAlias property Animal auto
sexlabframework property SexLab auto

globalvariable property NA_NPCCheering auto
actor property NA_AM_Spider2 auto
actor property NA_AM_Spider auto
actor property NA_AM_Skeever01 auto
actor property NA_AM_Skeever02 auto
actor property NA_AM_Skeever03 auto
actor property NA_AM_Skeever04 auto
actor property NA_AM_Dog auto
actor property NA_AM_Dog2 auto
actor property NA_AM_Wlof2 auto
actor property NA_AM_Horse2 auto
actor property NA_AM_Bear2 auto
actor property NA_AM_Chaurus2 auto
actor property NA_AM_SabreCat2 auto
actor property NA_AM_Troll2 auto
actor property NA_AM_Wlof auto
actor property NA_AM_Horse auto
actor property NA_AM_Bear auto
actor property NA_AM_Chaurus auto
actor property NA_AM_SabreCat auto
actor property NA_AM_Troll auto

race property DogRace auto
race property WolfRace auto
race property HorseRace auto
race property BearRace auto
race property SabreCatSnowyRace auto
race property TrollRace auto
race property ChaurusRace auto
race property FrostbiteSpiderRace auto
race property SkavenRace auto
race property SkeeverRace auto

faction property NA_AnimalWorkFaction auto
message property NA_StartSexOption auto
message property NA_StartSexOptionSpider auto
message property NA_StartSexOptionSkaven auto
quest property NA_PS_PlayerApproach auto
actor property PlayerRef auto

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

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

function OnActivate(ObjectReference akActionRef)

	if akActionRef == PlayerRef as ObjectReference
		if Animal.GetActorReference().GetFactionRank(NA_AnimalWorkFaction) > 0 && Animal.GetActorReference().GetFactionRank(NA_AnimalWorkFaction) < 5

			If Animal.GetActorReference().GetRace() == FrostbiteSpiderRace
				Int ibutton = NA_StartSexOptionSpider.Show(0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000)
				if ibutton == 0
					self.RegisterForModEvent("AnimationEnd_AnimalSex", "AnimalSexEvent")
					SexLab.QuickStart(PlayerRef, Animal.GetActorReference(), none, none, none, none, "AnimalSex", "")
					NA_NPCCheering.SetValue(1 as Float)
				elseIf ibutton == 2
					self.RegisterForModEvent("AnimationEnd_AnimalSex", "AnimalSexEvent")
					SexLab.QuickStart(PlayerRef, Animal.GetActorReference(), NA_AM_Spider2, none, none, none, "AnimalSex", "")
					NA_NPCCheering.SetValue(1 as Float)
				endIf
			elseIf Animal.GetActorReference().GetRace() == DogRace
				Int ibutton = NA_StartSexOptionSpider.Show(0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000)
				if ibutton == 0
					self.RegisterForModEvent("AnimationEnd_AnimalSex", "AnimalSexEvent")
					SexLab.QuickStart(PlayerRef, Animal.GetActorReference(), none, none, none, none, "AnimalSex", "")
					NA_NPCCheering.SetValue(1 as Float)
				elseIf ibutton == 2
					self.RegisterForModEvent("AnimationEnd_AnimalSex", "AnimalSexEvent")
					SexLab.QuickStart(PlayerRef, Animal.GetActorReference(), NA_AM_Dog2, none, none, none, "AnimalSex", "")
					NA_NPCCheering.SetValue(1 as Float)
				endIf
			elseIf Animal.GetActorReference().GetRace() == WolfRace
				Int ibutton = NA_StartSexOptionSpider.Show(0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000)
				if ibutton == 0
					self.RegisterForModEvent("AnimationEnd_AnimalSex", "AnimalSexEvent")
					SexLab.QuickStart(PlayerRef, Animal.GetActorReference(), none, none, none, none, "AnimalSex", "")
					NA_NPCCheering.SetValue(1 as Float)
				elseIf ibutton == 2
					self.RegisterForModEvent("AnimationEnd_AnimalSex", "AnimalSexEvent")
					SexLab.QuickStart(PlayerRef, Animal.GetActorReference(), NA_AM_Wlof2, none, none, none, "AnimalSex", "")
					NA_NPCCheering.SetValue(1 as Float)
				endIf
			elseIf Animal.GetActorReference().GetRace() == HorseRace
				Int ibutton = NA_StartSexOptionSpider.Show(0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000)
				if ibutton == 0
					self.RegisterForModEvent("AnimationEnd_AnimalSex", "AnimalSexEvent")
					SexLab.QuickStart(PlayerRef, Animal.GetActorReference(), none, none, none, none, "AnimalSex", "")
					NA_NPCCheering.SetValue(1 as Float)
				elseIf ibutton == 2
					self.RegisterForModEvent("AnimationEnd_AnimalSex", "AnimalSexEvent")
					SexLab.QuickStart(PlayerRef, Animal.GetActorReference(), NA_AM_Horse2, none, none, none, "AnimalSex", "")
					NA_NPCCheering.SetValue(1 as Float)
				endIf
			elseIf Animal.GetActorReference().GetRace() == BearRace
				Int ibutton = NA_StartSexOptionSpider.Show(0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000)
				if ibutton == 0
					self.RegisterForModEvent("AnimationEnd_AnimalSex", "AnimalSexEvent")
					SexLab.QuickStart(PlayerRef, Animal.GetActorReference(), none, none, none, none, "AnimalSex", "")
					NA_NPCCheering.SetValue(1 as Float)
				elseIf ibutton == 2
					self.RegisterForModEvent("AnimationEnd_AnimalSex", "AnimalSexEvent")
					SexLab.QuickStart(PlayerRef, Animal.GetActorReference(), NA_AM_Bear2, none, none, none, "AnimalSex", "")
					NA_NPCCheering.SetValue(1 as Float)
				endIf
			elseIf Animal.GetActorReference().GetRace() == ChaurusRace
				Int ibutton = NA_StartSexOptionSpider.Show(0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000)
				if ibutton == 0
					self.RegisterForModEvent("AnimationEnd_AnimalSex", "AnimalSexEvent")
					SexLab.QuickStart(PlayerRef, Animal.GetActorReference(), none, none, none, none, "AnimalSex", "")
				elseIf ibutton == 2
					self.RegisterForModEvent("AnimationEnd_AnimalSex", "AnimalSexEvent")
					SexLab.QuickStart(PlayerRef, Animal.GetActorReference(), NA_AM_Chaurus2, none, none, none, "AnimalSex", "")
				endIf
			elseIf Animal.GetActorReference().GetRace() == SabreCatSnowyRace
				Int ibutton = NA_StartSexOptionSpider.Show(0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000)
				if ibutton == 0
					self.RegisterForModEvent("AnimationEnd_AnimalSex", "AnimalSexEvent")
					SexLab.QuickStart(PlayerRef, Animal.GetActorReference(), none, none, none, none, "AnimalSex", "")
					NA_NPCCheering.SetValue(1 as Float)
				elseIf ibutton == 2
					self.RegisterForModEvent("AnimationEnd_AnimalSex", "AnimalSexEvent")
					SexLab.QuickStart(PlayerRef, Animal.GetActorReference(), NA_AM_SabreCat2, none, none, none, "AnimalSex", "")
					NA_NPCCheering.SetValue(1 as Float)
				endIf
			elseIf Animal.GetActorReference().GetRace() == TrollRace
				Int ibutton = NA_StartSexOptionSpider.Show(0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000)
				if ibutton == 0
					self.RegisterForModEvent("AnimationEnd_AnimalSex", "AnimalSexEvent")
					SexLab.QuickStart(PlayerRef, Animal.GetActorReference(), none, none, none, none, "AnimalSex", "")
					NA_NPCCheering.SetValue(1 as Float)
				elseIf ibutton == 2
					self.RegisterForModEvent("AnimationEnd_AnimalSex", "AnimalSexEvent")
					SexLab.QuickStart(PlayerRef, Animal.GetActorReference(), NA_AM_Troll2, none, none, none, "AnimalSex", "")
					NA_NPCCheering.SetValue(1 as Float)
				endIf


			elseIf Animal.GetActorReference().GetRace() == SkavenRace || Animal.GetActorReference().GetRace() == SkeeverRace
				Int ibutton = NA_StartSexOptionSkaven.Show(0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000)
				if ibutton == 0
					SexLab.QuickStart(PlayerRef, Animal.GetActorReference(), none, none, none, none, "AnimalSex", "")
				elseIf ibutton == 2
						self.RegisterForModEvent("AnimationEnd_AnimalSex", "AnimalSexEvent")
						SexLab.QuickStart(PlayerRef, Animal.GetActorReference(), NA_AM_Skeever02, none, none, none, "AnimalSex", "")
						NA_NPCCheering.SetValue(1 as Float)
				elseIf ibutton == 3
						self.RegisterForModEvent("AnimationEnd_AnimalSex", "AnimalSexEvent")
						SexLab.QuickStart(PlayerRef, Animal.GetActorReference(), NA_AM_Skeever02, NA_AM_Skeever03, none, none, "AnimalSex", "")
						NA_NPCCheering.SetValue(1 as Float)
				elseIf ibutton == 4
						self.RegisterForModEvent("AnimationEnd_AnimalSex", "AnimalSexEvent")
						SexLab.QuickStart(PlayerRef, Animal.GetActorReference(), NA_AM_Skeever02, NA_AM_Skeever03, NA_AM_Skeever04, none, "AnimalSex", "")
						NA_NPCCheering.SetValue(1 as Float)
				endIf
			else 
				Int iButton = NA_StartSexOption.Show(0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000)
				if iButton == 0
					self.RegisterForModEvent("AnimationEnd_AnimalSex", "AnimalSexEvent")
					SexLab.QuickStart(PlayerRef, Animal.GetActorReference(), none, none, none, none, "AnimalSex", "")
					NA_NPCCheering.SetValue(1 as Float)
				endIf
			endIf
		endIf
	endIf
endFunction

; Skipped compiler generated GetState

function AnimalSexEvent(String eventName, String argString, Float argNum, form sender)

	NA_NPCCheering.SetValue(0 as Float)
	if Animal.GetActorReference().GetFactionRank(NA_AnimalWorkFaction) == 2
		self.GetOwningQuest().SetStage(self.GetOwningQuest().GetStage() + 10)
;		self.GetOwningQuest().SetStage(self.GetOwningQuest().GetStage() + 5)
	endIf
	self.UnregisterForModEvent("AnimationEnd_AnimalSex")
endFunction

; Skipped compiler generated GotoState
