enderalse/scripts/source/_00e_nq_g_06_functions.psc

331 lines
8.7 KiB
Plaintext

Scriptname _00E_NQ_G_06_Functions extends Quest Conditional
Import _00E_QuestFunctions
;=====================================================================================
; FUNCTIONS
;=====================================================================================
Function StartMessengerTimer()
RegisterForSingleUpdateGameTime(24)
EndFunction
Function PlaceMessenger()
If !bMessengerSpawned && (MQ12b.IsCompleted() || MQ12b.GetStage() < 5) && MQ14.GetStage() <= 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)
If _00E_AchievementsEnabled.GetValueInt() == 1
Game.UnlockAchievement("END_SIDED_DIJAAM_01")
EndIf
EndFunction
Function SideWithMael()
_00E_NQ_G_SidedMael.SetValue(1)
_00E_NQ_G_SidedDijaam.SetValue(0)
If _00E_AchievementsEnabled.GetValueInt() == 1
Game.UnlockAchievement("END_SIDED_MAEL_01")
EndIf
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.setAv("Aggression", 4)
_00E_NQ_G_06_MercenaryKilean_MageREF.StartCombat(PlayerREF)
_00E_NQ_G_06_MercenaryKilean_MageREF.setAv("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.setAv("Aggression", 4)
_00E_NQ_G_06_MercenaryEnderalean_MageREF.StartCombat(PlayerREF)
_00E_NQ_G_06_MercenaryEnderalean_MageREF.setAv("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)
Levelsystem.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)
Levelsystem.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
SetStage(45)
Else
SetStage(40)
EndIf
ElseIf !_00E_NQ_G_06_MercenaryEnderalean_MageREF.IsDisabled()
_00E_NQ_G_06_MercenaryEnderalean_MageREF.Disable()
SetStage(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()
Levelsystem.GiveEP(__Config_RewardEXP)
if _00E_NQ_G_SidedMael.GetValueInt() == 1
NQ_G_07Mael.SetStage(5)
Else
NQ_G_07Dijaam.SetStage(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
_00E_QuestFunctions Property Levelsystem 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
GlobalVariable Property _00E_AchievementsEnabled 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