Advertisement
Guest User

Untitled

a guest
Feb 24th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.70 KB | None | 0 0
  1. Scriptname LielleFollowerDialog extends Quest
  2.  
  3. import Game
  4.  
  5. Actor Property PlayerREF Auto
  6.  
  7. ReferenceAlias Property FollowerAlias Auto
  8.  
  9. Faction Property DismissedFollowerFaction Auto
  10.  
  11. Faction Property CurrentHireling Auto
  12.  
  13. Message Property FollowerDismissMessage Auto
  14.  
  15. Message Property FollowerDismissMessageWedding Auto
  16.  
  17. Message Property FollowerDismissMessageCompanions Auto
  18.  
  19. Message Property FollowerDismissMessageCompanionsMale Auto
  20.  
  21. Message Property FollowerDismissMessageCompanionsFemale Auto
  22.  
  23. Message Property FollowerDismissMessageWait Auto
  24.  
  25. SetHirelingRehire Property HirelingRehireScript Auto
  26.  
  27. GlobalVariable Property pPlayerFollowerCount Auto
  28.  
  29. Quest XFLMain
  30.  
  31. XFLMain = Game.GetFormFromFile(0x05000EFF, "EFFCore.esm") as Quest
  32.  
  33. ;Property to tell follower to say dismissal line
  34.  
  35. Int Property iFollowerDismiss Auto Conditional
  36.  
  37. Int EFFStatus
  38.  
  39. Event OnInit()
  40.  
  41. EFFStatus = Game.GetModByName("EFFCore.esm")
  42. If EFFStatus != 255 || EFFStatus != 0
  43. Debug.Notification("LielleCore: EFF Detected - Enhancing Behavior")
  44. EndIf
  45.  
  46. EndEvent
  47. ;----------------------------------------------------
  48.  
  49. Function SetFollower(ObjectReference FollowerRef)
  50.  
  51. If EFFStatus != 255
  52. XFLMain.XFL_AddFollower(FollowerRef as Actor)
  53.  
  54. ; Set the internal global for 3DNPC to allow/disallow recruiting
  55. If XFLMain.XFL_FollowerCountEx.value < XFLMain.XFL_MaximumFollowers.value
  56. pPlayerFollowerCount.SetValue(0)
  57. Else
  58. pPlayerFollowerCount.SetValue(1)
  59. Endif
  60.  
  61. Else
  62. actor FollowerActor = FollowerRef as Actor
  63.  
  64. FollowerActor.RemoveFromFaction(DismissedFollowerFaction)
  65.  
  66. If FollowerActor.GetRelationshipRank(PlayerREF) <3 && FollowerActor.GetRelationshipRank(PlayerREF) >= 0
  67.  
  68. FollowerActor.SetRelationshipRank(PlayerREF, 3)
  69.  
  70. EndIf
  71.  
  72. FollowerActor.SetPlayerTeammate()
  73.  
  74. ;FollowerActor.SetActorValue("Morality", 0)
  75.  
  76. FollowerAlias.ForceRefTo(FollowerActor)
  77.  
  78. FollowerActor.EvaluatePackage()
  79. EndIf
  80.  
  81. EndFunction
  82. ;----------------------------------------------------
  83.  
  84. Function FollowerWait()
  85.  
  86. If EFFStatus != 255
  87. XFLMain.XFL_SetWait(FollowerAlias.GetReference() as Actor)
  88. Else
  89. actor FollowerActor = FollowerAlias.GetActorRef() as Actor
  90.  
  91. FollowerActor.SetActorValue("WaitingForPlayer", 1)
  92.  
  93. FollowerActor.EvaluatePackage()
  94.  
  95. SetObjectiveDisplayed(10, abforce = true)
  96.  
  97. ;follower will wait 3 days
  98. EndIf
  99.  
  100. EndFunction
  101. ;----------------------------------------------------
  102.  
  103. Function FollowerFollow()
  104.  
  105. If EFFStatus != 255
  106. XFLMain.XFL_SetFollow(FollowerAlias.GetReference() as Actor)
  107. Else
  108. actor FollowerActor = FollowerAlias.GetActorRef() as Actor
  109.  
  110. FollowerActor.SetActorValue("WaitingForPlayer", 0)
  111.  
  112. FollowerActor.EvaluatePackage()
  113.  
  114. SetObjectiveDisplayed(10, abdisplayed = false)
  115.  
  116. FollowerActor.EvaluatePackage()
  117. EndIf
  118.  
  119. EndFunction
  120. ;----------------------------------------------------
  121.  
  122. Function DismissFollower(Int iMessage = 0, Int iSayLine = 1)
  123. If EFFStatus != 255
  124. XFLMain.XFL_RemoveFollower(FollowerAlias.GetReference() as Actor, iMessage, iSayLine)
  125.  
  126. ; Set the internal global for 3DNPC to allow/disallow recruiting
  127. If XFLMain.XFL_FollowerCountEx.value < XFLMain.XFL_MaximumFollowers.value
  128. pPlayerFollowerCount.SetValue(0)
  129. Else
  130. pPlayerFollowerCount.SetValue(1)
  131. Endif
  132. Else
  133. If FollowerAlias && FollowerAlias.GetActorReference().IsDead() == False
  134.  
  135. If iMessage == 0
  136.  
  137. FollowerDismissMessage.Show()
  138.  
  139. ElseIf iMessage == 1
  140.  
  141. FollowerDismissMessageWedding.Show()
  142.  
  143. ElseIf iMessage == 2
  144.  
  145. FollowerDismissMessageCompanions.Show()
  146.  
  147. ElseIf iMessage == 3
  148.  
  149. FollowerDismissMessageCompanionsMale.Show()
  150.  
  151. ElseIf iMessage == 4
  152.  
  153. FollowerDismissMessageCompanionsFemale.Show()
  154.  
  155. ElseIf iMessage == 5
  156.  
  157. FollowerDismissMessageWait.Show()
  158.  
  159. Else
  160.  
  161. ;failsafe
  162.  
  163. FollowerDismissMessage.Show()
  164.  
  165. EndIf
  166.  
  167. actor DismissedFollowerActor = FollowerAlias.GetActorRef() as Actor
  168.  
  169. DismissedFollowerActor.StopCombatAlarm()
  170.  
  171. DismissedFollowerActor.AddToFaction(DismissedFollowerFaction)
  172.  
  173. DismissedFollowerActor.SetPlayerTeammate(false)
  174.  
  175. DismissedFollowerActor.RemoveFromFaction(CurrentHireling)
  176.  
  177. DismissedFollowerActor.SetActorValue("WaitingForPlayer", 0)
  178.  
  179. ;hireling rehire function
  180.  
  181. HirelingRehireScript.DismissHireling(DismissedFollowerActor.GetActorBase())
  182.  
  183. If iSayLine == 1
  184.  
  185. iFollowerDismiss = 1
  186.  
  187. DismissedFollowerActor.EvaluatePackage()
  188.  
  189. ;Wait for follower to say line
  190.  
  191. Utility.Wait(2)
  192.  
  193. EndIf
  194.  
  195. FollowerAlias.Clear()
  196.  
  197. iFollowerDismiss = 0
  198.  
  199. ;don't set count to 0 if Companions have replaced follower
  200.  
  201. If iMessage == 2
  202.  
  203. ;do nothing
  204.  
  205. EndIf
  206.  
  207. EndIf
  208.  
  209. EndIf
  210. EndFunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement