4
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

326 lines
8.7 KiB

Scriptname _00E_NQ_G_06_Functions extends Quest Conditional
int function _GetScriptVersion() Global
return 1
endFunction
;=====================================================================================
; FUNCTIONS
;=====================================================================================
Function StartMessengerTimer()
RegisterForSingleUpdateGameTime(24)
EndFunction
Function PlaceMessenger()
If !bMessengerSpawned && (MQ12b.IsCompleted() || MQ12b.GetCurrentStageID() < 5) && MQ14.GetCurrentStageID() <= 15
If (PlayerREF.GetCurrentLocation() == CapitalCityLocation) || (PlayerREF.GetCurrentLocation() == _00E_SuntempleLocation)
bMessengerSpawned = True
objSpawnMarker = PlayerREF.PlaceAtMe(XMarkerHeading, 1)
objSpawnMarker.MoveTo(PlayerRef, -250.0 * Math.Sin(PlayerRef.GetAngleZ()), -250.0 * Math.Cos(PlayerRef.GetAngleZ()), PlayerRef.GetHeight())
If _00E_NQ_G_05_MessengerREF.IsDead()
_00E_NQ_G_05_MessengerREF.Resurrect()
EndIf
_00E_NQ_G_05_MessengerREF.Enable()
_00E_NQ_G_05_MessengerREF.MoveTo(objSpawnMarker)
UnregisterForUpdateGameTime()
StartSC01()
Else
RegisterForSingleUpdateGameTime(0.2)
EndIf
EndIf
EndFunction
Function DespawnMessenger()
_00E_NQ_G_05_MessengerREF.Disable()
EndFunction
Function GiveLetter()
If (PlayerREF.GetItemCount(_00E_NQ_G_06_LetterFromDijaam_M) == 0) && (PlayerREF.GetItemCount(_00E_NQ_G_06_LetterFromDijaam_F) == 0)
if PlayerREF.GetActorBase().GetSex() == 0
PlayerREF.AddItem(_00E_NQ_G_06_LetterFromDijaam_M, 1)
Else
PlayerREF.AddItem(_00E_NQ_G_06_LetterFromDijaam_F, 1)
Endif
EndIf
EndFunction
Function DespawnGuard()
_00E_NQ_G_06_GuardREF.Disable()
EndFunction
Function SideWithDijaam()
_00E_NQ_G_SidedDijaam.SetValue(1)
_00E_NQ_G_SidedMael.SetValue(0)
Steam.UnlockAchievement("END_SIDED_DIJAAM_01")
EndFunction
Function SideWithMael()
_00E_NQ_G_SidedMael.SetValue(1)
_00E_NQ_G_SidedDijaam.SetValue(0)
Steam.UnlockAchievement("END_SIDED_MAEL_01")
EndFunction
Function SpawnKileans()
_00E_NQ_G_06_MercenaryKilean_WarriorREF.Enable(abFadeIn = false)
_00E_NQ_G_06_MercenaryKilean_MageREF.Enable(abFadeIn = false)
_00E_NQ_G_06_MercenaryKilean_WarriorREF.MoveTo(_00E_NQ_G_06_KileanWarriorStandMarker)
_00E_NQ_G_06_MercenaryKilean_MageREF.MoveTo(_00E_NQ_G_06_KileanMageStandMarker)
_00E_NQ_G_06_MercenaryEnderalean_WarriorREF.disable()
_00E_NQ_G_06_MercenaryEnderalean_MageREF.disable()
EndFunction
Function StartFightKilean()
_00E_NQ_G_06_MercenaryKilean_WarriorREF.StartCombat(PlayerREF)
_00E_NQ_G_06_MercenaryKilean_WarriorREF.SetActorValue("Aggression", 4)
_00E_NQ_G_06_MercenaryKilean_MageREF.StartCombat(PlayerREF)
_00E_NQ_G_06_MercenaryKilean_MageREF.SetActorValue("Aggression", 4)
EndFunction
Function SpawnEnderaleans()
_00E_NQ_G_06_MercenaryEnderalean_WarriorREF.Enable(abFadeIn = false)
_00E_NQ_G_06_MercenaryEnderalean_MageREF.Enable(abFadeIn = false)
_00E_NQ_G_06_MercenaryEnderalean_WarriorREF.MoveTo(_00E_NQ_G_06_WarriorKneelMarker)
_00E_NQ_G_06_MercenaryEnderalean_MageREF.MoveTo(_00E_NQ_G_06_EnderaleanMageStandMarker)
_00E_NQ_G_06_MercenaryKilean_WarriorREF.disable()
_00E_NQ_G_06_MercenaryKilean_WarriorREF.disable()
EndFunction
Function StartFightEnderalean()
_00E_NQ_G_06_MercenaryEnderalean_WarriorREF.StartCombat(PlayerREF)
_00E_NQ_G_06_MercenaryEnderalean_WarriorREF.SetActorValue("Aggression", 4)
_00E_NQ_G_06_MercenaryEnderalean_MageREF.StartCombat(PlayerREF)
_00E_NQ_G_06_MercenaryEnderalean_MageREF.SetActorValue("Aggression", 4)
EndFunction
Function StopFight()
if !_00E_NQ_G_06_MercenaryKilean_MageREF.IsDisabled()
_00E_NQ_G_06_MercenaryKilean_MageREF.StopCombat()
_00E_NQ_G_06_MercenaryKilean_MageREF.SetGhost(True)
_00E_PlayerFunctions.GetTeleportControl().TeleportNPC(_00E_NQ_G_06_MercenaryKilean_MageREF, _00E_NPCDumpMarker)
ElseIf !_00E_NQ_G_06_MercenaryEnderalean_MageREF.IsDisabled()
_00E_NQ_G_06_MercenaryEnderalean_MageREF.StopCombat()
_00E_NQ_G_06_MercenaryEnderalean_MageREF.SetGhost(True)
_00E_PlayerFunctions.GetTeleportControl().TeleportNPC(_00E_NQ_G_06_MercenaryEnderalean_MageREF, _00E_NPCDumpMarker)
EndIf
EndFunction
Function DespawnMages()
if !_00E_NQ_G_06_MercenaryKilean_MageREF.IsDisabled()
_00E_NQ_G_06_MercenaryKilean_MageREF.Disable()
if PlayerREF.GetItemCount(_00E_NQ_G_06_Contract) > 0
SetCurrentStageID(45)
Else
SetCurrentStageID(40)
EndIf
ElseIf !_00E_NQ_G_06_MercenaryEnderalean_MageREF.IsDisabled()
_00E_NQ_G_06_MercenaryEnderalean_MageREF.Disable()
SetCurrentStageID(35)
EndIf
EndFunction
Function SetUpStage25()
if bBlackmailed == true
SetupSC04()
StartSC04()
ElseIf bBlackmailed == false
SetupSC03()
StartSC03()
EndIf
EndFunction
Function SetupSC02()
_00E_SC_DijaamOnelys.Enable()
_00E_SC_DijaamOnelys.MoveTo(_00E_NQ_G_06_DijaamSitMarker)
EndFunction
Function SetupSC03()
_00E_SC_Mael.MoveTo(_00E_NQ_G_06_MaelStandMarker)
_00E_NQ_G_06_GuardREF.Enable()
EndFunction
Function SetupSC04()
_00E_NQ_G_04_DoorGuardREF.MoveTo(_00E_NQ_G_06_ProtektorStandMarker)
EndFunction
Function SetupSC05()
if _00E_NQ_G_SidedDijaam.GetValue() == 1
SpawnEnderaleans()
_00E_NQ_G_06_ChestREF.AddItem(_00E_NQ_G_06_SickleNote)
EndIf
if _00E_NQ_G_SidedMael.GetValue() == 1
_00E_NQ_G_06_ChestREF.AddItem(_00E_NQ_G_06_Contract)
EndIf
EndFunction
Function StartSC01()
NQ_G_06_SC01_MessengerForceGreet.ForceStart()
EndFunction
Function StartSC02()
NQ_G_06_SC02_DijaamTalkAtTavern.ForceStart()
EndFunction
Function StartSC03()
NQ_G_06_SC03_MaelTalk.ForceStart()
EndFunction
Function StartSC04()
NQ_G_06_SC04_ProtektorKickPlayerOut.ForceStart()
EndFunction
Function StartSC05()
NQ_G_06_SC05_EncounterInCave.ForceStart()
EndFunction
Function RewardMoney()
PlayerREF.AddItem(Gold001, __Config_RewardMoney)
EndFunction
Function FinishQuest()
_00E_EPHandler.GiveEP(__Config_RewardEXP)
if _00E_NQ_G_SidedMael.GetValueInt() == 1
NQ_G_07Mael.SetCurrentStageID(5)
Else
NQ_G_07Dijaam.SetCurrentStageID(5)
EndIf
EndFunction
;=====================================================================================
; EVENTS
;=====================================================================================
Event OnUpdateGameTime()
NQG06_ReadyToSpawn.SetValueInt(1)
PlaceMessenger()
EndEvent
;=====================================================================================
; PROPERTIES
;=====================================================================================
ObjectReference objSpawnMarker ;for moving Messenger
bool Property bBlackmailed Auto Conditional
bool bMessengerSpawned
Quest Property MQ12b Auto
Quest Property MQ14 Auto
;rewards
int Property __Config_RewardEXP Auto
int Property __Config_RewardMoney Auto
MiscObject Property Gold001 Auto
;items
Book Property _00E_NQ_G_06_LetterFromDijaam_M Auto
Book Property _00E_NQ_G_06_LetterFromDijaam_F Auto
Book Property _00E_NQ_G_06_Contract Auto
Book Property _00E_NQ_G_06_SickleNote Auto
ObjectReference Property _00E_NQ_G_06_ChestREF Auto
;actors
Actor Property _00E_NQ_G_05_MessengerREF Auto
Actor Property PlayerREF Auto
Actor Property _00E_NQ_G_04_DoorGuardREF Auto
Actor Property _00E_SC_Mael Auto
Actor Property _00E_SC_DijaamOnelys Auto
Actor Property _00E_NQ_G_06_GuardREF Auto
Actor Property _00E_NQ_G_06_MercenaryEnderalean_WarriorREF Auto
Actor Property _00E_NQ_G_06_MercenaryEnderalean_MageREF Auto
Actor Property _00E_NQ_G_06_MercenaryKilean_WarriorREF Auto
Actor Property _00E_NQ_G_06_MercenaryKilean_MageREF Auto
Location Property CapitalCityLocation Auto
Location Property _00E_SuntempleLocation Auto
;scenes
Scene Property NQ_G_06_SC01_MessengerForceGreet Auto
Scene Property NQ_G_06_SC02_DijaamTalkAtTavern Auto
Scene Property NQ_G_06_SC03_MaelTalk Auto
Scene Property NQ_G_06_SC04_ProtektorKickPlayerOut Auto
Scene Property NQ_G_06_SC05_EncounterInCave Auto
;for spawning Marker to move Messenger to
Static Property XMarkerHeading Auto
;globals
GlobalVariable Property _00E_NQ_G_SidedDijaam Auto
GlobalVariable Property _00E_NQ_G_SidedMael Auto
GlobalVariable Property NQG06_ReadyToSpawn Auto
;marker
ObjectReference Property _00E_NQ_G_06_ProtektorStandMarker Auto
ObjectReference Property _00E_NQ_G_06_DijaamSitMarker Auto
ObjectReference Property _00E_NQ_G_06_MaelStandMarker Auto
ObjectReference Property _00E_NQ_G_06_WarriorKneelMarker Auto
ObjectReference Property _00E_NQ_G_06_EnderaleanMageStandMarker Auto
ObjectReference Property _00E_NQ_G_06_KileanWarriorStandMarker Auto
ObjectReference Property _00E_NQ_G_06_KileanMageStandMarker Auto
ObjectReference Property _00E_NPCDumpMarker Auto
;next quest
_00E_NQ_G_07_Functions Property NQ_G_07Mael Auto
_00E_NQ_G_07_Functions Property NQ_G_07Dijaam Auto