//TESH.scrollpos=0
//TESH.alwaysfold=0
Name | Type | is_array | initial_value |
gc | gamecache | No | |
Loading | boolean | No | |
PlayerUnit | unit | No | UnitNull |
//TESH.scrollpos=0
//TESH.alwaysfold=0
globals
constant string MapPrefix = "Chap1Beta0.9"
constant real MapVersion = 0.92
endglobals
// Chap1Beta0.9 series:
// Name - MapVersion
// 0.9 - 0.9
// 0.9a - 0.91
// 0.9b - 0.915
// 0.9c - 0.916 // this was never actually released
// 0.9.2 - 0.92
// for one, you need to add flower code
//TESH.scrollpos=0
//TESH.alwaysfold=0
library TimerAttach
function TimerAttach takes timer t, real time, real value, code func returns nothing
call TimerStart(t, value, false, null)
call PauseTimer(t)
call TimerStart(t, time, false, func)
endfunction
function GetTimerInt takes timer t returns integer
return R2I(TimerGetRemaining(t) + 0.9)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
//******************************************************************************************
//*
//* CSSafety 14.1
//* ¯¯¯¯¯¯¯¯
//*
//* Utilities to make things safer. Currently this simply includes a timer recycling
//* Stack. Once you replace CreateTimer with NewTimer and DestroyTimer with ReleaseTimer
//* you no longer have to care about setting timers to null nor about timer related issues
//* with the handle index stack.
//*
//******************************************************************************************
library CSSafety
//==========================================================================================
globals
private timer array T
private integer N = 0
endglobals
function NewTimer takes nothing returns timer
if (N==0) then
return CreateTimer()
endif
set N=N-1
return T[N]
endfunction
//==========================================================================================
function ReleaseTimer takes timer t returns nothing
call PauseTimer(t)
if (N==8191) then
debug call BJDebugMsg("Warning: Timer stack is full, destroying timer!!")
//stack is full, the map already has much more troubles than the chance of bug
call DestroyTimer(t)
else
set T[N]=t
set N=N+1
endif
endfunction
endlibrary
//TESH.scrollpos=34
//TESH.alwaysfold=0
globals
convo cc
constant integer ANY = 0
constant integer UP = 1
constant integer DOWN = 3
constant integer LEFT = 2
constant integer RIGHT = 4
constant integer ESCAPE = 5
constant string KEY_COLOUR_CODE = "|cffaaaa00"
endglobals
library CGConvo initializer Init
globals
private string array DECISION_PREFIX
private constant string PREFIX_COLOUR = "|cffaaaa00"
private constant integer MAX_KEY = 5 // remember to make the array sizes below right
private constant integer MIN_KEY = 1
private constant real DISPLAY_TIME = 9999999.
endglobals
struct convo
static real DELAY = 0.5
player Player = Player(0)
integer PlayerId = 0
static unit LOCK_ON
string array DecisionValue[6]
string array DecisionIndex[6]
string OutputValue
string OutputIndex
integer OutputKey
static method Create takes nothing returns convo
local convo c = convo.create()
set c.LOCK_ON = CreateUnit(Player(15), 'h003', 0., 0., 0.)
return c
endmethod
method SetPlayer takes player p returns nothing
set this.Player = p
set this.PlayerId = GetPlayerId(p)
endmethod
method ClearDecisionAll takes nothing returns nothing
local integer i = 1
loop
exitwhen i > MAX_KEY
set this.DecisionIndex[i] = ""
set i = i + 1
endloop
endmethod
method AddDecision takes integer key, string value, string index returns nothing
if key == ANY then
set key = MIN_KEY
loop
if key > MAX_KEY then
call BJDebugMsg("Tried to insert decision, but all slots taken.")
call BJDebugMsg(value + "; INDEX= " + index)
return
endif
exitwhen this.DecisionIndex[key] == ""
set key = key + 1
endloop
endif
set this.DecisionIndex[key] = index
set this.DecisionValue[key] = value
endmethod
method WaitForOutput takes boolean cinematic returns nothing
local real array FieldData
local integer i = 0
local integer key
set KeyInput[this.PlayerId] = 0
if cinematic then
call EnableUserControl(true)
call SetUnitX(convo.LOCK_ON, GetCameraTargetPositionX())
call SetUnitY(convo.LOCK_ON, GetCameraTargetPositionY())
call SetCameraTargetController(convo.LOCK_ON, 0., 0., false)
loop
set FieldData[i] = GetCameraField(ConvertCameraField(i))
exitwhen i >= 7
set i = i + 1
endloop
//call ClearSelection()
//call EnableSelect( false, false )
//call EnablePreSelect( false, false )
endif
set i = MIN_KEY
loop
exitwhen i > MAX_KEY
if this.DecisionIndex[i] != "" then
call DisplayTimedTextToPlayer(this.Player, 0., 0., DISPLAY_TIME, DECISION_PREFIX[i] + this.DecisionValue[i])
endif
set i = i + 1
endloop
loop
loop
call TriggerSleepAction(0.)
set key = KeyInput[this.PlayerId]
exitwhen this.DecisionIndex[key] != ""
if cinematic then
set i = 0
loop
if i == 2 or i == 3 or i == 5 then
call AdjustCameraField(ConvertCameraField(i), FieldData[i]-GetCameraField(ConvertCameraField(i)), 0.1)
else
call SetCameraField(ConvertCameraField(i), FieldData[i], 0.1)
endif
//call BJDebugMsg(R2S(FieldData[i]) + "_" + I2S(i))
exitwhen i >= 7
set i = i + 1
endloop
//call SetCameraTargetController(convo.LOCK_ON, 0., 0., false)
endif
endloop
set this.OutputIndex = this.DecisionIndex[key]
set this.OutputValue = this.DecisionValue[key]
set this.OutputKey = KeyInput[this.PlayerId]
call TriggerSleepAction(0.)
exitwhen this.OutputKey != 0
endloop
if cinematic then
call EnableUserControl(false)
//call EnableSelect( true, true )
//call EnablePreSelect( true, true )
call PanCameraTo(GetUnitX(convo.LOCK_ON), GetUnitY(convo.LOCK_ON))
endif
if GetLocalPlayer() == this.Player then
call ClearTextMessages()
endif
endmethod
endstruct
private function Init takes nothing returns nothing
set DECISION_PREFIX[ANY] = PREFIX_COLOUR + "NO KEY! REPORT AS BUG!:|r "
set DECISION_PREFIX[UP] = PREFIX_COLOUR + "Up arrow:|r "
set DECISION_PREFIX[DOWN] = PREFIX_COLOUR + "Down arrow:|r "
set DECISION_PREFIX[LEFT] = PREFIX_COLOUR + "Left arrow:|r "
set DECISION_PREFIX[RIGHT] = PREFIX_COLOUR + "Right arrow:|r "
set DECISION_PREFIX[ESCAPE] = PREFIX_COLOUR + "Escape key:|r "
endfunction
endlibrary
function InitTrig_Convo_System takes nothing returns nothing
set cc = convo.Create()
endfunction
library ConTran requires CGConvo, TransmissionFuncs
endlibrary
//TESH.scrollpos=16
//TESH.alwaysfold=0
globals
integer array KeyInput
trigger cg_trg_Arrow_Up
trigger cg_trg_Arrow_Down
trigger cg_trg_Arrow_Left
trigger cg_trg_Arrow_Right
trigger cg_trg_Key_Escape
endglobals
function Trig_Arrow_Input_Up takes nothing returns nothing
set KeyInput[GetPlayerId(GetTriggerPlayer())] = UP
// call BJDebugMsg("up pressed")
endfunction
function Trig_Arrow_Input_Down takes nothing returns nothing
set KeyInput[GetPlayerId(GetTriggerPlayer())] = DOWN
// call BJDebugMsg("down pressed")
endfunction
function Trig_Arrow_Input_Left takes nothing returns nothing
set KeyInput[GetPlayerId(GetTriggerPlayer())] = LEFT
// call BJDebugMsg("left pressed")
endfunction
function Trig_Arrow_Input_Right takes nothing returns nothing
set KeyInput[GetPlayerId(GetTriggerPlayer())] = RIGHT
// call BJDebugMsg("right pressed")
endfunction
function Trig_Key_Input_Escape takes nothing returns nothing
set KeyInput[GetPlayerId(GetTriggerPlayer())] = ESCAPE
endfunction
function InitArrowInputForPlayer takes player p returns nothing
call TriggerRegisterPlayerKeyEventBJ( cg_trg_Arrow_Up, p, bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_UP )
call TriggerRegisterPlayerKeyEventBJ( cg_trg_Arrow_Down, p, bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_DOWN )
call TriggerRegisterPlayerKeyEventBJ( cg_trg_Arrow_Left, p, bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_LEFT )
call TriggerRegisterPlayerKeyEventBJ( cg_trg_Arrow_Right, p, bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_RIGHT )
call TriggerRegisterPlayerEventEndCinematic( cg_trg_Key_Escape, p )
endfunction
//===========================================================================
function InitTrig_Convo_Key_Input takes nothing returns nothing
set cg_trg_Arrow_Up = CreateTrigger( )
call TriggerAddAction( cg_trg_Arrow_Up, function Trig_Arrow_Input_Up )
set cg_trg_Arrow_Down = CreateTrigger( )
call TriggerAddAction( cg_trg_Arrow_Down, function Trig_Arrow_Input_Down )
set cg_trg_Arrow_Left = CreateTrigger( )
call TriggerAddAction( cg_trg_Arrow_Left, function Trig_Arrow_Input_Left )
set cg_trg_Arrow_Right = CreateTrigger( )
call TriggerAddAction( cg_trg_Arrow_Right, function Trig_Arrow_Input_Right )
set cg_trg_Key_Escape = CreateTrigger( )
call TriggerAddAction( cg_trg_Key_Escape, function Trig_Key_Input_Escape )
call InitArrowInputForPlayer(Player(0))
endfunction
//TESH.scrollpos=18
//TESH.alwaysfold=0
library TransmissionFuncs initializer Init requires TimerAttach, CSSafety,
globals
private unit bufferUnit
private string bufferName
private string bufferMessage = null
private string bufferSound = null
private real bufferTime
private sound currentSound = null
private string currentSoundString = null
boolean EscapeInterrupt = false
private boolean voluntaryTimer = true
private integer currentCheck = 1
boolean END_AFTER_VOICE = true // this controls whether or not the transmission is auto-skipped after the end of a voiced bit.
private timer soundTimer
private string soundTimerString
boolean InCinematic = false
private code interEx
endglobals
function GetDialogSpeed takes nothing returns integer // -2 to +2
return GetStoredInteger(udg_gc, MapPrefix + ":latest", "speed")
endfunction
function SetDialogSpeed takes integer sp returns nothing
call StoreInteger(udg_gc, MapPrefix + ":latest", "speed", sp)
endfunction
function GetAutoTime takes string s returns real
local integer i = GetDialogSpeed()
if i <= -2 then
return StringLength(s) / 10 + 5.
elseif i == -1 then
return StringLength(s) / 15 + 3.5
elseif i == 0 then
return StringLength(s) / 20 + 2.75
elseif i == -1 then
return StringLength(s) / 25 + 2.
else
return StringLength(s) / 30 + 1.75
endif
endfunction
function IncCheck takes nothing returns integer
if currentCheck >= 1022 then
set currentCheck = 1
else
set currentCheck = currentCheck + 1
endif
return currentCheck
endfunction
// InCinematic should be set properly to avoid problems with the interrupt.
function CinematicModeOn takes nothing returns nothing
local integer seed = GetRandomInt(0, 1073741824)
set InCinematic = true
call CinematicModeBJ(true, bj_FORCE_ALL_PLAYERS)
call SetRandomSeed(seed)
call DisableTrigger(gg_trg_Camera)
endfunction
function CinematicModeOff takes nothing returns nothing
set InCinematic = false
call CinematicModeBJ(false, bj_FORCE_ALL_PLAYERS)
call SelectUnit(pc.u, true) //this only applies to this map, duh.
call EnableTrigger(gg_trg_Camera)
endfunction
private function Interruption takes nothing returns nothing
call IncCheck()
if InCinematic then
if bufferMessage != null then
call TimerStart(CreateTimer(), 0.00, false, interEx)
else
set EscapeInterrupt = true
endif
if currentSound != null and bufferSound != currentSoundString then
call StopSound(currentSound, true, false)
endif
endif
endfunction
private function SetupVoice takes string snd returns nothing
if currentSound != null then
call KillSoundWhenDone(currentSound)
endif
call Preload(snd)
set currentSound = CreateSound(snd, false, false, false, 10, 10, "")
call StartSound(currentSound)
set currentSoundString = snd
endfunction
private function SoundOver takes nothing returns nothing
if soundTimer == GetExpiredTimer() and soundTimerString == currentSoundString then
call Interruption.execute()
endif
call DestroyTimer(GetExpiredTimer())
endfunction
function DisplayText takes string data returns nothing
call DisplayTextToPlayer(GetLocalPlayer(), 0., 0., data)
endfunction
function ConditionalInterruptEx takes nothing returns nothing
local integer check = GetTimerInt(GetExpiredTimer())
if check == currentCheck then
call Interruption()
endif
call ReleaseTimer(GetExpiredTimer())
endfunction
function ConditionalInterrupt takes real t returns nothing
if voluntaryTimer == true then
call TimerAttach(NewTimer(), t, currentCheck, function ConditionalInterruptEx)
endif
endfunction
function TransmissionBasic takes unit talker, string name, string message returns nothing
call IncCheck()
call TransmissionFromUnitWithNameBJ( bj_FORCE_ALL_PLAYERS, talker, name, null, message, bj_TIMETYPE_ADD, 9999., false )
endfunction
function TransmissionExplicit takes unit talker, string name, string message, real time returns nothing
call IncCheck()
call TransmissionFromUnitWithNameBJ( bj_FORCE_ALL_PLAYERS, talker, name, null, message, bj_TIMETYPE_ADD, 9999., false )
call ConditionalInterrupt(time)
endfunction
function Transmission takes unit talker, string name, string message returns nothing
call IncCheck()
call TransmissionFromUnitWithNameBJ( bj_FORCE_ALL_PLAYERS, talker, name, null, message, bj_TIMETYPE_ADD, 9999., false )
call ConditionalInterrupt(GetAutoTime(message))
endfunction
function TransmissionSound takes unit talker, string name, string message, string snd returns nothing
local timer t
call SetupVoice(snd)
call TransmissionFromUnitWithNameBJ( bj_FORCE_ALL_PLAYERS, talker, name, null, message, bj_TIMETYPE_ADD, 9999., false )
if END_AFTER_VOICE then
set t = CreateTimer()
set soundTimer = t
set soundTimerString = snd
call TimerStart(t, I2R(GetSoundDuration(currentSound)) * 0.003 + 0.25, false, function SoundOver) // Why this is so, I have no idea. It just works.
endif
endfunction
function TransmissionAndBuffer takes unit talker, string name, string message returns nothing
call TransmissionFromUnitWithNameBJ( bj_FORCE_ALL_PLAYERS, talker, name, null, message, bj_TIMETYPE_ADD, 9999., false )
set bufferUnit = talker
set bufferName = name
set bufferMessage = message
set bufferTime = 0.
endfunction
function TransmissionSoundAndBuffer takes unit talker, string name, string message, string snd returns nothing
call SetupVoice(snd)
call TransmissionFromUnitWithNameBJ( bj_FORCE_ALL_PLAYERS, talker, name, null, message, bj_TIMETYPE_ADD, 9999., false )
set bufferUnit = talker
set bufferName = name
set bufferMessage = message
set bufferSound = snd
endfunction
function TransmissionTimed takes unit talker, string name, string message, real time returns nothing
call IncCheck()
call TransmissionFromUnitWithNameBJ( bj_FORCE_ALL_PLAYERS, talker, name, null, message, bj_TIMETYPE_ADD, time-5., false )
endfunction
function TransmissionBufferDisplay takes nothing returns nothing
call TransmissionFromUnitWithNameBJ( bj_FORCE_ALL_PLAYERS, bufferUnit, bufferName, null, bufferMessage, bj_TIMETYPE_ADD, 9999., false )
endfunction
function TransmissionBuffer takes unit talker, string name, string message returns nothing
set bufferUnit = talker
set bufferName = name
set bufferMessage = message
set bufferTime = GetAutoTime(message)
endfunction
function TransmissionSoundBuffer takes unit talker, string name, string message, string snd returns nothing
set bufferUnit = talker
set bufferName = name
set bufferMessage = message
set bufferSound = snd
endfunction
function TransmissionClearBuffer takes nothing returns nothing
set bufferUnit = null
set bufferName = null
set bufferMessage = null
set bufferSound = null
endfunction
function ClearTransmission takes nothing returns nothing
call ShowInterface(true, 0.)
call ShowInterface(false, 0.)
endfunction
// This waits for escape, and does nothing else
function WaitEscape takes nothing returns nothing
set EscapeInterrupt = false
loop
exitwhen EscapeInterrupt == true
call TriggerSleepAction(0.)
endloop
set EscapeInterrupt = false
endfunction
// This waits for escape, and then displays the buffer, used to stop someone skipping it.
function WaitBuffer takes nothing returns nothing
set EscapeInterrupt = false
loop
exitwhen EscapeInterrupt == true
call TriggerSleepAction(0.)
endloop
call TransmissionBufferDisplay()
set EscapeInterrupt = false
endfunction
// This clears the buffer, and then waits for escape. Used at the end of a transmission sequence.
function WaitConclude takes nothing returns nothing
set EscapeInterrupt = false
call TransmissionClearBuffer()
loop
exitwhen EscapeInterrupt == true
call TriggerSleepAction(0.)
endloop
set EscapeInterrupt = false
endfunction
private function InterruptionEx takes nothing returns nothing
if bufferSound != null and bufferSound != currentSoundString then
call TransmissionSound(bufferUnit, bufferName, bufferMessage, bufferSound)
set bufferSound = null
else
if bufferTime == 0. then
call TransmissionBasic(bufferUnit, bufferName, bufferMessage)
else
call TransmissionExplicit(bufferUnit, bufferName, bufferMessage, bufferTime)
endif
endif
set EscapeInterrupt = true
call DestroyTimer(GetExpiredTimer())
endfunction
private function Init takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterPlayerEventEndCinematic( t, GetLocalPlayer() )
call TriggerAddAction( t, function Interruption )
set interEx = function InterruptionEx
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library MusicSystem requires CSSafety
globals
private string current = null
private timer t
string FIGHT_MUSIC = "3circles.mp3"
string NORMAL_MUSIC = "Medieval.mp3"
private real fightTime = 0.
private real normalTime = 0.
endglobals
function SetMusicRestart takes string s returns nothing
if s == FIGHT_MUSIC then
set fightTime = ModuloReal(fightTime + TimerGetElapsed(t), 620.)
elseif s == NORMAL_MUSIC then
set normalTime = ModuloReal(normalTime + TimerGetElapsed(t), 245.)
endif
endfunction
function GetMusicRestart takes string s returns real
if s == FIGHT_MUSIC then
return fightTime
elseif s == NORMAL_MUSIC then
return normalTime
else
return 0.
endif
endfunction
function StartMusicEx takes nothing returns nothing
call StopMusic(false)
if current != null then
call PlayMusic(current)
call SetMusicPlayPosition( R2I( GetMusicRestart(current)*1000 ) )
call TimerStart(t, 99999., false, null)
endif
call ReleaseTimer(GetExpiredTimer())
endfunction
function StartMusic takes string s returns nothing
call ClearMapMusic()
if s != null then
call SetMapMusic(s, false, 0)
endif
if current != null then
call StopMusic(true)
call SetMusicRestart(current)
if s != null then
call TimerStart(NewTimer(), 2., false, function StartMusicEx)
endif
else
call StopMusic(false)
if s != null then
call PlayMusic(s)
call SetMusicPlayPosition( R2I( GetMusicRestart(s)*1000 ) )
call TimerStart(t, 99999., false, null)
endif
endif
set current = s
endfunction
function Setup_Music takes nothing returns nothing
set t = NewTimer()
endfunction
endlibrary
//===========================================================================
function InitTrig_Music_System takes nothing returns nothing
set gg_trg_Music_System = CreateTrigger( )
call TriggerAddAction( gg_trg_Music_System, function Setup_Music )
endfunction
//TESH.scrollpos=55
//TESH.alwaysfold=0
library Random
globals
boolean NOT_AUTO_ATTACK = false
endglobals
function UnitFaceUnit takes unit u1, unit u2 returns nothing
call SetUnitFacingToFaceUnitTimed(u1, u2, 0.)
endfunction
function ApplyCamera takes camerasetup c, real t returns nothing
call CameraSetupApplyForceDuration(c, true, t)
endfunction
globals
real CINE_CAM_TIME = 0.5
endglobals
function ApplyCameraWait takes camerasetup c, real t returns nothing
call CameraSetupApplyForceDuration(c, true, t)
call PolledWait(t)
endfunction
function CameraApply takes camerasetup c, real t returns nothing
call CameraSetupApplyForPlayer( true, c, Player(0), t )
endfunction
function FadeOut takes real t returns nothing
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, t, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0, 0, 0, 0 )
endfunction
function FadeIn takes real t returns nothing
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, t, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0, 0, 0, 0 )
endfunction
function FadeAdvOut takes real r, real g, real b, real a, real t returns nothing
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, t, "ReplaceableTextures\\CameraMasks\\White_mask.blp", r*100., g*100, b*100, a*100)
endfunction
function FadeAdvIn takes real r, real g, real b, real a, real t returns nothing
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, t, "ReplaceableTextures\\CameraMasks\\White_mask.blp", r*100., g*100, b*100, a*100)
endfunction
function Fade takes real r1, real g1, real b1, real a1, real r2, real g2, real b2, real a2, real t returns nothing
call CinematicFilterGenericBJ(t, BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\White_mask.blp", r1*100., g1*100, b1*100, a1*100, r2*100., g2*100, b2*100, a2*100)
endfunction
function ResetCamera takes real t returns nothing
call ResetToGameCamera(t)
endfunction
function LockCamera takes unit u returns nothing
call SetCameraTargetController( u, 0, 0, false )
endfunction
function CameraOutside takes nothing returns nothing
call ResetToGameCameraForPlayer( Player(0), 1.00 )
call SetCameraTargetControllerNoZForPlayer( Player(0), udg_PlayerUnit, 0, 0, false )
call SetCameraFieldForPlayer( Player(0), CAMERA_FIELD_TARGET_DISTANCE, distanceToTargetOutside, 1.00 )
endfunction
function UnitFirstItemOfType takes unit u, integer id returns item
local integer i = 0
loop
if GetItemTypeId(UnitItemInSlot(u, i)) == id then
return UnitItemInSlot(u, i)
endif
set i = i + 1
exitwhen i >= bj_MAX_INVENTORY
endloop
return null
endfunction
function CreateFlower takes nothing returns item
set prettyFlower = CreateItem('I000', 960., 445.)
return prettyFlower
endfunction
function CreateFlowerXY takes real x, real y returns item
call SetItemPosition(CreateFlower(), x, y)
return prettyFlower
endfunction
endlibrary
library Randomisation
function Ran takes real r returns boolean
return GetRandomReal(0., 1.) <= r
endfunction
endlibrary
//TESH.scrollpos=153
//TESH.alwaysfold=0
library Checkpoint requires Random, TransmissionFuncs, Difficulty
globals
private string array idString
private string array name
private integer array number
private integer checkNumber = 0
endglobals
private function GetNumber takes nothing returns integer
set checkNumber = checkNumber + 1 //check number should be the max number of things, done by number
return checkNumber
endfunction
// if numbers not continuous, will break the start up menu (and others if added); however, those are the only things which use the number, so just rejig them
function InitCheckpointIDs takes nothing returns nothing // these should be placed in chronological order for the purpose of my sanity
set idString[4] = "beforeAbom1"
set name[4] = "FLESH BEAST!"
set number[4] = GetNumber()
set idString[1] = "afterAbom1"
set name[1] = "From the Portal"
set number[1] = GetNumber()
set idString[2] = "afterSleep1"
set name[2] = "Bad Night's Sleep"
set number[2] = GetNumber()
set idString[3] = "beforeFight1"
set name[3] = "They Come..."
set number[3] = GetNumber()
set idString[5] = "afterFight1"
set name[5] = "Teleported Nowhere?"
set number[5] = GetNumber()
set idString[6] = "nextMorning1"
set name[6] = "New Dawn"
set number[6] = GetNumber()
//set idString[5] = "afterAbom1"
//set idString[6] = "afterAbom1"
//set idString[7] = "afterAbom1"
endfunction
function CheckpointString2ID takes string s returns integer
local integer i = 0
loop
exitwhen s == idString[i]
set i = i + 1
endloop
return i
endfunction
function CheckpointNumber2ID takes integer n returns integer
local integer i = 0
if n > checkNumber then
return 0
endif
loop
exitwhen n == number[i]
set i = i + 1
endloop
return i
endfunction
function CheckpointString2Name takes string s returns string
local integer i = 0
loop
exitwhen s == idString[i]
set i = i + 1
endloop
return name[i]
endfunction
function CheckpointName2String takes string s returns string
local integer i = 0
loop
exitwhen s == name[i]
set i = i + 1
endloop
return idString[i]
endfunction
function CheckpointID2Name takes integer i returns string
return name[i]
endfunction
function CheckpointID2Number takes integer i returns integer
return number[i]
endfunction
function CheckpointID2String takes integer i returns string
return MapPrefix + ":" + idString[i]
endfunction
function SaveTriggers takes string s returns nothing
local integer i = 1
loop
exitwhen i > trigMax
if trigAry[i] != null then
call StoreBoolean(udg_gc, s, "trigger" + I2S(i), IsTriggerEnabled(trigAry[i]))
endif
set i = i + 1
endloop
endfunction
function LoadTriggers takes string s returns nothing
local integer i = 1
loop
exitwhen i > trigMax
if trigAry[i] != null then
if GetStoredBoolean(udg_gc, s, "trigger" + I2S(i)) then
call EnableTrigger(trigAry[i])
else
call DisableTrigger(trigAry[i])
endif
endif
set i = i + 1
endloop
endfunction
globals
constant integer SAVE = 1
constant integer LOAD = 2
endglobals
function GetLastCheckpoint takes nothing returns string
return GetStoredString(udg_gc, MapPrefix + ":latest", "string")
endfunction
//! textmacro sl takes TYPE, VARIABLE
if saving then
call Store$TYPE$(udg_gc, s, "$VARIABLE$", $VARIABLE$)
else
set $VARIABLE$ = GetStored$TYPE$(udg_gc, s, "$VARIABLE$")
endif
//! endtextmacro
function SaveHero takes string s returns nothing
local integer i = 0
call StoreUnit(udg_gc, s, "unit", pc.u)
call StoreReal(udg_gc, s, "unitHealth", GetWidgetLife(pc.u))
call StoreBoolean(udg_gc, s, "hasTalkAbility", GetUnitAbilityLevel(pc.u, 'A001') > 0)
call StoreBoolean(udg_gc, s, "hasInvAbility", GetUnitAbilityLevel(pc.u, 'AInv') > 0)
loop
call StoreInteger(udg_gc, s, "inventory" + I2S(i) + "type", GetItemTypeId(UnitItemInSlot(pc.u, i)))
call StoreInteger(udg_gc, s, "inventory" + I2S(i) + "charge", GetItemCharges(UnitItemInSlot(pc.u, i)))
set i = i + 1
exitwhen i>=6
endloop
endfunction
function LoadHero takes string s returns nothing
local integer i = 0
local item it = null
if pc.u != null then
call RemoveUnit(pc.u)
endif
call RestorePlayerUnit(RestoreUnit(udg_gc, s, "unit", Player(0), 0., 0., 0.))
if HaveStoredReal(udg_gc, s, "unitHealth") then
call SetWidgetLife(udg_PlayerUnit, GetStoredReal(udg_gc, s, "unitHealth"))
endif
if GetStoredBoolean(udg_gc, s, "hasTalkAbility") then
call UnitAddAbility(udg_PlayerUnit, 'A001')
endif
if GetStoredBoolean(udg_gc, s, "hasInvAbility") then
call UnitAddAbility(udg_PlayerUnit, 'AInv')
endif
loop
set it = UnitAddItemById(pc.u, GetStoredInteger(udg_gc, s, "inventory" + I2S(i) + "type"))
call SetItemCharges(it, GetStoredInteger(udg_gc, s, "inventory" + I2S(i) + "charge"))
set i = i + 1
exitwhen i>=6
endloop
set it = null
endfunction
function Checkpoint takes integer sl, string s returns nothing
local string sName = s
local boolean saving = false
set s = MapPrefix + ":" + s
if sl == 1 then
set saving = true
endif
if saving then
if GetDifficulty() == 4 then
return
endif
call StoreReal(udg_gc, s, "mapVersion", MapVersion)
call StoreInteger(udg_gc, s, "difficulty", GetDifficulty())
call SaveHero(s)
if sName != END_LEVEL_STRING then
call StoreString(udg_gc, MapPrefix + ":latest", "string", sName)
endif
call StoreBoolean(udg_gc, s, "flowerCreate", GetWidgetLife(prettyFlower) > 0.405 and not(UnitHasItem(pc.u, prettyFlower)))
call StoreReal(udg_gc, s, "flowerX", GetItemX(prettyFlower))
call StoreReal(udg_gc, s, "flowerY", GetItemY(prettyFlower))
call SaveTriggers(s)
call ornia.save(s)
call treyvn.save(s)
else
if pc.u != null then
call RemoveUnit(udg_PlayerUnit)
endif
call SetDifficulty(GetStoredInteger(udg_gc, s, "difficulty")) // THIS MUST COME BEFORE UNIT CREATED.
call LoadHero(s)
set prettyFlower = UnitFirstItemOfType(pc.u, 'I000')
if prettyFlower == null then
if not(HaveStoredBoolean(udg_gc, s, "flowerCreate")) then
call CreateFlower()
elseif GetStoredBoolean(udg_gc, s, "flowerCreate") then
call CreateFlowerXY(GetStoredReal(udg_gc, s, "flowerX"), GetStoredReal(udg_gc, s, "flowerY"))
endif
endif
call LoadTriggers(s)
call ornia.load(s)
call treyvn.load(s)
endif
//! runtextmacro sl("Integer", "spokeToDaughter")
//! runtextmacro sl("Integer", "spokeToFather")
//! runtextmacro sl("Integer", "soldierType")
//! runtextmacro sl("Boolean", "daughterDone")
//! runtextmacro sl("Integer", "gameStage")
//! runtextmacro sl("Boolean", "DaughterOrnia_tempBlock")
//! runtextmacro sl("Boolean", "DaughterOrnia_tempBlocked")
endfunction
// Add to here all relevent data
function SaveCheckpoint takes string s returns nothing
call Checkpoint(SAVE, s)
call SaveGameCache(udg_gc)
endfunction
function SaveCheckpointByID takes integer id returns nothing
call SaveCheckpoint(idString[id])
endfunction
function LoadCheckpoint takes string s returns nothing
call Checkpoint(LOAD, s)
call ExecuteFunc(s)
call DisplayText( "|c00aaaaffDifficulty: " + GetDifficultyName( GetDifficulty() ))
endfunction
function LoadCheckpointByID takes integer id returns nothing
call LoadCheckpoint(idString[id])
endfunction
function CheckpointMessage takes integer id returns nothing
if GetDifficulty() < 4 then
call DisplayText( "|c00aaaaffCheckpoint: " + CheckpointID2Name(id))
call PlaySoundBJ( gg_snd_Hint )
endif
endfunction
globals
trigger array trigAry
integer trigMax = 1
boolean array trigAryStart
endglobals
function AddTrigger takes integer n returns trigger
local trigger t = CreateTrigger()
if trigAry[n] != null then
call BJDebugMsg("Oh crap, we have triggers colliding in the AddTrigger function. Report to Captain Griffen please.")
endif
set trigAry[n] = t
if trigMax < n then
set trigMax = n
endif
return t
endfunction
function SaveTriggerStartStates takes nothing returns nothing
local integer i = 1
loop
exitwhen i > trigMax
if trigAry[i] != null then
set trigAryStart[i] = IsTriggerEnabled(trigAry[i])
endif
set i = i + 1
endloop
endfunction
function LoadTriggerStartStates takes nothing returns nothing
local integer i = 1
loop
exitwhen i > trigMax
if trigAry[i] != null then
if trigAryStart[i] then
call EnableTrigger(trigAry[i])
else
call DisableTrigger(trigAry[i])
endif
endif
set i = i + 1
endloop
endfunction
endlibrary
function Trig_Checkpoint_System_Actions takes nothing returns nothing
set udg_gc = InitGameCache("CGMiniRPG.w3v")
endfunction
//===========================================================================
function InitTrig_Checkpoint_System takes nothing returns nothing
set gg_trg_Checkpoint_System = CreateTrigger( )
call InitCheckpointIDs()
call TriggerAddAction( gg_trg_Checkpoint_System, function Trig_Checkpoint_System_Actions )
call TimerStart(NewTimer(), 0.01, false, function SaveTriggerStartStates)
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function beforeAbom1 takes nothing returns nothing // id = 4
local unit u = CreateUnit(Player(11), 'uabo', 0., -1050., 90.)
call SetUnitPosition(udg_PlayerUnit, 0., -600.)
call SetUnitFacing(udg_PlayerUnit, 270.)
call IssueImmediateOrder(udg_PlayerUnit, "holdposition")
call SetUnitTimeScale(u, 0.5)
call IssueTargetOrder(u, "attack", udg_PlayerUnit)
set u = null
call CameraOutside()
call EnableTrigger(gg_trg_Kill_Abomination)
call FadeIn(0.5)
call StartMusic(FIGHT_MUSIC)
call DisplayText( "|c00aaaaffHint:|r Use the block ability |c00ffaaaa(B)|r as he swings to block the attack." )
call PlaySoundBJ( gg_snd_Hint )
endfunction
function afterAbom1 takes nothing returns nothing // id = 1
local unit u = CreateUnit(Player(11), 'uabo', 0., -700., 90.)
call SetUnitPosition(udg_PlayerUnit, 0., -600.)
call SetUnitFacing(udg_PlayerUnit, 270.)
call SetUnitTimeScale(u, 0.5)
call KillUnit(u)
call CameraOutside()
call FadeIn(0.5)
set udg_Loading = true
call TriggerExecute(gg_trg_Kill_Abomination)
endfunction
function afterSleep1 takes nothing returns nothing // id = 2
call CinematicModeOn()
call TriggerExecute(gg_trg_Wake_Up)
endfunction
function beforeFight1 takes nothing returns nothing // id = 3
call SetUnitPosition(udg_PlayerUnit, 25., 75.)
call DisableTrigger(gg_trg_Camera)
call CinematicModeOn()
set udg_Loading = true
call CameraOutside()
call PolledWait(1.)
call FadeIn(0.5)
call TriggerExecute(gg_trg_Leave)
endfunction
function afterFight1 takes nothing returns nothing // id = 5
call SetUnitPosition(udg_PlayerUnit, 25., -45.)
call SetUnitFacing(udg_PlayerUnit, 270.)
call DisableTrigger(gg_trg_Camera)
call CinematicModeOn()
call CameraOutside()
call FadeIn(0.5)
set udg_Loading = true
call TriggerExecute(gg_trg_After_Teleport)
endfunction
function nextMorning1 takes nothing returns nothing // id = 6
call StartMusic(NORMAL_MUSIC)
call CinematicModeOn()
call TriggerExecute(gg_trg_Next_Morning)
endfunction
//===========================================================================
function InitTrig_Checkpoint_Specifics takes nothing returns nothing
endfunction
//TESH.scrollpos=88
//TESH.alwaysfold=0
library Difficulty initializer Init
globals
private string array name
private integer current = 0
private integer DEFAULT = 2
private integer MAX = 4
endglobals
private function Ability takes integer id returns nothing
call UnitAddAbility(udg_PlayerUnit, id)
endfunction
private function NoAbility takes integer id returns nothing
call UnitRemoveAbility(udg_PlayerUnit, id)
endfunction
private function ModifyDamage takes integer i returns nothing
local boolean add = GetUnitAbilityLevel(udg_PlayerUnit, 'AInv') == 0
if add then
call Ability('AInv')
endif
//set i = i/5 // This method'll have to change if you have more inventory stuff
if i > 4 then // you're adding damamge
call UnitAddItemById(udg_PlayerUnit, 'I001')
if i > 9 then
call UnitAddItemById(udg_PlayerUnit, 'I001')
if i > 14 then
call UnitAddItemById(udg_PlayerUnit, 'I001')
endif
endif
elseif i < -4 then // you're taking away damamge
call UnitAddItemById(udg_PlayerUnit, 'I002')
if i < -9 then
call UnitAddItemById(udg_PlayerUnit, 'I002')
if i < -14 then
call UnitAddItemById(udg_PlayerUnit, 'I002')
endif
endif
endif
if add then
call NoAbility('AInv')
endif
endfunction
function ResetPlayerUnitDifficulty takes nothing returns nothing
if current == 1 then
call ModifyDamage(-10)
elseif current == 3 then
call ModifyDamage(5)
elseif current == 4 then
call ModifyDamage(10)
endif
//call NoAbility('A002')
call NoAbility('A005')
call NoAbility('A008')
call NoAbility('A006')
//call NoAbility('A003')
call NoAbility('A007')
//call NoAbility('A004')
call NoAbility('A009')
endfunction
function ApplyPlayerUnitDifficulty takes nothing returns nothing
if current == 1 then
//call Ability('A002')
call Ability('A005')
call Ability('A008')
call ModifyDamage(10)
elseif current == 2 then
call Ability('A006')
elseif current == 3 then
//call Ability('A003')
call Ability('A007')
call ModifyDamage(-5)
elseif current == 4 then
//call Ability('A004')
call Ability('A009')
call ModifyDamage(-10)
endif
endfunction
function GetDifficultyName takes integer i returns string
return name[i]
endfunction
function GetDifficulty takes nothing returns integer
if current == 0 then
return DEFAULT
endif
return current
endfunction
function SetDifficulty takes integer i returns nothing
if GetWidgetLife(udg_PlayerUnit) > 0.405 then
call ResetPlayerUnitDifficulty()
endif
if i > MAX then
set current = MAX
elseif i < 1 then
set current = DEFAULT
else
set current = i
endif
if GetWidgetLife(udg_PlayerUnit) > 0.405 then
call ApplyPlayerUnitDifficulty()
endif
// do any global effects
endfunction
private function Init takes nothing returns nothing
set name[0] = null
set name[1] = "Easy"
set name[2] = "Normal"
set name[3] = "Hard"
set name[4] = "Impossible"
endfunction
endlibrary
//TESH.scrollpos=25
//TESH.alwaysfold=0
scope Arrows
globals
private real direction = 0.
real distanceToTargetOutside = 1050.
endglobals
function Up_Arrow_On takes nothing returns nothing
set direction = -1.
endfunction
function Up_Arrow_Off takes nothing returns nothing
if direction == -1. then
set direction = 0.
endif
endfunction
function Down_Arrow_On takes nothing returns nothing
set direction = 1.
endfunction
function Down_Arrow_Off takes nothing returns nothing
if direction == 1. then
set direction = 0.
endif
endfunction
private function Update takes nothing returns nothing
if direction != 0. then
if InCinematic then
set direction = 0.
else
set distanceToTargetOutside = RMinBJ(RMaxBJ(distanceToTargetOutside + direction * 50. , 500.), 2500.)
if not(RectContainsUnit(gg_rct_House, udg_PlayerUnit)) and IsTriggerEnabled(gg_trg_Camera) then
call SetCameraFieldForPlayer( Player(0), CAMERA_FIELD_TARGET_DISTANCE, distanceToTargetOutside, 1.00 )
endif
endif
endif
endfunction
//===========================================================================
function InitTrig_Arrow_Camera_Controls takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterPlayerKeyEventBJ(t, Player(0), bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_UP )
call TriggerAddAction(t, function Up_Arrow_On )
set t = CreateTrigger( )
call TriggerRegisterPlayerKeyEventBJ(t, Player(0), bj_KEYEVENTTYPE_RELEASE, bj_KEYEVENTKEY_UP )
call TriggerAddAction(t, function Up_Arrow_Off )
set t = CreateTrigger( )
call TriggerRegisterPlayerKeyEventBJ(t, Player(0), bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_DOWN )
call TriggerAddAction(t, function Down_Arrow_On )
set t = CreateTrigger( )
call TriggerRegisterPlayerKeyEventBJ(t, Player(0), bj_KEYEVENTTYPE_RELEASE, bj_KEYEVENTKEY_DOWN )
call TriggerAddAction(t, function Down_Arrow_Off )
set t = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic(t, 0.1)
call TriggerAddAction(t, function Update )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
//! textmacro charvalue takes NAME, TYPE
$TYPE$ count$NAME$ = 0
method mod$NAME$ takes $TYPE$ value returns nothing
set .count$NAME$ = .count$NAME$ + value
endmethod
method set$NAME$ takes $TYPE$ value returns nothing
set .count$NAME$ = value
endmethod
method get$NAME$ takes nothing returns $TYPE$
return .count$NAME$
endmethod
//! endtextmacro
struct character
string indexName
string knownName
string defaultName
unit u
//! runtextmacro charvalue ( "Respect", "real" )
//! runtextmacro charvalue ( "Like", "real" )
//! runtextmacro charvalue ( "Love", "real" )
//! runtextmacro charvalue ( "Anger", "real" )
//! runtextmacro charvalue ( "Trust", "real" )
boolean hasMet = false
boolean hasName = false
integer array convoState[100] // max number of convo states.
integer romanceState = 0
method getMood takes nothing returns real
return .getLike() - .getAnger() + 0.5*.getRespect() + 0.75*.getLove() + 0.25*.getTrust()
endmethod
method name takes nothing returns string
if .hasName then
return .knownName
else
return .defaultName
endif
endmethod
method talkToBonus takes nothing returns nothing // once per bit of the story line only, for non-essential talking to
if this == ornia then
call this.modLike(0.5)
call this.modLove(0.15)
endif
endmethod
method save takes string s returns nothing
local integer i = 0
call StoreReal(udg_gc, s, .indexName + ":respect", .countRespect)
call StoreReal(udg_gc, s, .indexName + ":like", .countLike)
call StoreReal(udg_gc, s, .indexName + ":love", .countLove)
call StoreReal(udg_gc, s, .indexName + ":trust", .countTrust)
call StoreReal(udg_gc, s, .indexName + ":anger", .countAnger)
call StoreBoolean(udg_gc, s, .indexName + ":hasMet", .hasMet)
call StoreBoolean(udg_gc, s, .indexName + ":hasName", .hasName)
loop
exitwhen i >= 100
call StoreInteger(udg_gc, s, .indexName + ":convoState"+I2S(i), .convoState[i])
set i = i + 1
endloop
call StoreInteger(udg_gc, s, .indexName + ":romanceState", .romanceState)
endmethod
method load takes string s returns nothing
local integer i = 0
set .countRespect = GetStoredReal(udg_gc, s, .indexName + ":respect")
set .countLike = GetStoredReal(udg_gc, s, .indexName + ":like")
set .countLove = GetStoredReal(udg_gc, s, .indexName + ":love")
set .countTrust = GetStoredReal(udg_gc, s, .indexName + ":trust")
set .countAnger = GetStoredReal(udg_gc, s, .indexName + ":anger")
set .hasMet = GetStoredBoolean(udg_gc, s, .indexName + ":hasMet")
set .hasName = GetStoredBoolean(udg_gc, s, .indexName + ":hasName")
loop
exitwhen i >= 100
set .convoState[i] = GetStoredInteger(udg_gc, s, .indexName + ":convoState"+I2S(i))
set i = i + 1
endloop
set .romanceState = GetStoredInteger(udg_gc, s, .indexName + ":romanceState")
endmethod
static method Create takes string s, string def, unit u, string index returns character
local character c = character.create()
set c.knownName = s
set c.defaultName = def
set c.indexName = index
set c.u = u
return c
endmethod
endstruct
globals
character ornia
character treyvn
endglobals
library Characters initializer Init
private function Init takes nothing returns nothing
set ornia = character.Create("Ornia", "Young Woman", gg_unit_n001_0002, "ornia") // don't change the index. EVER
set treyvn = character.Create("Treyvn", "Old Man", gg_unit_n000_0003, "treyvn")
endfunction
function talkToDaughterCond takes nothing returns boolean
return GetSpellAbilityId() == 'A001' and GetSpellTargetUnit() == ornia.u
endfunction
function talkToFatherCond takes nothing returns boolean
return GetSpellAbilityId() == 'A001' and GetSpellTargetUnit() == treyvn.u
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library PlayerCharacter
globals
character pc = 0
integer soldierType = 0
constant integer MILITIA = 1
constant integer SOLDIER = 2
constant integer MERC = 3
integer gameStage = 0
endglobals
private function generic takes unit u returns unit
if pc != null then
call pc.destroy()
endif
set pc = character.Create("Nazar", "Nazar", u, "pc")
set pc.hasMet = true
set udg_PlayerUnit = pc.u
if NOT_AUTO_ATTACK then
call UnitAddType(udg_PlayerUnit, UNIT_TYPE_PEON)
endif
call ApplyPlayerUnitDifficulty()
call SelectUnit(udg_PlayerUnit, true)
return pc.u
endfunction
function CreatePlayerUnit takes real x, real y, real facing returns unit
return generic(CreateUnit(Player(0), 'hfoo', x, y, facing))
endfunction
function RestorePlayerUnit takes unit u returns unit
return generic(u)
endfunction
endlibrary
//TESH.scrollpos=23
//TESH.alwaysfold=0
function CreateWall takes real x1, real y1, real x2, real y2 returns nothing
local integer id = 'h000'
local real di = 18.
local real x = x1-(di/2)
local real y = y1-(di/2)
local real ang = Atan2(y2-y1,x2-x1)
local real dx = di*Cos(ang)
local real dy = di*Sin(ang)
local integer n
local integer i = 0
if dx > 0.01 then
set n = R2I((x2-x1)/dx)
else
set n = R2I((y2-y1)/dy)
endif
loop
set x = x+dx
set y = y+dy
//call BJDebugMsg("Rawr 1 " + R2S(x) + "_" + R2S(y))
exitwhen i > n
//call BJDebugMsg("Rawr 2")
call CreateUnit(Player(15), id, x, y, 0.)
set i = i + 1
endloop
endfunction
function Trig_Create_Walls_Actions takes nothing returns nothing
call CreateWall(-305., 755., 360., 755.) //top wall
call CreateWall(-305., 755., -305., 80.) //left wall
call CreateWall(360., 755., 360., 80.) //right wall
call CreateWall(-305., 80., -60., 80.) //bottom left wall
call CreateWall(115., 80., 360., 80.) //bottom right wall
// master bedroom
call CreateWall(-305., 435., -160., 435.) //bottom left wall
call CreateWall(-65., 435., 57.5, 435.) //bottom right wall
call CreateWall(57.5, 755., 57.5, 435.) //right wall
//small bedroom
call CreateWall(175., 495., 360., 495.) //bottom wall
endfunction
//===========================================================================
function InitTrig_Create_Walls takes nothing returns nothing
set gg_trg_Create_Walls = CreateTrigger( )
call TriggerAddAction( gg_trg_Create_Walls, function Trig_Create_Walls_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope TalkToSelf
function Trig_Talk_to_Self_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A001' and GetSpellTargetUnit() == udg_PlayerUnit
endfunction
globals
private string array comment
private integer array time
private integer MAX = 0
endglobals
function Trig_Talk_to_Self_Actions takes nothing returns nothing
local integer i
loop
set i = GetRandomInt(1, MAX)
exitwhen time[i] == 0
endloop
call DisplayText("|cffaaaaff" + pc.name() + "|r: " + comment[i])
set time[i] = 7
set i = 1
loop
if time[i] > 0 then
set time[i] = time[i] - 1
endif
set i = i + 1
exitwhen i > MAX
endloop
endfunction
private function Comment takes string s returns nothing
set MAX = MAX + 1
set comment[MAX] = s
endfunction
//===========================================================================
function InitTrig_Talk_to_Self takes nothing returns nothing
local integer i = 1
set gg_trg_Talk_to_Self = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Talk_to_Self, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Talk_to_Self, Condition( function Trig_Talk_to_Self_Conditions ) )
call TriggerAddAction( gg_trg_Talk_to_Self, function Trig_Talk_to_Self_Actions )
call Comment("Yup, that's me - Bladesman of Coralna.")
call Comment("Oh dear, am I talking to myself again?")
call Comment("Maybe I should consider getting a psychotherapis...")
call Comment("Yes, I know I'm dreadfully attractive, but maybe I should stop hitting on myself?")
call Comment("Let's just get on, shall we? Please...?")
call Comment("Don't I have anything better to do?")
call Comment("They know I like orange!")
call Comment("Being a soldier isn't just following orders, it's following those orders in the service of a higher cause.")
call Comment("I AM the people.")
call Comment("I must attack. I must attack.")
call Comment("The more power you think you have, the more quickly it slips from your hands.")
loop
set time[i] = 0
set i = i + 1
exitwhen i > MAX
endloop
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Player_Dies_Conditions takes nothing returns boolean
return GetTriggerUnit() == udg_PlayerUnit
endfunction
library Cleaning requires Random
function RemoveUnitEx takes nothing returns nothing
local integer id = GetUnitTypeId(GetEnumUnit())
if id != 'h000' then
call RemoveUnit(GetEnumUnit())
endif
endfunction
function CleanUp takes nothing returns nothing
local group g = CreateGroup()
call FadeOut(1.)
call PolledWait(1.)
call GroupEnumUnitsInRect(g, GetPlayableMapRect(), null)
call GroupRemoveUnit(g, treyvn.u)
call GroupRemoveUnit(g, ornia.u)
call ForGroup(g, function RemoveUnitEx)
call RemoveItem(prettyFlower)
call PolledWait(1.5)
endfunction
endlibrary
function Trig_Player_Dies_Actions takes nothing returns nothing
call DisplayText("You have died.")
call StartMusic(null)
call CleanUp()
call DisplayMainMenu(false)
endfunction
//===========================================================================
function InitTrig_Player_Dies takes nothing returns nothing
set gg_trg_Player_Dies = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Player_Dies, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Player_Dies, Condition( function Trig_Player_Dies_Conditions ) )
call TriggerAddAction( gg_trg_Player_Dies, function Trig_Player_Dies_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Camera_Actions takes nothing returns nothing
if not(InCinematic) then
if RectContainsUnit(gg_rct_Master_Bedroom, udg_PlayerUnit) then
call CameraSetupApplyForPlayer( true, gg_cam_Master_Bedroom_Camera, Player(0), 1.00 )
else
if RectContainsUnit(gg_rct_Small_Bedroom, udg_PlayerUnit) then
call CameraSetupApplyForPlayer( true, gg_cam_Small_Bedroom_Camera, Player(0), 1.00 )
else
if RectContainsUnit(gg_rct_House, udg_PlayerUnit) then
call CameraSetupApplyForPlayer( true, gg_cam_House_Camera, Player(0), 1.00 )
else
call CameraOutside()
endif
endif
endif
endif
endfunction
//===========================================================================
function InitTrig_Camera takes nothing returns nothing
set gg_trg_Camera = AddTrigger(5)
call DisableTrigger( gg_trg_Camera )
call TriggerRegisterTimerEventPeriodic( gg_trg_Camera, 0.50 )
call TriggerAddAction( gg_trg_Camera, function Trig_Camera_Actions )
endfunction
//TESH.scrollpos=63
//TESH.alwaysfold=0
library Starting requires Checkpoint, Cleaning
globals
dialog Menu_Main
dialog Menu_Load
boolean needClean = false
string Menu_Main_String = "What to do?"
string Menu_Load_String = "What to load?"
string Menu_Speed_String = "What dialog speed?"
endglobals
globals
private dialog d = null
private button new = null
private button continue = null
private button load = null
private button options = null
private button cancel = null
private dialog d2 = null
private button array point
private button cancelLoad = null
private dialog dNew = null
private button array newDifficulty
private dialog op = null
private button opEasy = null
private button opNormal = null
private button opHard = null
private button opAcquire = null
private button opSpeed = null
private dialog dSpeed = null
private button array speed
private integer speedMax = 5
private integer speedOffset = -2
private string array speedName // VSlow, Slow, Medium, Fast, VFast
endglobals
private function NewGame takes nothing returns nothing
if needClean then
call CleanUp()
endif
call DisableTrigger(gg_trg_Camera)
call LoadTriggerStartStates()
call TriggerExecute(gg_trg_Opening_Cinematic)
endfunction
function ButtonPressedNew takes nothing returns nothing
local button b = GetClickedButton()
if b == newDifficulty[1] then
call SetDifficulty(1)
call NewGame()
elseif b == newDifficulty[2] then
call SetDifficulty(3)
call NewGame()
elseif b == newDifficulty[3] then
call SetDifficulty(3)
call NewGame()
elseif b == newDifficulty[4] then
call SetDifficulty(4)
call NewGame()
else
call DialogSetMessage(d, Menu_Main_String)
call DialogDisplay(Player(0), d, true)
endif
endfunction
private function Continue takes nothing returns nothing
call LoadCheckpoint(GetLastCheckpoint())
endfunction
private function ButtonPressedSpeed takes nothing returns nothing
local button b = GetClickedButton()
local integer i = 0
loop
if speed[i] == b then
call SetDialogSpeed(i + speedOffset)
endif
set i = i + 1
exitwhen i >= speedMax
endloop
call DialogSetMessage(d, Menu_Main_String)
call DialogDisplay(Player(0), d, true)
endfunction
private function ButtonPressedOp takes nothing returns nothing
local button b = GetClickedButton()
local integer i = 0
if b == opEasy then
call SetDifficulty(1)
elseif b == opNormal then
call SetDifficulty(2)
elseif b == opHard then
call SetDifficulty(3)
elseif b == opAcquire then
set NOT_AUTO_ATTACK = not(NOT_AUTO_ATTACK)
if GetWidgetLife(udg_PlayerUnit) > 0.405 then
if NOT_AUTO_ATTACK then
call UnitAddType(udg_PlayerUnit, UNIT_TYPE_PEON)
else
call UnitRemoveType(udg_PlayerUnit, UNIT_TYPE_PEON)
endif
endif
elseif b == opSpeed then
call DialogClear(dSpeed)
call DialogSetMessage(dSpeed, Menu_Speed_String)
set speedName[0] = "Very Slow"
set speedName[1] = "Slow"
set speedName[2] = "Medium"
set speedName[3] = "Fast"
set speedName[4] = "Very Fast"
loop
if i != GetDialogSpeed() - speedOffset then
set speed[i] = DialogAddButton(dSpeed, speedName[i], 0)
endif
set i = i + 1
exitwhen i >= speedMax
endloop
call DialogAddButton(dSpeed, "Cancel", 0)
call DialogDisplay(Player(0), dSpeed, true)
return
endif
call DialogSetMessage(d, Menu_Main_String)
call DialogDisplay(Player(0), d, true)
endfunction
private function ButtonPressed2 takes nothing returns nothing
local button b = GetClickedButton()
local integer id = 1
if b == cancelLoad then
call DialogSetMessage(d, Menu_Main_String)
call DialogDisplay(Player(0), d, true)
return
endif
loop
exitwhen point[id] == b
set id = id + 1
endloop
if needClean then
call CleanUp()
endif
call LoadCheckpointByID(id)
endfunction
private function ButtonPressed takes nothing returns nothing
local button b = GetClickedButton()
local integer n = 1
local integer id
local string s
if b == new then
call DialogClear(dNew)
call DialogSetMessage(dNew, "What difficulty?")
loop
set s = GetDifficultyName(n)
exitwhen s == null
set newDifficulty[n] = DialogAddButton(dNew, s, 0)
set n = n + 1
endloop
call DialogAddButton(dNew, "Cancel", 0)
call DialogDisplay(Player(0), dNew, true)
elseif b == continue then
if needClean then
call CleanUp()
endif
call Continue()
elseif b == load then
if d2 == null then
set d2 = DialogCreate()
set Menu_Load = d2
else
call DialogClear(d2)
endif
call DialogSetMessage(d2, Menu_Load_String)
loop
set id = CheckpointNumber2ID(n)
exitwhen id == 0
if HaveStoredUnit(udg_gc, CheckpointID2String(id), "unit") then
set point[id] = DialogAddButton(d2, I2S(n) + ": " + CheckpointID2Name(id), 0)
endif
set n = n + 1
endloop
set cancelLoad = DialogAddButton(d2, "Cancel", 0)
call DialogDisplay(Player(0), d2, true)
elseif b == options then
call DialogClear(op)
call DialogSetMessage(op, "Which option?")
if NOT_AUTO_ATTACK then
set opAcquire = DialogAddButton(op, "Auto-acquire ON?", 0)
else
set opAcquire = DialogAddButton(op, "Auto-acquire OFF?", 0)
endif
set n = GetDifficulty()
if n < 4 and needClean then
if n != 1 then
set opEasy = DialogAddButton(op, GetDifficultyName(1) + " mode?", 0)
endif
if n != 2 then
set opNormal = DialogAddButton(op, GetDifficultyName(2) + " mode?", 0)
endif
if n != 3 then
set opHard = DialogAddButton(op, GetDifficultyName(3) + " mode?", 0)
endif
endif
set opSpeed = DialogAddButton(op, "Dialog speed?", 0)
call DialogAddButton(op, "Cancel", 0)
call DialogDisplay(Player(0), op, true)
endif
endfunction
function DisplayMainMenu takes boolean inGame returns nothing
local dialog d = Menu_Main
call DialogDisplay(Player(0), d, false)
call DialogDisplay(Player(0), d2, false)
set needClean = inGame
call DialogClear(d)
set new = DialogAddButton(d, "New Game", 0)
call DialogSetMessage(d, Menu_Main_String)
if GetLastCheckpoint() != null then
set continue = DialogAddButton(d, "Continue", 0)
set load = DialogAddButton(d, "Load", 0)
endif
set options = DialogAddButton(d, "Options", 0)
if inGame then
set cancel = DialogAddButton(d, "Cancel", 0)
endif
call DialogDisplay(Player(0), d, true)
endfunction
function Trig_Starting_Up_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
call FadeOut(0.)
call TriggerSleepAction( 0.00 )
if d == null then
set d = DialogCreate()
set Menu_Main = d
else
call DialogClear(d)
endif
if d2 == null then
set d2 = DialogCreate()
set Menu_Load = d2
else
call DialogClear(d2)
endif
if dNew == null then
set dNew = DialogCreate()
else
call DialogClear(dNew)
endif
if op == null then
set op = DialogCreate()
else
call DialogClear(op)
endif
if dSpeed == null then
set dSpeed = DialogCreate()
else
call DialogClear(dSpeed)
endif
call TriggerAddAction(t, function ButtonPressed)
call TriggerRegisterDialogEvent(t, d)
set t = CreateTrigger()
call TriggerAddAction(t, function ButtonPressed2)
call TriggerRegisterDialogEvent(t, d2)
set t = CreateTrigger()
call TriggerAddAction(t, function ButtonPressedNew)
call TriggerRegisterDialogEvent(t, dNew)
set t = CreateTrigger()
call TriggerAddAction(t, function ButtonPressedOp)
call TriggerRegisterDialogEvent(t, op)
set t = CreateTrigger()
call TriggerAddAction(t, function ButtonPressedSpeed)
call TriggerRegisterDialogEvent(t, dSpeed)
call DisplayMainMenu(false)
endfunction
endlibrary
function MenuAbility takes nothing returns nothing
if GetSpellAbilityId() == 'A00C' then
call DisplayMainMenu(true)
endif
endfunction
//===========================================================================
function InitTrig_Menu takes nothing returns nothing
local trigger t = CreateTrigger()
set gg_trg_Menu = CreateTrigger( )
call TriggerAddAction( gg_trg_Menu, function Trig_Starting_Up_Actions )
set t = CreateTrigger()
call TriggerAddAction(t, function MenuAbility)
call TriggerRegisterPlayerUnitEvent(t, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
endfunction
//TESH.scrollpos=48
//TESH.alwaysfold=0
scope OpeningCinematic
globals
private real height
private real speed
private unit portal
endglobals
private function SecondPart takes nothing returns nothing
call UnitApplyTimedLife(portal, 'b000', 5.)
call TriggerExecute(gg_trg_Opening_Cinematic_2)
endfunction
private function Sliding takes nothing returns nothing
local unit u = pc.u
call SetUnitY(u, GetUnitY(u) + speed)
set speed = speed - 0.7
if speed > 0 then
call TimerStart(GetExpiredTimer(), 0.02, false, function Sliding)
else
call ReleaseTimer(GetExpiredTimer())
call SecondPart()
endif
endfunction
private function Falling takes nothing returns nothing
local unit u = pc.u
call SetUnitY(u, GetUnitY(u) + 20.)
set speed = speed + 0.15
call SetUnitFlyHeight(u, height - speed, 0)
set height = height - speed
if height > 0 then
call TimerStart(GetExpiredTimer(), 0.02, false, function Falling)
else
set speed = 20.
call TimerStart(GetExpiredTimer(), 0.02, false, function Sliding)
endif
endfunction
function Skip takes nothing returns nothing
call CreatePlayerUnit(0., 0., 0.)
call CinematicModeOff()
call SaveCheckpointByID(4)
call CheckpointMessage(4)
call ExecuteFunc("beforeAbom1")
endfunction
globals
item prettyFlower = null
endglobals
function Trig_Opening_Cinematic_Actions takes nothing returns nothing
local unit u
call CinematicModeOn()
call StartMusic(null)
call ClearMapMusic()
call CameraSetupApply( gg_cam_Starting_Camera, true, false)
call CreateFlower()
call SetTimeOfDay( 0.00 )
call UseTimeOfDayBJ( false )
if GetDifficulty() == 4 then
call DisplayText("|c00ffaaaaWarning: No Checkpoints or Saving on Impossible!")
endif
set EscapeInterrupt = false
call PolledWait(0.5)
call FadeIn(1.)
call PolledWait( 1.5 )
if EscapeInterrupt then
call Skip()
return
endif
set portal = CreateUnit(Player(15), 'hprt', GetRectCenterX(gg_rct_Create_Portal), GetRectCenterY(gg_rct_Create_Portal), 90.)
call SetUnitAnimation(portal, "birth")
call PlaySoundBJ( gg_snd_ShimmeringPortalBirth )
call PolledWait( 3.5 )
if EscapeInterrupt then
call RemoveUnit(portal)
call StopSound(gg_snd_ShimmeringPortalBirth, false, false)
call Skip()
return
endif
call PolledWait(3.)
if EscapeInterrupt then
call RemoveUnit(portal)
call StopSound(gg_snd_ShimmeringPortalBirth, false, false)
call Skip()
return
endif
set u = CreatePlayerUnit(GetRectCenterX(gg_rct_Create_Portal), GetRectCenterY(gg_rct_Create_Portal), 270.)
call SetUnitAnimation(u, "death")
call UnitAddAbility(u, 'Amrf')
call UnitRemoveAbility(u, 'Amrf')
call SetUnitFlyHeight(u, 155., 0)
set height = 155.
set speed = 1.
call TimerStart(NewTimer(), 0.02, false, function Falling)
set u = null
endfunction
endscope
//===========================================================================
function InitTrig_Opening_Cinematic takes nothing returns nothing
set gg_trg_Opening_Cinematic = CreateTrigger( )
call TriggerAddAction( gg_trg_Opening_Cinematic, function Trig_Opening_Cinematic_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Opening_Cinematic_2_Actions takes nothing returns nothing
call IssuePointOrderLocBJ( udg_PlayerUnit, "move", OffsetLocation(GetRectCenter(gg_rct_Create_Portal), 0, 800.00) )
call PolledWait( 1.00 )
call TransmissionAndBuffer(pc.u, pc.name(), "A flesh-beast! I wonder if I can use my shield to block his very slow attacks... physically impossible? Nowai!")
call PlaySoundBJ( gg_snd_DarkRitualTarget1 )
call CreateNUnitsAtLoc( 1, 'uabo', Player(11), OffsetLocation(GetRectCenter(gg_rct_Create_Portal), 0, 150.00), 90.00 )
call AddSpecialEffectTargetUnitBJ( "overhead", GetLastCreatedUnit(), "Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl" )
call SetUnitTimeScalePercent( GetLastCreatedUnit(), 50. )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", udg_PlayerUnit )
call SetUnitInvulnerable( GetLastCreatedUnit(), true )
call PolledWait( 6.00 )
call SetUnitInvulnerable( GetLastCreatedUnit(), false )
call IssueImmediateOrder( udg_PlayerUnit, "holdposition" )
call TransmissionClearBuffer()
call CinematicModeOff()
call EnableTrigger( gg_trg_Camera )
call CameraOutside()
call EnableTrigger(gg_trg_Kill_Abomination)
call StartMusic(FIGHT_MUSIC)
set gameStage = 10
call SaveCheckpointByID(4)
call PolledWait(1.)
call CheckpointMessage(4)
endfunction
//===========================================================================
function InitTrig_Opening_Cinematic_2 takes nothing returns nothing
set gg_trg_Opening_Cinematic_2 = CreateTrigger( )
call TriggerAddAction( gg_trg_Opening_Cinematic_2, function Trig_Opening_Cinematic_2_Actions )
endfunction
//TESH.scrollpos=4
//TESH.alwaysfold=0
function Trig_Kill_Abomination_Actions takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
call CinematicModeOn()
call IssueImmediateOrder(udg_PlayerUnit, "holdposition")
call Transmission(pc.u, pc.name(), "HAI! Take that you fatty!")
call TransmissionBuffer(pc.u, pc.name(), "...they'll be after me....")
call WaitBuffer()
call StartMusic(null)
call TransmissionBuffer(pc.u, pc.name(), "...in force, too...")
call WaitBuffer()
call TransmissionBuffer(pc.u, pc.name(), "Maybe I should go talk to the people in that house over there; find out who's in charge.")
call WaitBuffer()
call WaitConclude()
call UnitAddAbilityBJ( 'A001', udg_PlayerUnit )
call CinematicModeOff()
call DisplayText( "You have gained the 'Talk' ability. Congratulations." )
call PlaySoundBJ( gg_snd_Hint )
call StartMusic(NORMAL_MUSIC)
if not(udg_Loading) then
call SaveCheckpointByID(1)
call PolledWait(1.)
call CheckpointMessage(1)
else
set udg_Loading = false
endif
call EnableTrigger(gg_trg_Camera)
call EnableTrigger(gg_trg_Talking_to_Daughter_1)
call EnableTrigger(gg_trg_Talking_to_Father_1)
endfunction
//===========================================================================
function InitTrig_Kill_Abomination takes nothing returns nothing
set gg_trg_Kill_Abomination = AddTrigger( 6 )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Kill_Abomination, Player(11), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_Kill_Abomination, function Trig_Kill_Abomination_Actions )
endfunction
//TESH.scrollpos=22
//TESH.alwaysfold=0
library DaughterTree initializer Init uses Randomisation, DaughterCoralna, DaughterSoldier, DaughterOrnia
public function romanceMore takes nothing returns boolean
return false
endfunction
public function soldierMore takes nothing returns boolean
return DaughterSoldier_more()
endfunction
public function coralnaMore takes nothing returns boolean
return DaughterCoralna_more()
endfunction
public function orniaMore takes nothing returns boolean
return DaughterOrnia_more()
endfunction
public function soldierAsk takes nothing returns nothing
call DaughterSoldier_ask()
endfunction
public function coralnaAsk takes nothing returns nothing
call DaughterCoralna_ask()
endfunction
public function orniaSay takes nothing returns nothing
call DaughterOrnia_say()
endfunction
public function orniaNext takes nothing returns string
return DaughterOrnia_nextOption()
endfunction
//================================
public function askMore takes nothing returns boolean
return soldierMore() or coralnaMore()
endfunction
public function sayMore takes nothing returns boolean
return orniaMore()
endfunction
public function talkMore takes nothing returns boolean
return askMore() or sayMore()
endfunction
//================================
public function sayEvent takes nothing returns nothing
loop
exitwhen sayMore() == false
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
if orniaMore() then
call cc.AddDecision(ANY, orniaNext(), "ornia")
endif
call cc.AddDecision(ANY, "Nevermind", "never")
call cc.WaitForOutput(true)
if cc.OutputIndex == "ornia" then
call orniaSay()
elseif cc.OutputIndex == "never" then
if Ran(1./3) then
call Transmission(pc.u, pc.name(), "Nevermind.")
elseif Ran(1./2) then
call Transmission(pc.u, pc.name(), "It doesn't matter.")
else
call Transmission(pc.u, pc.name(), "Nothing, don't worry.")
endif
exitwhen true
endif
if Ran(1./3) then
call TransmissionAndBuffer(ornia.u, ornia.name(), "Anything else?")
elseif Ran(1./2) then
call TransmissionAndBuffer(ornia.u, ornia.name(), "What else do you want to talk about?")
else
call TransmissionAndBuffer(ornia.u, ornia.name(), "Is there something else?")
endif
endloop
endfunction
public function askEvent takes nothing returns nothing
loop
if soldierMore() then
call soldierAsk()
elseif coralnaMore() then
call coralnaAsk()
else
exitwhen true
endif
endloop
endfunction
//================================
public function sayRequest takes nothing returns nothing
if Ran(1./3) then
call Transmission(pc.u, pc.name(), "Mind if we talk about a few things?")
elseif Ran(1./2) then
call Transmission(pc.u, pc.name(), "Can we talk?")
else
call Transmission(pc.u, pc.name(), "I'd like to discuss a few things, if you don't mind?")
endif
if ornia.getMood() >= GetRandomReal(7.5, 12.5) then
if Ran(1./3) then
call TransmissionBuffer(ornia.u, ornia.name(), "Of course - what do you want to talk about?")
elseif Ran(1./2) then
call TransmissionBuffer(ornia.u, ornia.name(), "Sure; I'm all ears.")
else
call TransmissionBuffer(ornia.u, ornia.name(), "I'd love to, go ahead.")
endif
elseif ornia.getMood() >= GetRandomReal(0.5, 3.5) then
if Ran(1./3) then
call TransmissionBuffer(ornia.u, ornia.name(), "Go ahead.")
elseif Ran(1./2) then
call TransmissionBuffer(ornia.u, ornia.name(), "No problem.")
else
call TransmissionBuffer(ornia.u, ornia.name(), "Speak on.")
endif
else
if Ran(1./3) then
call TransmissionBuffer(ornia.u, ornia.name(), "I guess so...")
elseif Ran(1./2) then
call TransmissionBuffer(ornia.u, ornia.name(), "Go on...")
else
call TransmissionBuffer(ornia.u, ornia.name(), "Whatever.")
endif
endif
call WaitBuffer()
call sayEvent()
endfunction
public function askRequest takes nothing returns nothing
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "Sure", "sure")
call cc.AddDecision(ANY, "Not right now", "no")
call cc.WaitForOutput(true)
if cc.OutputIndex == "sure" then // these responses may change with progress in later editions.
if Ran(1/3) then
call Transmission(pc.u, pc.name(), "Sure - go ahead.")
elseif Ran(1/2) then
call Transmission(pc.u, pc.name(), "Of course - ask away.")
else
call Transmission(pc.u, pc.name(), "I'm all ears.")
endif
call WaitConclude()
call askEvent()
elseif cc.OutputIndex == "no" then
call Transmission(pc.u, pc.name(), "Not right now, " + ornia.name() + ".")
call TransmissionBuffer(ornia.u, ornia.name(), "Oh...okay. That's fine; don't worry about it.")
call WaitBuffer()
endif
endfunction
public function talkRequest_T takes nothing returns nothing // not yet implemented
if sayMore() then
call sayRequest()
endif
//if askMore() then
// call TransmissionAndBuffer(ornia.u, ornia.name(), "I'd like to talk to you about a few things, if you don't mind.") // this'll need to get expanded
endfunction
//================================
private function Init takes nothing returns nothing
endfunction
endlibrary
//TESH.scrollpos=12
//TESH.alwaysfold=0
library DaughterSoldier uses Randomisation, ConTran
globals
private integer IDENT = 1
endglobals
private function stage takes nothing returns integer
return ornia.convoState[IDENT]
endfunction
private function incStage takes nothing returns nothing
set ornia.convoState[IDENT] = ornia.convoState[IDENT] + 1
endfunction
private function stage0 takes nothing returns nothing
if soldierType == MILITIA then
call TransmissionAndBuffer(ornia.u, ornia.name(), "You're were called up to defend Coralna, weren't you?")
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "To do my duty", "duty")
call cc.AddDecision(ANY, "Unfortunately", "unfort")
call cc.WaitForOutput(true)
if cc.OutputIndex == "duty" then
call Transmission(pc.u, pc.name(), "I had my duty to do, and I did it; we all did.")
call TransmissionBuffer(ornia.u, ornia.name(), "The honourable thing to do but, still - why was it necessary?")
call WaitBuffer()
call ornia.modRespect(2)
elseif cc.OutputIndex == "unfort" then
call Transmission(pc.u, pc.name(), "Unfortunately...yea, I got called up.")
call TransmissionBuffer(ornia.u, ornia.name(), "You resented it, I take it then... Why did they need to call up militia?")
call WaitBuffer()
endif
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "Politics?", "politics")
call cc.AddDecision(ANY, "Dangers?", "dangers")
call cc.WaitForOutput(true)
if cc.OutputIndex == "politics" then
call Transmission(pc.u, pc.name(), "Could have been a lot of reasons, but I reckon politics; probably for some stupid show of force.")
call TransmissionBuffer(ornia.u, ornia.name(), "Perhaps; guess it doesn't matter now why you were called up.")
call WaitBuffer()
elseif cc.OutputIndex == "dangers" then
call Transmission(pc.u, pc.name(), "I reckon someone up top could see danger on the horizon.")
call TransmissionBuffer(ornia.u, ornia.name(), "Maybe; a shame more couldn't have been done...")
call WaitBuffer()
endif
elseif soldierType == SOLDIER then
call TransmissionAndBuffer(ornia.u, ornia.name(), "So why'd you join up as a soldier then?")
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "Protect people", "protect")
call cc.AddDecision(ANY, "Nice prestige", "rep")
call cc.AddDecision(ANY, "Just a job", "job")
call cc.WaitForOutput(true)
if cc.OutputIndex == "protect" then
call Transmission(pc.u, pc.name(), "I wanted to get out there and protect people.")
call TransmissionBuffer(ornia.u, ornia.name(), "How noble! And yet I can't help wondering...")
call WaitBuffer()
call ornia.modRespect(2)
call ornia.modLike(1)
elseif cc.OutputIndex == "rep" then
call Transmission(pc.u, pc.name(), "I liked the prestige that went with the job.")
call TransmissionBuffer(ornia.u, ornia.name(), "As good a reason as any, I guess.")
call WaitBuffer()
elseif cc.OutputIndex == "unfort" then
call Transmission(pc.u, pc.name(), "It was just a job to me; pay wasn't too bad, so I signed up.")
call TransmissionBuffer(ornia.u, ornia.name(), "I guess there are worse reasons for joining up.")
call WaitBuffer()
endif
elseif soldierType == MERC then
call TransmissionAndBuffer(ornia.u, ornia.name(), "A merc, huh? Money for killing people and all that?")
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "Still protect home", "protect")
call cc.AddDecision(ANY, "More freedom", "free")
call cc.AddDecision(ANY, "Just a job", "job")
call cc.WaitForOutput(true)
if cc.OutputIndex == "protect" then
call Transmission(pc.u, pc.name(), "I'm still protecting my home - I'm just not officially Coralna military.")
call TransmissionBuffer(ornia.u, ornia.name(), "Well, I guess that ain't so bad...")
call WaitBuffer()
call ornia.modRespect(2)
call ornia.modLike(1)
elseif cc.OutputIndex == "free" then
call Transmission(pc.u, pc.name(), "As a merc, I'm a lot freer - so long as I do my job, they don't bother me.")
call TransmissionBuffer(ornia.u, ornia.name(), "As good a reason as any, I guess.")
call WaitBuffer()
elseif cc.OutputIndex == "unfort" then
call Transmission(pc.u, pc.name(), "It was just a job to me; pay's better than a normal guard, but you have to buy your own kit.")
call TransmissionBuffer(ornia.u, ornia.name(), "I guess there are worse reasons for killing people...")
call WaitBuffer()
call ornia.modRespect(1)
endif
endif
call TransmissionBuffer(ornia.u, ornia.name(), "What about now - what do you fight for now?")
call WaitBuffer()
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "Vengeance", "vengeance")
call cc.AddDecision(ANY, "Duty", "duty")
call cc.AddDecision(ANY, "Necessity", "need")
call cc.WaitForOutput(true)
if cc.OutputIndex == "vengeance" then
call Transmission(pc.u, pc.name(), "I'm out for vengeance - for Coralna, and everyone in it.")
call TransmissionBuffer(ornia.u, ornia.name(), "I...I hope you get it...but...*sigh* Nevermind.")
call WaitBuffer()
elseif cc.OutputIndex == "duty" then
call Transmission(pc.u, pc.name(), "They need to be stopped - I've got a duty to help do that.")
call TransmissionBuffer(ornia.u, ornia.name(), "Good - that's what we're all here for.")
call WaitBuffer()
elseif cc.OutputIndex == "need" then
call Transmission(pc.u, pc.name(), "They need to be stopped, before they kill others - me, you, everyone.")
call TransmissionBuffer(ornia.u, ornia.name(), "Too many lives have already been lost...all we can do is save who we can.")
call WaitBuffer()
endif
call WaitEscape()
call incStage()
endfunction
public function more takes nothing returns boolean
if stage() == 0 then
return true
endif
return false
endfunction
public function ask takes nothing returns nothing
if not(more()) then
return
elseif stage() == 0 then // note conditions can be in MORE (and should be)
call stage0()
endif
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library DaughterCoralna uses Randomisation, ConTran
globals
private integer IDENT = 2
endglobals
private function stage takes nothing returns integer
return ornia.convoState[IDENT]
endfunction
private function incStage takes nothing returns nothing
set ornia.convoState[IDENT] = ornia.convoState[IDENT] + 1
endfunction
private function stage0 takes nothing returns nothing
local string s
call Transmission(ornia.u, ornia.name(), "Tell me about Coralna.")
call TransmissionBuffer(pc.u, pc.name(), "Coralna - a beautiful a city, the Eternal City...")
call WaitBuffer()
call TransmissionBuffer(pc.u, pc.name(), "...an eternal city that lies in ruin.")
call WaitBuffer()
call TransmissionBuffer(pc.u, pc.name(), "It is...was...")
call WaitBuffer()
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "Home", "home")
call cc.AddDecision(ANY, "Just a place", "place")
call cc.AddDecision(ANY, "Doesn't matter; it's gone", "gone")
call cc.WaitForOutput(true)
if cc.OutputIndex == "home" then // ADJUST BELOW IF CHANGED
call Transmission(pc.u, pc.name(), "It is...was...my home.")
elseif cc.OutputIndex == "place" then
call Transmission(pc.u, pc.name(), "It is...was...just another place. I lived there; that's it.")
elseif cc.OutputIndex == "gone" then
call Transmission(pc.u, pc.name(), "It is...was...What does it matter? It's gone now.")
endif
set s = cc.OutputIndex
call TransmissionBuffer(ornia.u, ornia.name(), "Do you miss it?")
call WaitBuffer()
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "Of course", "course")
call cc.AddDecision(ANY, "A little", "little")
call cc.AddDecision(ANY, "Not at all", "no")
call cc.WaitForOutput(true)
if cc.OutputIndex == "course" then
call ornia.modLike(1)
if s == "home" then
call Transmission(pc.u, pc.name(), "Of course; I grew up there...as I said, it's my home.")
elseif s == "place" then
call Transmission(pc.u, pc.name(), "Yea, of course I do - even though it was just a place, most of the people I knew...the city...")
elseif s == "gone" then
call Transmission(pc.u, pc.name(), "Of course! I lived there, grew up there, and now...now it's gone.")
endif
call TransmissionBuffer(ornia.u, ornia.name(), "I'm sorry for your loss; we'll get the people who did this.")
call WaitBuffer()
elseif cc.OutputIndex == "little" then
call Transmission(pc.u, pc.name(), "A little; all those people, the places...I grew up there, and now...")
call TransmissionBuffer(ornia.u, ornia.name(), "I know; it's a lot to take in, but...we'll get them for what they did.")
call WaitBuffer()
elseif cc.OutputIndex == "gone" then
call Transmission(pc.u, pc.name(), "No...no I don't. Nothing; the place I grew up in destroyed, and I don't miss it.")
call TransmissionBuffer(ornia.u, ornia.name(), "Maybe it just hasn't had time to settle in yet...we'll get the bastards.")
call WaitBuffer()
endif
call WaitEscape()
call incStage()
endfunction
public function more takes nothing returns boolean
if stage() == 0 then
return ornia.getAnger() < 2
endif
return false
endfunction
public function ask takes nothing returns nothing
if not(more()) then
return
elseif stage() == 0 then // note conditions can be in MORE (and should be)
call stage0()
endif
endfunction
endlibrary
//TESH.scrollpos=33
//TESH.alwaysfold=0
library DaughterOrnia uses Randomisation, ConTran
globals
private integer IDENT = 3
public boolean tempBlock = false // is blocked
public boolean tempBlocked = false // has been
endglobals
private function stage takes nothing returns integer
return ornia.convoState[IDENT]
endfunction
private function incStage takes nothing returns nothing
set ornia.convoState[IDENT] = ornia.convoState[IDENT] + 1
endfunction
private function releaseBlock takes nothing returns nothing
loop
exitwhen not(InCinematic)
call TriggerSleepAction(0.)
endloop
set tempBlock = false
endfunction
private function addBlock takes nothing returns nothing
set tempBlock = true
set tempBlocked = true
call releaseBlock.execute()
endfunction
public function initRomance takes nothing returns nothing
set ornia.romanceState = IMaxBJ(ornia.romanceState, 1)
endfunction
private function talents takes integer int returns nothing
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "Beauty", "beauty")
call cc.AddDecision(ANY, "Kindness", "kind")
if int == 0 then
call cc.AddDecision(ANY, "Digging for compliments", "compliments")
call cc.AddDecision(ANY, "I don't know", "know")
else
call cc.AddDecision(ANY, "I'd rather not", "not")
endif
call cc.WaitForOutput(true)
if cc.OutputIndex == "beauty" then
call Transmission(pc.u, pc.name(), "You are as beautiful as the evening sky, encrusted with jewels of glistening light.")
call TransmissionBuffer(ornia.u, ornia.name(), "*blushes* Well, when you put it like that...how can I deny it?")
call WaitBuffer()
call ornia.modLike(0.75)
call ornia.modLove(1.5)
call initRomance()
elseif cc.OutputIndex == "kind" then
call Transmission(pc.u, pc.name(), "You are kind and generous - qualities of infinite worth in this world of sorrow.")
call TransmissionBuffer(ornia.u, ornia.name(), "*smiles* Thank you, " + pc.name() + "; that's nice to hear.")
call WaitBuffer()
call ornia.modLike(1)
call ornia.modLove(0.75)
call ornia.modRespect(0.5)
call ornia.modTrust(0.5)
call initRomance()
elseif cc.OutputIndex == "compliments" then
call Transmission(pc.u, pc.name(), "You are adept at digging for compliments!")
call TransmissionBuffer(ornia.u, ornia.name(), "*giggles* Obvious not adept enough - go on, indulge me.")
call WaitBuffer()
call ornia.modLike(0.5)
call talents(1)
elseif cc.OutputIndex == "know" then
call Transmission(pc.u, pc.name(), "I don't really know you well enough to say.")
call TransmissionBuffer(ornia.u, ornia.name(), "Ahh...okay; that makes sense, yea.")
call WaitBuffer()
elseif cc.OutputIndex == "not" then
call Transmission(pc.u, pc.name(), "I'd rather not; don't want to get your ego too big, do we?")
call TransmissionBuffer(ornia.u, ornia.name(), "Spoil sport!")
call WaitBuffer()
call ornia.modLike(0.5)
endif
endfunction
private function stage0 takes nothing returns nothing
local boolean willBlock = ornia.getMood() < 8.5
if not(tempBlocked) then
call Transmission(pc.u, pc.name(), "Tell me about yourself, " + ornia.name() + ".")
if willBlock then
call TransmissionBuffer(ornia.u, ornia.name(), "Sorry, " + pc.name() + ", but I'd rather not at the moment.")
call WaitBuffer()
call addBlock()
call WaitConclude()
return
endif
else
if Ran(1./3) then
call Transmission(pc.u, pc.name(), "Could we talk about yourself, " + ornia.name() + "?")
elseif Ran(1./2) then
call Transmission(pc.u, pc.name(), "Is it okay if we talk about you?")
else
call Transmission(pc.u, pc.name(), "I'd like to talk about you, if that's okay?")
endif
if willBlock then
if Ran(1./3) then
call Transmission(ornia.u, ornia.name(), "I'd rather not; not right now.")
elseif Ran(1./2) then
call Transmission(ornia.u, ornia.name(), "Maybe later.")
else
call Transmission(ornia.u, ornia.name(), "Not for now.")
endif
call WaitBuffer()
call addBlock()
call WaitConclude()
return
endif
set tempBlocked = false
call TransmissionBuffer(ornia.u, ornia.name(), "I guess, if you want; sorry for being a bit closed up, we don't have many people around here...")
call WaitBuffer()
endif
call TransmissionBuffer(ornia.u, ornia.name(), "What's there to tell? I live out here, mainly studying; he keeps trying to get me to learn magic, but I'm not much good...")
call WaitBuffer()
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "That can't be true", "can't")
call cc.AddDecision(ANY, "Sorry to hear that", "sorry")
call cc.AddDecision(ANY, "We all have our own talents", "talents")
call cc.WaitForOutput(true)
if cc.OutputIndex == "can't" then
call Transmission(pc.u, pc.name(), "That can't be true, " + ornia.name() + " - you're just being modest.")
call TransmissionBuffer(ornia.u, ornia.name(), "Well...maybe I judge myself too harshly in comparison with my father... *smiles* I appreciate your confidence in me, thank you.")
call WaitBuffer()
call initRomance() // sets it to 1, the initial setup
call ornia.modLove(0.5)
call ornia.modLike(1)
call ornia.modTrust(0.5)
call ornia.modRespect(0.25)
elseif cc.OutputIndex == "sorry" then
call Transmission(pc.u, pc.name(), "I'm sorry to hear that; a shame really.")
call TransmissionBuffer(ornia.u, ornia.name(), "Yea... *shrugs* Nothing I can do about it.")
call WaitBuffer()
elseif cc.OutputIndex == "talents" then
call Transmission(pc.u, pc.name(), "We all have our own talents, " + ornia.name() + ".")
call TransmissionBuffer(ornia.u, ornia.name(), "Oh? What would you say mine are then?")
call WaitBuffer()
call ornia.modLike(0.5)
call ornia.modRespect(0.5)
call talents(0)
endif
call WaitConclude()
call incStage()
endfunction
public function nextOption takes nothing returns string
if tempBlock then
return null
endif
if stage() == 0 then
if gameStage >= 30 then
if not(tempBlocked) then
return "Tell me about yourself"
else
return "Can we talk about you?"
endif
endif
endif
return null
endfunction
public function more takes nothing returns boolean
return nextOption() != null
endfunction
public function say takes nothing returns nothing
loop
exitwhen not(more()) // this loop needs to be in the others too
if stage() == 0 then
call stage0()
endif
endloop
endfunction
endlibrary
//TESH.scrollpos=236
//TESH.alwaysfold=0
scope DaughterOne
globals
integer spokeToDaughter = 0
integer thankedDaughter = 0 // not saved.
public integer innuendo = 0
public integer silly = 0
public integer avoidance = 0
endglobals
private function sillyDefault takes nothing returns nothing
set silly = silly + 1
call ornia.modRespect(-0.05)
call ornia.modTrust(-0.05)
call ornia.modLike(-0.05)
call ornia.modAnger(1)
endfunction
private function innuendoDefault takes nothing returns nothing
set innuendo = innuendo + 1
call ornia.modRespect(-0.1)
call ornia.modTrust(-0.05)
call ornia.modLike(-0.1)
call ornia.modAnger(2)
endfunction
private function avoidanceDefault takes nothing returns nothing
set avoidance = avoidance + 1
call ornia.modRespect(-0.05)
call ornia.modTrust(-0.05)
call ornia.modLike(-0.05)
call ornia.modAnger(1)
endfunction
private function following takes nothing returns nothing
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "Sorry...?", "sorry")
call cc.AddDecision(ANY, "I'll protect you", "protect")
call cc.AddDecision(ANY, "Deal with it", "deal")
call cc.WaitForOutput(true)
if cc.OutputIndex == "sorry" then
call Transmission(pc.u, pc.name(), "Erm... sorry...?")
call TransmissionBuffer(ornia.u, ornia.name(), "Sorry ain't good enough, mister. *sighs* Speak to my father in the other room.")
call WaitBuffer()
elseif cc.OutputIndex == "protect" then
call Transmission(pc.u, pc.name(), "I'll protect you; don't worry.")
call TransmissionBuffer(ornia.u, ornia.name(), "Yea, great, you and your sole sword against an army of demons and sorcerers? I appreciate the thought, but you better talk to father.")
call WaitBuffer()
call ornia.modLove(1)
call ornia.modLike(2)
elseif cc.OutputIndex == "protect" then
call Transmission(pc.u, pc.name(), "Yea. Deal with it.")
call TransmissionBuffer(ornia.u, ornia.name(), "*sarcastically* How mature and soldier like... Go talk to my father, in the other room.")
call WaitBuffer()
call ornia.modRespect(-5)
call ornia.modTrust(-3)
call ornia.modLike(-4)
call ornia.modAnger(3)
endif
endfunction
globals
boolean terrorsDone = false
endglobals
private function against takes integer desire, integer silly returns nothing //what he's up against NB: Desire will be -1 if unavailable due to not fitting
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "Demons and sorcerers", "desorc")
if silly == 0 then
call cc.AddDecision(ANY, "Fluffy bunnies", "bunnies")
elseif silly == 1 then
call cc.AddDecision(ANY, "The birds", "birds")
elseif silly == 2 then
call cc.AddDecision(ANY, "Greasels", "greasels")
endif
if not(terrorsDone) then
call cc.AddDecision(ANY, "Untold terrors", "terrors")
endif
if desire == 0 then
call cc.AddDecision(ANY, "My desire to bed you", "bed")
endif
call cc.WaitForOutput(true)
if desire == -1 then
set desire = 0
endif
if cc.OutputIndex == "desorc" then
call Transmission(pc.u, pc.name(), "Demons and sorcerers - deadly bastards. Come to think of it, they're probably following me here.")
call TransmissionBuffer(ornia.u, ornia.name(), "What?!?")
call WaitBuffer()
call following()
elseif cc.OutputIndex == "bunnies" then
call Transmission(pc.u, pc.name(), "Fluffy bunnies. *Very* dangerous animals.")
call TransmissionBuffer(ornia.u, ornia.name(), "Think you're funny, huh? No. You're a douche-bag. I can see you've got problems - big problems.")
call WaitBuffer()
call sillyDefault()
call against(desire, 1)
elseif cc.OutputIndex == "birds" then
call Transmission(pc.u, pc.name(), "The birds, the BIRDS!")
call TransmissionBuffer(ornia.u, ornia.name(), "I'm really not in the mood for this, you damned 'cock lover...")
call WaitBuffer()
call sillyDefault()
call against(desire, 2)
elseif cc.OutputIndex == "greasels" then
call Transmission(pc.u, pc.name(), "I'm cleaning out greasals, damned toxic bastards.")
call TransmissionBuffer(ornia.u, ornia.name(), "What...? *looks confused*")
call WaitBuffer()
call TransmissionBuffer(pc.u, pc.name(), "Shit, wrong script, sorry.")
call WaitBuffer()
call against(desire, 3)
elseif cc.OutputIndex == "terrors" then
call Transmission(pc.u, pc.name(), "I'm in a life and death struggle with untold terrors.")
call TransmissionBuffer(ornia.u, ornia.name(), "Yea, I know they're untold, so tell them already!")
call WaitBuffer()
set terrorsDone = true
call against(desire, silly)
elseif cc.OutputIndex == "bed" then
call Transmission(pc.u, pc.name(), "I'm fighting against my desire to bed you immediately, hot stuff.")
call TransmissionBuffer(ornia.u, ornia.name(), "Urgh, you men are pathetic... get serious and focus.")
call WaitBuffer()
call TransmissionBuffer(ornia.u, ornia.name(), "No, I did *not* mean focus on that... just tell me what you're fighting.")
call WaitBuffer()
call innuendoDefault()
call against(1, silly)
endif
endfunction
private function charge takes integer passing, integer eyeing returns nothing // what's a soldier doing in the bedroom?
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
if passing == 0 then
call cc.AddDecision(ANY, "Passing through", "passing")
elseif passing == 1 then
call cc.AddDecision(ANY, "I'm a nosy bastard", "nosy")
endif
call cc.AddDecision(ANY, "Hurled through a portal", "hurled")
if eyeing == 0 then
call cc.AddDecision(ANY, "Eyeing you up", "eyeing")
elseif eyeing == 1 then
call cc.AddDecision(ANY, "Can't take my eyes off you", "eyesoff")
endif
call cc.AddDecision(ANY, "Fighting for my life", "fighting")
call cc.WaitForOutput(true)
if cc.OutputIndex == "passing" then
call Transmission(pc.u, pc.name(), "Oh, nothing much, just passing through.")
if avoidance + silly < 1 then
call TransmissionBuffer(ornia.u, ornia.name(), "Bullshit. Spit it out, and make it quick!")
else
call TransmissionBuffer(ornia.u, ornia.name(), "Cut the bullshit - I want the truth.")
endif
call WaitBuffer()
call avoidanceDefault()
call charge(1, eyeing)
elseif cc.OutputIndex == "nosy" then
call Transmission(pc.u, pc.name(), "I'm a nosy bastard, can't you see that?")
call TransmissionBuffer(ornia.u, ornia.name(), "So, are you going to tell me what a fully armed soldier doing in my bedroom?")
call WaitBuffer()
call sillyDefault()
call charge(2, eyeing)
elseif cc.OutputIndex == "hurled" then
call Transmission(pc.u, pc.name(), "I got hurled through a portal.")
call TransmissionBuffer(ornia.u, ornia.name(), "Oh, great, this sounds like trouble... what's lined up to kill you, then?")
call WaitBuffer()
call against(-1, 0)
elseif cc.OutputIndex == "eyeing" then
call Transmission(pc.u, pc.name(), "I'm eyeing you up, as any man with eyes would be obliged to do.")
if innuendo < 1 then
call TransmissionBuffer(ornia.u, ornia.name(), "Nice try; might work a bit better if I could tell if you had the face of an ass or an angel under that armour.")
else
call TransmissionBuffer(ornia.u, ornia.name(), "Cut that crap - now is not the time for it; you got that?")
endif
call WaitBuffer()
call TransmissionBuffer(ornia.u, ornia.name(), "So just answer the question, before I get even more pissed off.")
call WaitBuffer()
call innuendoDefault()
call charge(passing, 1)
elseif cc.OutputIndex == "eyesoff" then
call Transmission(pc.u, pc.name(), "No, really - I can't take my eyes off you.")
if innuendo < 2 then
call TransmissionBuffer(ornia.u, ornia.name(), "Cut that crap - now is not the time for it; you got that?")
else
call TransmissionBuffer(ornia.u, ornia.name(), "I said stop it. Now.")
endif
call WaitBuffer()
call TransmissionBuffer(ornia.u, ornia.name(), "Give me the answer, and we can get down to sorting whatever shit you are in out.")
call WaitBuffer()
call innuendoDefault()
call charge(passing, 2)
elseif cc.OutputIndex == "fighting" then
call Transmission(pc.u, pc.name(), "I'm fighting for my life.")
call TransmissionBuffer(ornia.u, ornia.name(), "So you're trouble then - what're you fighting against?")
call WaitBuffer()
call against(0, 0)
endif
endfunction
private function noclue takes nothing returns nothing
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "Oh, yea, sorry", "yea")
call cc.AddDecision(ANY, "So what?", "so")
call cc.AddDecision(ANY, "You don't know?", "know")
call cc.WaitForOutput(true)
if cc.OutputIndex == "yea" then
call Transmission(pc.u, pc.name(), "Oh, yea, good point; sorry about that.")
call TransmissionBuffer(ornia.u, ornia.name(), "So, are you going to tell me what a fully armed soldier doing in my bedroom?")
call WaitBuffer()
call charge(0, 0)
elseif cc.OutputIndex == "so" then
call Transmission(pc.u, pc.name(), "So what? Why do I need to explain to you?")
call TransmissionBuffer(ornia.u, ornia.name(), "When a war-ready soldier marches into my bedroom, I want answers. Quickly.")
call WaitBuffer()
call ornia.modRespect(-3)
call ornia.modTrust(-2)
call ornia.modLike(-2)
call ornia.modAnger(3)
call charge(0, 0)
elseif cc.OutputIndex == "know" then
call Transmission(pc.u, pc.name(), "I take it you don't know then...")
call TransmissionBuffer(ornia.u, ornia.name(), "Not yet. But I'm going to get answers as to why a battle-clad soldier is in my bedroom. And fast.")
call WaitBuffer()
call charge(0, 0)
endif
endfunction
private function first takes integer sexy returns nothing
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "You in charge?", "charge")
if sexy == 0 then
call cc.AddDecision(ANY, "Hey beautiful", "beautiful")
endif
call cc.AddDecision(ANY, "What the hell is happening?", "what")
call cc.AddDecision(ANY, "Nice meeting you, bye", "bye")
call cc.WaitForOutput(true)
if cc.OutputIndex == "charge" then
call Transmission(pc.u, pc.name(), "Hey there; you wouldn't happen to be in charge around here, would you?")
call TransmissionBuffer(ornia.u, ornia.name(), "Perhaps I am, perhaps I'm not; tell me, what's a fully armed soldier doing in my bedroom?")
call WaitBuffer()
call charge(0, 0)
elseif cc.OutputIndex == "beautiful" then
call Transmission(pc.u, pc.name(), "Hey beautiful, you look absolutely stunning.")
call TransmissionBuffer(ornia.u, ornia.name(), "Nice try; might work a bit better if I could tell if you had the face of an ass or an angel under that armour.")
call WaitBuffer()
call innuendoDefault()
call first(1)
elseif cc.OutputIndex == "what" then
call Transmission(pc.u, pc.name(), "What the hell is going on...?")
call TransmissionBuffer(ornia.u, ornia.name(), "I don't have a clue; you're the one who's running into my house, remember?")
call WaitBuffer()
call noclue()
elseif cc.OutputIndex == "bye" then
call Transmission(pc.u, pc.name(), "Hi just stopping by, nice meeting you, gotta run!")
call TransmissionBuffer(ornia.u, ornia.name(), "Not so fast, mister - I wanna know what a fully armed soldier is doing in my bedroom, and I want to know now.")
call WaitBuffer()
call sillyDefault()
call charge(0, 0)
endif
endfunction
private function sleepChoice takes integer chat returns nothing
if thankedDaughter == 0 and ornia.convoState[1] > 0 then
call Transmission(ornia.u, ornia.name(), "Thanks for talking about yourself; I appreciate it.")
set thankedDaughter = 1
call WaitConclude()
endif
if chat == 0 then
call TransmissionAndBuffer(ornia.u, ornia.name(), "Outside'll probably be best, sleeeping wise; I know a nice soft bit, and the weather's good - you want to go to sleep now or a bit later?")
elseif chat == 1 then
if DaughterTree_askMore() then
call TransmissionAndBuffer(ornia.u, ornia.name(), "Want to go to sleep yet? I have some questions, if you don't mind...")
else
call TransmissionAndBuffer(ornia.u, ornia.name(), "Ready for sleep yet?")
endif
endif
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "Now", "now")
call cc.AddDecision(ANY, "Later", "later")
if DaughterTree_askMore() then
call cc.AddDecision(ANY, "Chat", "chat")
endif
call cc.WaitForOutput(true)
if cc.OutputIndex == "now" then
call Transmission(pc.u, pc.name(), "I'll sleep now; just point me where, if you would.")
call WaitConclude()
call ClearTransmission()
call StartMusic(null)
set spokeToDaughter = 0
call TriggerExecute( gg_trg_Talking_to_Daughter_1_After )
elseif cc.OutputIndex == "later" then
call Transmission(pc.u, pc.name(), "Not yet.")
call WaitConclude()
call CinematicModeOff()
elseif cc.OutputIndex == "chat" then
call DaughterTree_askRequest()
call sleepChoice(1)
endif
endfunction
private function sleepFirst takes nothing returns nothing
if spokeToDaughter == 1 then
call Transmission(pc.u, pc.name(), "Hello again, " + ornia.name() + "; your father said I could stay here the night.")
else
call Transmission(pc.u, pc.name(), "Hello " + ornia.name() + ", it's nice to meet you; I've just been speaking to your father.")
endif
call TransmissionBuffer(ornia.u, ornia.name(), "Could, should, or will?")
call WaitBuffer()
call TransmissionBuffer(pc.u, pc.name(), "I'm fairly sure it was I *can* stay, as in I *can* leave if I want to be turned into a crisp.")
call WaitBuffer()
call TransmissionBuffer(ornia.u, ornia.name(), "*chuckles* Yes, he's generally like that. I heard you discussions with him.")
call WaitBuffer()
endfunction
function Trig_Talking_to_Daughter_1_Actions takes nothing returns nothing
call IssueImmediateOrder(pc.u, "holdposition")
call CinematicModeOn()
call ApplyCameraWait(gg_cam_Small_Bedroom_Camera, CINE_CAM_TIME)
if spokeToFather == 0 then
if spokeToDaughter == 0 then
call ornia.talkToBonus()
set ornia.hasMet = true
set spokeToDaughter = 1
call first(0)
else
if Ran(1./3) then
call Transmission(ornia.u, ornia.name(), "My father is in the next room - you better speak to him.")
elseif Ran(1./2) then
call Transmission(ornia.u, ornia.name(), "Speak to " + treyvn.name() + " in the next room.")
else
call Transmission(ornia.u, ornia.name(), "Well? What are you waiting for? My father will be waiting for you.")
endif
endif
call WaitConclude()
call CinematicModeOff()
else
if spokeToDaughter != 11 then
call sleepFirst()
set spokeToDaughter = 11
call TransmissionAndBuffer(ornia.u, ornia.name(), "I can find you a place to sleep, but can we just talk for a bit first?")
call DaughterTree_askRequest()
call sleepChoice(0)
elseif spokeToDaughter == 11 then
call sleepChoice(1)
endif
endif
endfunction
//===========================================================================
function InitTrig_Talking_to_Daughter_1 takes nothing returns nothing
set gg_trg_Talking_to_Daughter_1 = AddTrigger(11)
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Talking_to_Daughter_1, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Talking_to_Daughter_1, Condition( function talkToDaughterCond ) )
call TriggerAddAction( gg_trg_Talking_to_Daughter_1, function Trig_Talking_to_Daughter_1_Actions )
endfunction
endscope
//TESH.scrollpos=95
//TESH.alwaysfold=0
scope FatherOne
globals
integer spokeToFather = 0
endglobals
private function friend takes nothing returns nothing
call TransmissionBuffer(treyvn.u, treyvn.name(), "I had a friend in Coralna, a mage. His name was Indaro; he's the one who sent you through the portal, to me.")
call WaitBuffer()
call TransmissionBuffer(treyvn.u, treyvn.name(), "Thanks to him, I know the name of the sorcerers who attacked Coralna - the 'Duodecim Animus'.")
call WaitBuffer()
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "The what?", "what")
call cc.AddDecision(ANY, "Nothing to do with me", "nothing")
call cc.AddDecision(ANY, "Let's go get 'em", "get")
call cc.WaitForOutput(true)
if cc.OutputIndex == "what" then
call Transmission(pc.u, pc.name(), "The what? I've never heard of them.")
elseif cc.OutputIndex == "nothing" then
if soldierType == MERC then
call treyvn.modRespect(-3)
call treyvn.modTrust(-2)
call treyvn.modLike(-2)
call Transmission(pc.u, pc.name(), "That's nothing to do with me; I'm just a merc, and one without a living employer at that.")
call TransmissionBuffer(treyvn.u, treyvn.name(), "This goes beyond money, " + pc.name() + "! ... *sigh* I'll make sure you get paid when your work is done.")
else
call Transmission(pc.u, pc.name(), "That's nothing to do with me, I did my duty, and it wasn't good enough.")
if soldierType == MILITIA then
call TransmissionBuffer(treyvn.u, treyvn.name(), "I'm sorry, " + pc.name() + ", but you're going to have to go beyond the call of duty for this one.")
else
call treyvn.modRespect(-2)
call treyvn.modTrust(-1)
call treyvn.modLike(-1)
call TransmissionBuffer(treyvn.u, treyvn.name(), "You're a soldier, " + pc.name() + " - your duty is to go beyond the call of duty.")
endif
endif
call WaitBuffer()
elseif cc.OutputIndex == "get" then
call treyvn.modRespect(-2)
call treyvn.modTrust(1)
call Transmission(pc.u, pc.name(), "What are we waiting for - let's go get 'em!")
call TransmissionBuffer(treyvn.u, treyvn.name(), "That would not be a wise response. Discretion is the better part of valour, " + pc.name() + ".")
call WaitBuffer()
endif
call TransmissionBuffer(treyvn.u, treyvn.name(), "The 'Duodecim Animus', or 'Twelve Souls', were, a mere few years ago, a group of weak sorcerers, barely able to raise a single corpse.")
call WaitBuffer()
call TransmissionBuffer(treyvn.u, treyvn.name(), "Now, alas, they appear to have become powerful essence mages. Their arrogence in attacking Coralna is... disturbing.")
call WaitBuffer()
call TransmissionBuffer(treyvn.u, treyvn.name(), "I must think on this further. They will follow you here, or at least send their minions - but they shall not reach us until tomorrow.")
call WaitBuffer()
set ornia.hasName = true
call TransmissionBuffer(treyvn.u, treyvn.name(), "Rest here the night. Tomorrow I shall need your sword. Do not disturb me again tonight; speak to my daughter, " + ornia.name() + ", when you wish to rest.")
call WaitBuffer()
endfunction
private function who takes nothing returns nothing
call TransmissionBuffer(treyvn.u, treyvn.name(), "Alas, while I know *why* you are here, who you are evades me... who are you?")
call WaitBuffer()
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "A mercenary", "merc")
call cc.AddDecision(ANY, "A soldier", "soldier")
call cc.AddDecision(ANY, "Levied militia", "militia")
call cc.WaitForOutput(true)
if cc.OutputIndex == "merc" then
set soldierType = MERC
call treyvn.modTrust(-1)
call treyvn.modLike(-1)
call Transmission(pc.u, pc.name(), pc.name() + "; I'm a mercenary bladesman, returned to Coralna to supplement its garrison.")
call TransmissionBuffer(treyvn.u, treyvn.name(), "Fighting for money, not love of your country? Hmm...")
call WaitBuffer()
elseif cc.OutputIndex == "soldier" then
set soldierType = SOLDIER
call treyvn.modRespect(2)
call Transmission(pc.u, pc.name(), pc.name() + " - a bladesman in the Coralna garrison.")
call TransmissionBuffer(treyvn.u, treyvn.name(), "Joined up to help protect your people? Good lad.")
call WaitBuffer()
elseif cc.OutputIndex == "militia" then
set soldierType = MILITIA
call treyvn.modAnger(-2)
call Transmission(pc.u, pc.name(), pc.name() + ". I got drafted into the militia, and trained up as a bladesman.")
call TransmissionBuffer(treyvn.u, treyvn.name(), "I'm sorry you've got to go through all this; just keep focused and you'll do fine.")
call WaitBuffer()
endif
call friend()
endfunction
private function first takes nothing returns nothing
call TransmissionBuffer(treyvn.u, treyvn.name(), "Shortly after you were pulled from Coralna by the portal, the city was destroyed by powerful essence magic; I'm sorry.")
call WaitBuffer()
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "DESTROYED??", "destroy")
call cc.AddDecision(ANY, "Why am I here?", "why")
call cc.AddDecision(ANY, "Did you bring me here?", "you")
call cc.AddDecision(ANY, "Send me back", "back")
call cc.WaitForOutput(true)
if cc.OutputIndex == "destroy" then
call Transmission(pc.u, pc.name(), "The whole city - destroyed? How?")
call TransmissionBuffer(treyvn.u, treyvn.name(), "Powerful magics are at work; far beyond what your magicians could muster.")
call WaitBuffer()
elseif cc.OutputIndex == "why" then
call Transmission(pc.u, pc.name(), "So, why am I here, and what for?")
call TransmissionBuffer(treyvn.u, treyvn.name(), "You are here because you are needed here. It will become clear with time.")
call WaitBuffer()
elseif cc.OutputIndex == "you" then
call Transmission(pc.u, pc.name(), "Did you bring me here - if you did I want to know why.")
call TransmissionBuffer(treyvn.u, treyvn.name(), "You are here partly because of me, yes. As to why... that will become clear.")
call WaitBuffer()
elseif cc.OutputIndex == "back" then
call Transmission(pc.u, pc.name(), "Send me back - Coralna needs me!")
call TransmissionBuffer(treyvn.u, treyvn.name(), "Coralna does no longer needs you - there is nothing for you to return to.")
call WaitBuffer()
endif
call who()
endfunction
function Trig_Talking_to_Father_1_Actions takes nothing returns nothing
call IssueImmediateOrder( udg_PlayerUnit, "holdposition" )
call CinematicModeOn()
call ApplyCameraWait(gg_cam_Master_Bedroom_Camera, CINE_CAM_TIME)
if spokeToFather == 0 then
set spokeToFather = 1
set treyvn.hasMet = true
set treyvn.hasName = true
call treyvn.modRespect(-2*DaughterOne_innuendo -1*DaughterOne_avoidance -1*DaughterOne_silly)
call treyvn.modLike(-2*DaughterOne_innuendo -0*DaughterOne_avoidance -0*DaughterOne_silly)
call treyvn.modAnger(2*DaughterOne_innuendo -0*DaughterOne_avoidance -0*DaughterOne_silly)
if spokeToDaughter == 0 then
call Transmission(treyvn.u, treyvn.name(), "I am " + treyvn.name() + "; I know why you are here.")
call first()
elseif DaughterOne_innuendo > 1 then
call Transmission(treyvn.u, treyvn.name(), "I am " + treyvn.name() + "; I know why you are here. Chatting my daughter up is *not* that reason.")
call first()
else
call Transmission(treyvn.u, treyvn.name(), "I am " + treyvn.name() + "; I know why you are here.")
call first()
endif
else
if Ran(1./3) then
call Transmission(treyvn.u, treyvn.name(), "I told you not to distub me, boy - speak to my daughter.")
elseif Ran(1./2) then
call Transmission(treyvn.u, treyvn.name(), "Do not disturb my thoughts; my daughter can arrange for you to sleep somewhere.")
else
call Transmission(treyvn.u, treyvn.name(), "Are you a dullard? I dearly hope not. Pester " + ornia.name() + ", if you must, but not me.")
endif
endif
call WaitConclude()
call CinematicModeOff()
endfunction
//===========================================================================
function InitTrig_Talking_to_Father_1 takes nothing returns nothing
set gg_trg_Talking_to_Father_1 = AddTrigger( 12 )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Talking_to_Father_1, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Talking_to_Father_1, Condition( function talkToFatherCond ) )
call TriggerAddAction( gg_trg_Talking_to_Father_1, function Trig_Talking_to_Father_1_Actions )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Talking_to_Father_1_2_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A001' and GetSpellTargetUnit() == udg_FatherUnit
endfunction
function Trig_Talking_to_Father_1_2_Actions takes nothing returns nothing
call IssueImmediateOrder( udg_PlayerUnit, "holdposition" )
call CinematicModeOn()
call Transmission(udg_FatherUnit, udg_FatherName, "Stop bothering me, lad; begone!")
call WaitConclude()
call CinematicModeOff()
endfunction
//===========================================================================
function InitTrig_Talking_to_Father_1_2 takes nothing returns nothing
set gg_trg_Talking_to_Father_1_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Talking_to_Father_1_2 )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Talking_to_Father_1_2, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Talking_to_Father_1_2, Condition( function Trig_Talking_to_Father_1_2_Conditions ) )
call TriggerAddAction( gg_trg_Talking_to_Father_1_2, function Trig_Talking_to_Father_1_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Talking_to_Daughter_2_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A001' and GetSpellTargetUnit() == udg_DaughterUnit
endfunction
function Trig_Talking_to_Daughter_2_Actions takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
call DisableTrigger(gg_trg_Talking_to_Father_1_2)
call IssueImmediateOrder(udg_PlayerUnit, "holdposition")
call CinematicModeOn()
if udg_SpokeToDaughter == 1 then
call Transmission(udg_PlayerUnit, udg_PlayerName, "Hello again, " + udg_DaughterName + "; your father said I could stay here the night.")
else
call Transmission(udg_PlayerUnit, udg_PlayerName, "Hello " + udg_DaughterName + ", it's nice to meet you; I've just been speaking to your father.")
call TransmissionBuffer(udg_DaughterUnit, udg_DaughterName, "I'm sorry, what the hell is going on?")
call WaitBuffer()
call TransmissionBuffer(udg_PlayerUnit, udg_PlayerName, "Hehe, that's quite a story; you see, I've been hurled into your garden by a mysterious portal, and now an army of brutal demonic sorcerers is following me here...")
call WaitBuffer()
call TransmissionBuffer(udg_DaughterUnit, udg_DaughterName, "Right, well, thank you very much for that. Anything we could do for you while you're bringing death down upon us all?")
call WaitBuffer()
call TransmissionBuffer(udg_PlayerUnit, udg_PlayerName, "Well, your father said I could stay here the night...")
call WaitBuffer()
endif
call TransmissionBuffer(udg_DaughterUnit, udg_DaughterName, "Could, should, or will?")
call WaitBuffer()
call TransmissionBuffer(udg_PlayerUnit, udg_PlayerName, "I'm fairly sure it was I *can* stay, as in I *can* leave if I want to be turned into a crisp.")
call WaitBuffer()
call TransmissionBuffer(udg_DaughterUnit, udg_DaughterName, "*chuckles* Yes, he's generally like that. It would appear that he's told you my name, but I don't yet know yours.")
call WaitBuffer()
call TransmissionBuffer(udg_PlayerUnit, udg_PlayerName, "My name's " + udg_PlayerName + ", Bladesman of Coralna, the Eternal City...")
call WaitBuffer()
call TransmissionBuffer(udg_PlayerUnit, udg_PlayerName, "...an eternal city that lies in ruin.")
call WaitBuffer()
call TransmissionBuffer(udg_DaughterUnit, udg_DaughterName, "Well, I'll see what I can do for you with regards to somewhere to sleep.")
call WaitBuffer()
call TransmissionBuffer(udg_PlayerUnit, udg_PlayerName, "Okay, thanks. We should be safe until tomorrow.")
call WaitBuffer()
call WaitConclude()
call StartMusic(null)
set udg_SpokeToDaughter = 0
call TriggerExecute( gg_trg_Talking_to_Daughter_1_After )
endfunction
//===========================================================================
function InitTrig_Talking_to_Daughter_1_2 takes nothing returns nothing
set gg_trg_Talking_to_Daughter_1_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Talking_to_Daughter_1_2 )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Talking_to_Daughter_1_2, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Talking_to_Daughter_1_2, Condition( function Trig_Talking_to_Daughter_2_Conditions ) )
call TriggerAddAction( gg_trg_Talking_to_Daughter_1_2, function Trig_Talking_to_Daughter_2_Actions )
endfunction
//TESH.scrollpos=26
//TESH.alwaysfold=0
function Trig_Talking_to_Daughter_1_2_After_Actions takes nothing returns nothing
call PolledWait(1.)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 2.00, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 40.00, 40.00, 100.00, 0 )
set EscapeInterrupt = false
loop
call PolledWait( 2.50 )
exitwhen EscapeInterrupt == true
call PlaySoundBJ( gg_snd_AcolyteMining )
call SetSoundVolumeBJ( gg_snd_AcolyteMining, 35.00 )
call PolledWait( 1.50 )
exitwhen EscapeInterrupt == true
call SetSoundVolumeBJ( gg_snd_AcolyteMining, 65.00 )
call PolledWait( 1.50 )
exitwhen EscapeInterrupt == true
call SetSoundVolumeBJ( gg_snd_AcolyteMining, 75.00 )
call PolledWait( 1.50 )
exitwhen EscapeInterrupt == true
call SetSoundVolumeBJ( gg_snd_AcolyteMining, 82.00 )
call PolledWait( 1.50 )
exitwhen EscapeInterrupt == true
call SetSoundVolumeBJ( gg_snd_AcolyteMining, 85.00 )
call PolledWait( 1.50 )
exitwhen EscapeInterrupt == true
call PlaySoundBJ( gg_snd_ImHereSylvanas )
call PolledWait( 2.00 )
exitwhen EscapeInterrupt == true
call PlaySoundBJ( gg_snd_SylvanasIhavereasonsvengeance )
call PolledWait( 2.00 )
exitwhen EscapeInterrupt == true
call SetSoundVolumeBJ( gg_snd_AcolyteMining, 82.00 )
call PolledWait( 1.50 )
exitwhen EscapeInterrupt == true
call SetSoundVolumeBJ( gg_snd_AcolyteMining, 75.00 )
call PolledWait( 1.50 )
exitwhen EscapeInterrupt == true
call SetSoundVolumeBJ( gg_snd_AcolyteMining, 65.00 )
call PolledWait( 1.50 )
exitwhen EscapeInterrupt == true
call SetSoundVolumeBJ( gg_snd_AcolyteMining, 35.00 )
call PolledWait( 1.50 )
exitwhen EscapeInterrupt == true
call StopSoundBJ( gg_snd_AcolyteMining, true )
call PolledWait( 1.50 )
exitwhen true
endloop
call StopSoundBJ( gg_snd_AcolyteMining, false )
call StopSoundBJ( gg_snd_ImHereSylvanas, true )
call StopSoundBJ( gg_snd_SylvanasIhavereasonsvengeance, true )
call CinematicFilterGenericBJ( 2.00, BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 40.00, 40.00, 100.00, 0.00, 0, 0, 0, 0 )
call PolledWait( 1.00 )
call DisableTrigger(gg_trg_Talking_to_Daughter_1)
call DisableTrigger(gg_trg_Talking_to_Father_1)
call SaveCheckpointByID(2)
call CheckpointMessage(2)
call PolledWait( 3.00 )
call ConditionalTriggerExecute( gg_trg_Wake_Up )
endfunction
//===========================================================================
function InitTrig_Talking_to_Daughter_1_After takes nothing returns nothing
set gg_trg_Talking_to_Daughter_1_After = CreateTrigger( )
call TriggerAddAction( gg_trg_Talking_to_Daughter_1_After, function Trig_Talking_to_Daughter_1_2_After_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Wake_Up_Actions takes nothing returns nothing
local unit u
local integer id = 'u000'
local rect array r
local integer i = 1
set r[1] = gg_rct_Summon_1
set r[2] = gg_rct_Summon_2
set r[3] = gg_rct_Summon_3
set r[4] = gg_rct_Summon_4
set r[5] = gg_rct_Summon_5
call DisableTrigger( gg_trg_Camera )
call CameraApply(gg_cam_Wake_Up_Camera, 0.)
call SetTimeOfDay( 12.00 )
call PolledWait( 1.00 )
call SetUnitPosition( udg_PlayerUnit, GetRectCenterX(gg_rct_Wake_Up_1), GetRectCenterY(gg_rct_Wake_Up_1))
call IssuePointOrder( udg_PlayerUnit, "move", GetRectCenterX(gg_rct_Wake_Up_1_To), GetRectCenterY(gg_rct_Wake_Up_1_To))
//call CinematicFilterGenericBJ( 2.00, BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0,0.00, 0.00, 0, 0, 0, 0, 100. )
call FadeIn(2.)
call TransmissionAndBuffer(pc.u, pc.name(), "*yawn* Remind me never to sleep on *that* stuff again...")
call PolledWait(5.)
call IssueImmediateOrder(udg_PlayerUnit, "holdposition")
loop
set u = CreateUnit(Player(11), id, GetRectCenterX(r[i]), GetRectCenterY(r[i]), GetRandomReal(0., 360.))
call IssueTargetOrder(u, "attack", udg_PlayerUnit)
call DestroyEffect( AddSpecialEffectTarget("Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl", u, "origin") )
call SetUnitTimeScalePercent(u, 50. )
set i = i + 1
exitwhen i > 5
endloop
call PlaySoundBJ( gg_snd_DarkRitualTarget1 )
call StartMusic(FIGHT_MUSIC)
call TransmissionAndBuffer(pc.u, pc.name(), "...new day, new worries.")
call PolledWait(4.)
call TransmissionClearBuffer()
call CinematicModeOff()
call EnableTrigger( gg_trg_Camera )
call CameraOutside()
call ornia.setAnger(ornia.getAnger() / 10 )
set spokeToDaughter = 0
set spokeToFather = 0
call EnableTrigger(gg_trg_Ghouls_Die)
endfunction
//===========================================================================
function InitTrig_Wake_Up takes nothing returns nothing
set gg_trg_Wake_Up = CreateTrigger( )
call TriggerAddAction( gg_trg_Wake_Up, function Trig_Wake_Up_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Ghouls_Die_Conditions takes nothing returns boolean
return CountLivingPlayerUnitsOfTypeId('u000', Player(11)) == 0
endfunction
function Trig_Ghouls_Die_Actions takes nothing returns nothing
call DisableTrigger(GetTriggeringTrigger())
call CinematicModeOn()
call IssueImmediateOrder(udg_PlayerUnit, "holdposition")
call Transmission(pc.u, pc.name(), "There'll be more; I'd better go talk to " + treyvn.name() + ".")
call WaitConclude()
call CinematicModeOff()
call StartMusic(NORMAL_MUSIC)
set gameStage = 20
call EnableTrigger(gg_trg_Talking_to_Father_2)
call EnableTrigger(gg_trg_Talking_to_Daughter_2)
endfunction
//===========================================================================
function InitTrig_Ghouls_Die takes nothing returns nothing
set gg_trg_Ghouls_Die = AddTrigger(16)
call DisableTrigger(gg_trg_Ghouls_Die)
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Ghouls_Die, Player(11), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Ghouls_Die, Condition( function Trig_Ghouls_Die_Conditions ) )
call TriggerAddAction( gg_trg_Ghouls_Die, function Trig_Ghouls_Die_Actions )
endfunction
//TESH.scrollpos=36
//TESH.alwaysfold=0
scope DaughterTwo
private function blood takes nothing returns nothing
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "Don't worry", "noworry")
call cc.AddDecision(ANY, "Sorry, I forgot", "forgot")
call cc.AddDecision(ANY, "Ghouls!", "ghouls") // links back to below - sneaky!
call cc.WaitForOutput(true)
if cc.OutputIndex == "noworry" then
call Transmission(pc.u, pc.name(), "Don't worry about that, just some ghoul blood.")
call TransmissionBuffer(ornia.u, ornia.name(), "They just teleported in - they're attacking, aren't they?")
call WaitBuffer()
call ornia.modRespect(-1)
elseif cc.OutputIndex == "forgot" then
call Transmission(pc.u, pc.name(), "Oh yea, sorry... did I forget to mention we're under attack by undead creatures?")
call TransmissionBuffer(ornia.u, ornia.name(), "Strangely enough, yes, you did forgot; something *else* seemed to be on your mind.")
call WaitBuffer()
endif
endfunction
private function first takes nothing returns nothing
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "Good morning", "morning")
call cc.AddDecision(ANY, "Ghouls!", "ghouls")
call cc.WaitForOutput(true)
if cc.OutputIndex == "morning" then
call Transmission(pc.u, pc.name(), "Good morning, " + ornia.name() + ".")
call TransmissionBuffer(ornia.u, ornia.name(), "*smiles* Good morning.")
call WaitBuffer()
call TransmissionBuffer(ornia.u, ornia.name(), "*gasps* Is that blood on your sword?!?")
call WaitBuffer()
call ornia.modRespect(-0.5)
call ornia.modTrust(-0.5)
call blood()
endif
if cc.OutputIndex == "ghouls" then
call Transmission(pc.u, pc.name(), "Ghouls just teleported in and attacked me.")
endif
call TransmissionBuffer(ornia.u, ornia.name(), "Those creatures would have been only the vanguard - go speak to " + treyvn.name() + ".")
call WaitBuffer()
// ends
endfunction
function Trig_Talking_to_Daughter_2_Actions takes nothing returns nothing
call IssueImmediateOrder(pc.u, "holdposition")
call CinematicModeOn()
call ApplyCameraWait(gg_cam_Small_Bedroom_Camera, CINE_CAM_TIME)
if spokeToFather == 0 then
if spokeToDaughter == 0 then
call ornia.talkToBonus()
set spokeToDaughter = 1
call first()
else
if Ran(1./3) then
call Transmission(ornia.u, ornia.name(), "We don't have much time - you must speak with my father.")
elseif Ran(1./2) then
call Transmission(ornia.u, ornia.name(), "Don't worry, my father will know what to do.")
else
call Transmission(ornia.u, ornia.name(), "Stop dallying, and go talk to him!")
endif
endif
else
if Ran(1./3) then
call Transmission(ornia.u, ornia.name(), "Good luck out there!")
elseif Ran(1./2) then
call Transmission(ornia.u, ornia.name(), "Stay safe!")
else
call Transmission(ornia.u, ornia.name(), "Take care, and fight well!")
endif
endif
call WaitConclude()
call CinematicModeOff()
endfunction
//===========================================================================
function InitTrig_Talking_to_Daughter_2 takes nothing returns nothing
set gg_trg_Talking_to_Daughter_2 = AddTrigger( 21 )
call DisableTrigger(gg_trg_Talking_to_Daughter_2)
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Talking_to_Daughter_2, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Talking_to_Daughter_2, Condition( function talkToDaughterCond ) )
call TriggerAddAction( gg_trg_Talking_to_Daughter_2, function Trig_Talking_to_Daughter_2_Actions )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope FatherTwo
private function dallying takes nothing returns nothing
call TransmissionAndBuffer(treyvn.u, treyvn.name(), "If you have finishing dallying with my daughter...?")
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "Checking on her", "checking")
call cc.AddDecision(ANY, "Sorry", "sorry")
call cc.AddDecision(ANY, "But she's cute...", "cute")
call cc.WaitForOutput(true)
if cc.OutputIndex == "checking" then
call Transmission(pc.u, pc.name(), "I was checking on her, making sure she was okay.")
call TransmissionBuffer(treyvn.u, treyvn.name(), "And why wouldn't she be?")
call WaitBuffer()
call TransmissionBuffer(treyvn.u, treyvn.name(), "Does it not occur to you that I, a powerful mage, might not allow my daughter to be killed in the room next to me?")
call WaitBuffer()
call treyvn.modLike(1)
elseif cc.OutputIndex == "sorry" then
call Transmission(pc.u, pc.name(), "Sorry, I...")
call TransmissionBuffer(treyvn.u, treyvn.name(), "Your excuses do not concern me - we have a job to do, but while I draw breath, my daughter shall be kept safe.")
call WaitBuffer()
elseif cc.OutputIndex == "cute" then
call Transmission(pc.u, pc.name(), "But she's so cute! I had to go look in on her.")
call TransmissionBuffer(treyvn.u, treyvn.name(), "*sigh* I hope you are better with your sword than you are with social conventions.")
call WaitBuffer()
call treyvn.modRespect(-3)
call treyvn.modLike(-2)
endif
call TransmissionBuffer(treyvn.u, treyvn.name(), "Bah, enough of this; it is irrelevant to the matters of grave importance before us.")
call WaitBuffer()
endfunction
private function first takes nothing returns nothing
if spokeToDaughter == 1 then
call dallying()
call TransmissionBuffer(treyvn.u, treyvn.name(), "You were attacked by five undead in the garden; these are lesser minions, a scout force..")
call WaitBuffer()
else
call TransmissionAndBuffer(treyvn.u, treyvn.name(), "You come running; you were attacked by five undead in the garden - lesser minions, a mere scout force.")
endif
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "I'll fight to the death", "death")
call cc.AddDecision(ANY, "What do you suggest?", "suggest")
call cc.WaitForOutput(true)
if cc.OutputIndex == "death" then
call Transmission(pc.u, pc.name(), "I'll fight to the death; they'll pay for what they've done.")
call TransmissionBuffer(treyvn.u, treyvn.name(), "Your corpse will achieve nothing; you as a fighting fit warrior will be in a much better position to take vengeance.")
call WaitBuffer()
call treyvn.modLike(1)
elseif cc.OutputIndex == "suggest" then
call Transmission(pc.u, pc.name(), "What do you suggest?")
call treyvn.modRespect(1)
endif
call TransmissionBuffer(treyvn.u, treyvn.name(), "I have a plan; it will takes us... away from here - to safety.")
call WaitBuffer()
call TransmissionBuffer(treyvn.u, treyvn.name(), "I'll create a field across the door once you leave. The more it is attacked, the more I'll have to draw energy away from our escape route, and the longer you'll have to hold them off.")
call WaitBuffer()
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "Do you care if I die?", "die")
call cc.AddDecision(ANY, "Okay", "okay")
call cc.WaitForOutput(true)
if cc.OutputIndex == "die" then
call Transmission(pc.u, pc.name(), "Out of interest, do you actually care what happens to me at all?")
call TransmissionBuffer(treyvn.u, treyvn.name(), "No, not really. But don't worry - I won't leave you behind. I could do with a swordsman beside me, you know.")
call WaitBuffer()
elseif cc.OutputIndex == "okay" then
call Transmission(pc.u, pc.name(), "Okay, sounds good.")
endif
call TransmissionBuffer(treyvn.u, treyvn.name(), "It is settled. Now get out there and show them what you are made of!")
call WaitBuffer()
// ends
endfunction
function Trig_Talking_to_Father_2_Actions takes nothing returns nothing
call IssueImmediateOrder( udg_PlayerUnit, "holdposition" )
call CinematicModeOn()
call ApplyCameraWait(gg_cam_Master_Bedroom_Camera, CINE_CAM_TIME)
if spokeToFather == 0 then
set spokeToFather = 1
call first()
else
if Ran(1./3) then
call Transmission(treyvn.u, treyvn.name(), "Get out there and fight them, lad!")
elseif Ran(1./2) then
call Transmission(treyvn.u, treyvn.name(), "Look, it's quite simple - just go outside, I raise a shield, and then you protect the house.")
else
call Transmission(treyvn.u, treyvn.name(), "I told you to get out there and hold them off!")
endif
endif
call WaitConclude()
call CinematicModeOff()
call EnableTrigger(gg_trg_Leave)
endfunction
//===========================================================================
function InitTrig_Talking_to_Father_2 takes nothing returns nothing
set gg_trg_Talking_to_Father_2 = AddTrigger(22)
call DisableTrigger(gg_trg_Talking_to_Father_2)
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Talking_to_Father_2, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Talking_to_Father_2, Condition( function talkToFatherCond ) )
call TriggerAddAction( gg_trg_Talking_to_Father_2, function Trig_Talking_to_Father_2_Actions )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Talking_to_Daughter_2_1a_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A001' and GetSpellTargetUnit() == udg_DaughterUnit
endfunction
function Trig_Talking_to_Daughter_2_1a_Actions takes nothing returns nothing
call IssueImmediateOrder(udg_PlayerUnit, "holdposition")
call CinematicModeOn()
if udg_SpokeToDaughter == 1 then
call Transmission(udg_PlayerUnit, udg_PlayerName, "Don't worry; I'll protect you.")
call TransmissionBuffer(udg_DaughterUnit, udg_DaughterName, "Look after yourself...please?")
call WaitBuffer()
elseif udg_SpokeToDaughter == 0 then
call Transmission(udg_PlayerUnit, udg_PlayerName, "Good morning, " + udg_DaughterName + "; we're under attack; stay in here and take care of yourself.")
call TransmissionBuffer(udg_DaughterUnit, udg_DaughterName, "Okay, " + udg_PlayerName + ". Good luck!")
call WaitBuffer()
set udg_SpokeToDaughter = 1
endif
call WaitConclude()
call CinematicModeOff()
endfunction
//===========================================================================
function InitTrig_Talking_to_Daughter_2_1a takes nothing returns nothing
set gg_trg_Talking_to_Daughter_2_1a = CreateTrigger( )
call DisableTrigger(gg_trg_Talking_to_Daughter_2_1a)
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Talking_to_Daughter_2_1a, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Talking_to_Daughter_2_1a, Condition( function Trig_Talking_to_Daughter_2_1a_Conditions ) )
call TriggerAddAction( gg_trg_Talking_to_Daughter_2_1a, function Trig_Talking_to_Daughter_2_1a_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Talking_to_Father_2_1a_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A001' and GetSpellTargetUnit() == udg_FatherUnit
endfunction
function Trig_Talking_to_Father_2_1a_Actions takes nothing returns nothing
call IssueImmediateOrder( udg_PlayerUnit, "holdposition" )
call CinematicModeOn()
call Transmission(udg_FatherUnit, udg_FatherName, "Look, it's quite simple - just go outside, I raise a shield, and then you protect the house.")
call TransmissionBuffer(udg_PlayerUnit, udg_PlayerName, "Okay, you're the boss.")
call WaitBuffer()
call WaitConclude()
call CinematicModeOff()
endfunction
//===========================================================================
function InitTrig_Talking_to_Father_2_1a takes nothing returns nothing
set gg_trg_Talking_to_Father_2_1a = CreateTrigger( )
call DisableTrigger(gg_trg_Talking_to_Father_2_1a)
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Talking_to_Father_2_1a, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Talking_to_Father_2_1a, Condition( function Trig_Talking_to_Father_2_1a_Conditions ) )
call TriggerAddAction( gg_trg_Talking_to_Father_2_1a, function Trig_Talking_to_Father_2_1a_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Leave_Conditions takes nothing returns boolean
return GetTriggerUnit() == udg_PlayerUnit
endfunction
globals
trigger ShieldTakesDamage
timer TimeTillPortal
endglobals
function ShieldTakesDamage_Action takes nothing returns nothing
call TimerStart(TimeTillPortal, RMaxBJ(TimerGetRemaining(TimeTillPortal) + GetEventDamage()/5., 60), false, null)
endfunction
function Trig_Leave_Actions takes nothing returns nothing
local unit u = pc.u
local unit uloop
local unit u1
local unit u2
local unit u3
local real tBase = 45
local real tOffset = 30
local real t
local unit playerUnit = pc.u
local group g = CreateGroup()
call DisableTrigger(GetTriggeringTrigger())
call DisableTrigger(gg_trg_Talking_to_Daughter_2)
call DisableTrigger(gg_trg_Talking_to_Father_2)
if not(udg_Loading) then
call CinematicModeOn()
endif
call StartMusic(FIGHT_MUSIC)
call IssuePointOrder(u, "move", GetUnitX(u), GetUnitY(u) - 200.)
call CameraOutside()
call PolledWait(1.)
call Transmission(pc.u, pc.name(), "Well, I guess this is it.")
set u = CreateUnit(Player(1), 'h002', 25., 80., 0.)
call TriggerRegisterUnitEvent(ShieldTakesDamage, u, EVENT_UNIT_DAMAGED)
set u1 = CreateUnit(Player(1), 'h001', 25., 80., 90.)
call SetUnitFlyHeight(u1, 60., 35.)
call TriggerSleepAction(0.)
set u2 = CreateUnit(Player(1), 'h001', 25., 80., 90.)
call SetUnitFlyHeight(u2, 30., 35.)
call TriggerSleepAction(0.)
set u3 = CreateUnit(Player(1), 'h001', 25., 80., 90.)
call TransmissionBuffer(pc.u, pc.name(), "COME ON YOU BASTARDS!")
call WaitBuffer()
call WaitConclude()
call CinematicModeOff()
call EnableTrigger(gg_trg_Camera)
if udg_Loading then
set udg_Loading = false
else
call SaveCheckpointByID(3)
call CheckpointMessage(3)
endif
call TimerStart(TimeTillPortal, tBase, false, null)
loop
if GetWidgetLife(playerUnit) <= 0.405 then
call RemoveUnit(u1)
call RemoveUnit(u2)
call RemoveUnit(u3)
return
endif
set uloop = CreateUnit(Player(11), 'u000', GetRandomReal(-900., 900.), GetRandomReal(-1300., -300.), GetRandomReal(0., 360.))
call IssuePointOrder(uloop, "attack", 0., 300.)
call DestroyEffect( AddSpecialEffectTarget("Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl", uloop, "overhead") )
call GroupAddUnit(g, uloop)
call SetUnitTimeScalePercent(uloop, 50. )
set t = TimerGetRemaining(TimeTillPortal) + tOffset
exitwhen t <= tOffset
call PolledWait(GetRandomReal(t/tBase * 2, t/tBase * 5))
endloop
call CinematicModeOn()
call PauseAllUnitsBJ(true)
call CinematicFilterGenericBJ( 0.5, BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0., 0., 0., 100., 100., 100., 100., 0. )
call PolledWait(1.)
call RemoveUnit(u)
call RemoveUnit(u1)
call RemoveUnit(u2)
call RemoveUnit(u3)
call ForGroup(g, function RemoveUnitEx)
call CinematicFilterGenericBJ( 3, BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 100., 100., 100., 0., 100., 100., 100., 100. )
call PolledWait(3.)
call FadeIn(0.)
call PauseAllUnitsBJ(false)
call TriggerExecute(gg_trg_After_Teleport)
endfunction
//===========================================================================
function InitTrig_Leave takes nothing returns nothing
set gg_trg_Leave = AddTrigger( 24 )
call DisableTrigger( gg_trg_Leave )
call TriggerRegisterLeaveRectSimple( gg_trg_Leave, gg_rct_House )
call TriggerAddCondition( gg_trg_Leave, Condition( function Trig_Leave_Conditions ) )
call TriggerAddAction( gg_trg_Leave, function Trig_Leave_Actions )
set ShieldTakesDamage = CreateTrigger()
call TriggerAddAction(ShieldTakesDamage, function ShieldTakesDamage_Action)
set TimeTillPortal = NewTimer()
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_After_Teleport_Actions takes nothing returns nothing
call StartMusic(NORMAL_MUSIC)
call IssueImmediateOrder(pc.u, "holdposition")
call Transmission(pc.u, pc.name(), "What the hell...?")
call TransmissionBuffer(pc.u, pc.name(), "We haven't gone anywhere... and yet they're gone?")
call WaitBuffer()
call TransmissionBuffer(pc.u, pc.name(), "I better find out what's going on from " + treyvn.name() + ".")
call WaitBuffer()
call WaitConclude()
call CinematicModeOff()
set gameStage = 30
if udg_Loading then
set udg_Loading = false
else
call SaveCheckpointByID(5)
call CheckpointMessage(5)
endif
set spokeToDaughter = 0
set spokeToFather = 0
call EnableTrigger(gg_trg_Talking_to_Father_3)
call EnableTrigger(gg_trg_Talking_to_Daughter_3)
endfunction
//===========================================================================
function InitTrig_After_Teleport takes nothing returns nothing
set gg_trg_After_Teleport = CreateTrigger( )
call TriggerAddAction( gg_trg_After_Teleport, function Trig_After_Teleport_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope DaughterThree
globals
boolean daughterDone = false // the name is outdated from an earlier version, with a parody of the retardation of The Witcher (give girl flower, she beds you)
endglobals
public function flowers takes nothing returns boolean // ALSO refered to in DaughterFour
call Transmission(pc.u, pc.name(), "Hey, I brought you some flowers - I hope you like them.")
call RemoveItem(prettyFlower)
if ornia.getMood() > 3 then
call TransmissionBuffer(ornia.u, ornia.name(), "Ahhh, thank you - how sweet of you.")
call WaitBuffer()
call ornia.modLove(1)
call ornia.modLike(1)
call DaughterOrnia_initRomance()
else
call TransmissionBuffer(ornia.u, ornia.name(), "Erm... thanks... I guess...")
call WaitBuffer()
return false
endif
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "I thought you'd like it", "like")
call cc.AddDecision(ANY, "It reminded me of your beauty", "beauty")
call cc.AddDecision(ANY, "Will you bed me now?", "bed")
call cc.WaitForOutput(true)
if cc.OutputIndex == "like" then
call Transmission(pc.u, pc.name(), "I thought you'd like it.")
call TransmissionBuffer(ornia.u, ornia.name(), "And I do! *smiles* Thank you very much for them.")
call WaitBuffer()
call ornia.modLike(0.5)
call ornia.modLove(0.25)
elseif cc.OutputIndex == "beauty" then
call Transmission(pc.u, pc.name(), "It reminded me of your beauty.")
call TransmissionBuffer(ornia.u, ornia.name(), "Thank you. *giggles* If I ever come across a tin bucket, I'll give it you.")
call WaitBuffer()
call TransmissionBuffer(pc.u, pc.name(), "Ma'am, you do me a great injustice - only the finest steel for my helmet!")
call WaitBuffer()
call ornia.modLike(0.25)
call ornia.modLove(0.5)
elseif cc.OutputIndex == "bed" then
call Transmission(pc.u, pc.name(), "Will you bed me now?")
call TransmissionBuffer(ornia.u, ornia.name(), "What *do* you think you are - a Witcher or something?")
call WaitBuffer()
endif
return true
endfunction
private function sleepQuestion takes nothing returns nothing
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
if UnitHasItem(pc.u, prettyFlower) then
call cc.AddDecision(ANY, "I brought you some flowers", "flowers")
endif
if DaughterTree_sayMore() then
call cc.AddDecision(ANY, "Talk a little", "talk")
endif
call cc.AddDecision(ANY, "Just go to sleep", "sleep")
call cc.AddDecision(ANY, "Sleep later", "later")
call cc.WaitForOutput(true)
if cc.OutputIndex == "flowers" then
if flowers() then
call TransmissionBuffer(ornia.u, ornia.name(), "Anyway, you must be tired - ready to to sleep?")
call WaitBuffer()
else
call TransmissionBuffer(ornia.u, ornia.name(), "*forces a smile* Well... you ready to go to sleep?")
call WaitBuffer()
endif
call sleepQuestion()
elseif cc.OutputIndex == "talk" then
call DaughterTree_sayRequest()
call TransmissionAndBuffer(ornia.u, ornia.name(), "Ready for sleep yet?")
call sleepQuestion()
elseif cc.OutputIndex == "sleep" then
call Transmission(pc.u, pc.name(), "Yea, I'm ready to rest now; any chance of something better than outside?")
if ornia.romanceState == 0 or ornia.getMood() < 6. then
call TransmissionBuffer(ornia.u, ornia.name(), "'fraid not; you'll just have to put up with it. We don't have vistors often, you know.")
call WaitBuffer()
call TransmissionBuffer(pc.u, pc.name(), "Yea, I can tell; ahh well, don't worry about it. Good night.")
call WaitBuffer()
else
set daughterDone = true
call TransmissionBuffer(ornia.u, ornia.name(), "For you? I'm sure I can find room somewhere inside. *smiles*")
call WaitBuffer()
call ornia.modTrust(2)
call ornia.modLove(2)
endif
call WaitConclude()
call StartMusic(null)
call FadeOut(2.)
call PolledWait(2.5)
call StartSound(gg_snd_DuskWolf)
call PolledWait(5.)
call StartSound(gg_snd_DaybreakRooster)
call DisableTrigger(gg_trg_Talking_to_Daughter_3)
call DisableTrigger(gg_trg_Talking_to_Father_3)
//call RemoveItem(udg_Flower)
call PolledWait(0.5)
call SaveCheckpointByID(6)
call CheckpointMessage(6)
call PolledWait(2.)
call TriggerExecute(gg_trg_Next_Morning)
elseif cc.OutputIndex == "later" then
call Transmission(pc.u, pc.name(), "I'm fine for now; I'll wait up a bit longer.")
call WaitConclude()
call CinematicModeOff()
endif
endfunction
private function first takes nothing returns nothing
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "Are you okay?", "okay")
call cc.AddDecision(ANY, "What happened?", "what")
call cc.WaitForOutput(true)
if cc.OutputIndex == "okay" then
call Transmission(pc.u, pc.name(), "Are you okay, " + ornia.name() + "?")
call TransmissionBuffer(ornia.u, ornia.name(), "Yes, I'm fine, thank you. *smiles*")
call WaitBuffer()
call TransmissionBuffer(pc.u, pc.name(), "That's good to hear - Any idea what happened? We don't seem to have gone anywhere...?")
call WaitBuffer()
call ornia.modLike(2)
call ornia.modRespect(0.5)
elseif cc.OutputIndex == "what" then
call Transmission(pc.u, pc.name(), "What happened? We haven't gone anywhere!")
endif
call TransmissionBuffer(ornia.u, ornia.name(), "I know what happened, but... well, father's so much better at explaining it than me.")
call WaitBuffer()
call TransmissionBuffer(pc.u, pc.name(), "Alright, I'll go ask him then.")
call WaitBuffer()
// end
endfunction
globals
private integer sinceLast = 1
endglobals
function Trig_Talking_to_Daughter_3_Actions takes nothing returns nothing
call IssueImmediateOrder(pc.u, "holdposition")
call CinematicModeOn()
call ApplyCameraWait(gg_cam_Small_Bedroom_Camera, CINE_CAM_TIME)
if spokeToFather == 0 then
if spokeToDaughter == 0 then
call ornia.talkToBonus()
set spokeToDaughter = 1
call first()
else
set sinceLast = IMaxBJ(sinceLast - 1, 1)
if ornia.getLike() > 4 and Ran(1./sinceLast) then
set sinceLast = 6
call Transmission(ornia.u, ornia.name(), "I like having you around and everything, but Father'll be waiting.")
elseif Ran(1./3) then
call Transmission(ornia.u, ornia.name(), "Father can explain; you should go talk to him.")
elseif Ran(1./2) then
call Transmission(ornia.u, ornia.name(), treyvn.name() + " will be waiting for you.")
else
call Transmission(ornia.u, ornia.name(), "What are you waiting for? Father will want to talk to you anyway.")
endif
endif
call WaitConclude()
call CinematicModeOff()
elseif spokeToDaughter != 11 then
set spokeToDaughter = 11
call TransmissionAndBuffer(ornia.u, ornia.name(), "I'm guessing he sent you here for me to deal with 'the mundane stuff', as normal?")
call sleepQuestion()
else
call TransmissionAndBuffer(ornia.u, ornia.name(), "Back again, huh? Ready for sleep yet?")
call sleepQuestion()
endif
endfunction
//===========================================================================
function InitTrig_Talking_to_Daughter_3 takes nothing returns nothing
set gg_trg_Talking_to_Daughter_3 = AddTrigger( 31 )
call DisableTrigger(gg_trg_Talking_to_Daughter_3)
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Talking_to_Daughter_3, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Talking_to_Daughter_3, Condition( function talkToDaughterCond ) )
call TriggerAddAction( gg_trg_Talking_to_Daughter_3, function Trig_Talking_to_Daughter_3_Actions )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope FatherThree
private function first takes nothing returns nothing
call TransmissionAndBuffer(treyvn.u, treyvn.name(), "Ah, there you are - don't worry, we'll be perfectly safe here.")
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "Where is here?", "here")
call cc.AddDecision(ANY, "You sure?", "sure")
call cc.WaitForOutput(true)
if cc.OutputIndex == "here" then
call Transmission(pc.u, pc.name(), "Speaking of here... where is here?")
call TransmissionBuffer(treyvn.u, treyvn.name(), "Why, it's my house. You stayed here the night, remember?")
call WaitBuffer()
call TransmissionBuffer(pc.u, pc.name(), "Yes but... how come we're now safe here then, if it's the same place?")
call WaitBuffer()
call TransmissionBuffer(treyvn.u, treyvn.name(), "I have disjointed us from the rest of the world; we now exist in a seperate thread of existance.")
call WaitBuffer()
elseif cc.OutputIndex == "sure" then
call Transmission(pc.u, pc.name(), "Are you sure of that?")
call TransmissionBuffer(treyvn.u, treyvn.name(), "Of course - I have shifted us into a seperate thread of existance.")
call WaitBuffer()
endif
call TransmissionBuffer(treyvn.u, treyvn.name(), "Were our foes more talented in essence magic than me, they'd be able to undo it, but for now, we're safe.")
call WaitBuffer()
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "What's the plan?", "plan")
call cc.AddDecision(ANY, "What is 'essence magic'?", "magic")
call cc.WaitForOutput(true)
if cc.OutputIndex == "plan" then
call Transmission(pc.u, pc.name(), "So what's the plan now?")
call TransmissionBuffer(treyvn.u, treyvn.name(), "Straight down to business? Good - I like that.")
call WaitBuffer()
call treyvn.modLike(1)
elseif cc.OutputIndex == "magic" then
call Transmission(pc.u, pc.name(), "What is this 'essence magic' anyway?")
call TransmissionBuffer(treyvn.u, treyvn.name(), "I admire your inquisitiveness, but your understanding is not needed, and there is little time... so little...")
call WaitBuffer()
call treyvn.modRespect(1)
endif
call TransmissionBuffer(treyvn.u, treyvn.name(), "My plan is to send you out in the world to obtain certain items, before getting you to hunt down and kill the Twelve Souls.")
call WaitBuffer()
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "So I take all the risk?", "risk")
call cc.AddDecision(ANY, "What if I die?", "die")
call cc.WaitForOutput(true)
if cc.OutputIndex == "risk" then
call Transmission(pc.u, pc.name(), "So I take all the risk, and you sit here nice and safe...?")
call TransmissionBuffer(treyvn.u, treyvn.name(), "Exactly.")
call WaitBuffer()
call TransmissionBuffer(treyvn.u, treyvn.name(), "Now - don't look at me like that. I have my daughter's safety to consider.")
call WaitBuffer()
elseif cc.OutputIndex == "die" then
call Transmission(pc.u, pc.name(), "And if I die...?")
call TransmissionBuffer(treyvn.u, treyvn.name(), "Then I rejoin this thread to that of the rest of our world, but with a different time frame.")
call WaitBuffer()
call TransmissionBuffer(treyvn.u, treyvn.name(), "A few hundred years should do it. That way, we'll return and they'll have long passed away.")
call WaitBuffer()
endif
call TransmissionBuffer(treyvn.u, treyvn.name(), "Run along and rest, now. Tomorrow I'll send you out into the world to take your revenge.")
call WaitBuffer()
call TransmissionBuffer(pc.u, pc.name(), "Sleeping outside wasn't all that nice last time, you know.")
call WaitBuffer()
call TransmissionBuffer(treyvn.u, treyvn.name(), "See if " + ornia.name() + " can do anything about it; I have to focus on sorting out these essence threads.")
call WaitBuffer()
// ends
endfunction
function Trig_Talking_to_Father_3_Actions takes nothing returns nothing
call IssueImmediateOrder( udg_PlayerUnit, "holdposition" )
call CinematicModeOn()
call ApplyCameraWait(gg_cam_Master_Bedroom_Camera, CINE_CAM_TIME)
if spokeToFather == 0 then
set spokeToFather = 1
call first()
call WaitConclude()
call CinematicModeOff()
call UnitAddAbility(udg_PlayerUnit, 'AInv')
call DisplayText("You've gained the ability to pick up certain objects. Congratulations.")
call PlaySoundBJ( gg_snd_Hint )
else
if Ran(1./3) then
call Transmission(treyvn.u, treyvn.name(), "My daughter can deal with the mundane issues of where you are sleeping.")
elseif Ran(1./2) then
call Transmission(treyvn.u, treyvn.name(), "Begone, boy! I told you already to speak to " + ornia.name() + " about such mundane matters!")
else
call Transmission(treyvn.u, treyvn.name(), "One slight mistake and we all die; quite disturbing me!")
endif
call WaitConclude()
call CinematicModeOff()
endif
endfunction
//===========================================================================
function InitTrig_Talking_to_Father_3 takes nothing returns nothing
set gg_trg_Talking_to_Father_3 = AddTrigger( 32 )
call DisableTrigger(gg_trg_Talking_to_Father_3)
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Talking_to_Father_3, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Talking_to_Father_3, Condition( function talkToFatherCond ) )
call TriggerAddAction( gg_trg_Talking_to_Father_3, function Trig_Talking_to_Father_3_Actions )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Talking_to_Daughter_3_2_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A001' and GetSpellTargetUnit() == udg_DaughterUnit
endfunction
function Trig_Talking_to_Daughter_3_2_Actions takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
call DisableTrigger(gg_trg_Talking_to_Father_3_2)
call IssueImmediateOrder(udg_PlayerUnit, "holdposition")
call CinematicModeOn()
if UnitHasItem(udg_PlayerUnit, udg_Flower) then
set udg_DaughterDone = true
call Transmission(udg_DaughterUnit, udg_DaughterName, "Flowers? For me? You're so sweet.")
call TransmissionBuffer(udg_PlayerUnit, udg_PlayerName, "All in a day's work, m'lady.")
call WaitBuffer()
call TransmissionBuffer(udg_DaughterUnit, udg_DaughterName, "You're my real life knight in shining armour, aren't you?")
call WaitBuffer()
call TransmissionBuffer(udg_PlayerUnit, udg_PlayerName, "Well, my captain was always shouting at me about keeping my armour clean...")
call WaitBuffer()
call TransmissionBuffer(udg_DaughterUnit, udg_DaughterName, "*laughs* And modest too. I'm guessing you're after somewhere to sleep?")
call WaitBuffer()
call TransmissionBuffer(udg_PlayerUnit, udg_PlayerName, "That's right, and preferably something more confortable than outside...")
call WaitBuffer()
call TransmissionBuffer(udg_DaughterUnit, udg_DaughterName, "I'm sure I can find room for you.")
call WaitBuffer()
call WaitConclude()
call StartMusic(null)
call FadeOut(2.)
call PolledWait(2.5)
call StartSound(gg_snd_DuskWolf)
call PolledWait(5.)
call StartSound(gg_snd_DaybreakRooster)
else
call Transmission(udg_DaughterUnit, udg_DaughterName, "I'm guessing he sent you here for me to deal with 'the mundane stuff'?")
call TransmissionBuffer(udg_PlayerUnit, udg_PlayerName, "Yea, that's right; any chance of something better than outside?")
call WaitBuffer()
call TransmissionBuffer(udg_DaughterUnit, udg_DaughterName, "'fraid not; you'll just have to put up with it. We don't have vistors often, you know.")
call WaitBuffer()
call TransmissionBuffer(udg_PlayerUnit, udg_PlayerName, "Yea, I can tell; ahh well, don't worry about it. Good night.")
call WaitBuffer()
call WaitConclude()
call StartMusic(null)
call FadeOut(2.)
call PolledWait(2.5)
call StartSound(gg_snd_DuskWolf)
call PolledWait(5.)
call StartSound(gg_snd_DaybreakRooster)
endif
call RemoveItem(udg_Flower)
call PolledWait(1.)
call SaveCheckpointByID(6)
call CheckpointMessage(6)
call PolledWait(2.)
call TriggerExecute(gg_trg_Next_Morning)
endfunction
//===========================================================================
function InitTrig_Talking_to_Daughter_3_2 takes nothing returns nothing
set gg_trg_Talking_to_Daughter_3_2 = CreateTrigger( )
call DisableTrigger(gg_trg_Talking_to_Daughter_3_2)
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Talking_to_Daughter_3_2, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Talking_to_Daughter_3_2, Condition( function Trig_Talking_to_Daughter_3_2_Conditions ) )
call TriggerAddAction( gg_trg_Talking_to_Daughter_3_2, function Trig_Talking_to_Daughter_3_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Talking_to_Father_3_2_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A001' and GetSpellTargetUnit() == udg_FatherUnit
endfunction
function Trig_Talking_to_Father_3_2_Actions takes nothing returns nothing
call IssueImmediateOrder( udg_PlayerUnit, "holdposition" )
call CinematicModeOn()
call Transmission(udg_FatherUnit, udg_FatherName, "Begone, boy! I told you already to speak to " + udg_DaughterName + " about such mundane matters!")
call WaitConclude()
call CinematicModeOff()
endfunction
//===========================================================================
function InitTrig_Talking_to_Father_3_2 takes nothing returns nothing
set gg_trg_Talking_to_Father_3_2 = CreateTrigger( )
call DisableTrigger(gg_trg_Talking_to_Father_3_2)
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Talking_to_Father_3_2, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Talking_to_Father_3_2, Condition( function Trig_Talking_to_Father_3_2_Conditions ) )
call TriggerAddAction( gg_trg_Talking_to_Father_3_2, function Trig_Talking_to_Father_3_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Next_Morning_Actions takes nothing returns nothing
call StartMusic(NORMAL_MUSIC)
call DisableTrigger(gg_trg_Camera)
if daughterDone then
call SetUnitPosition(pc.u, 230., 600.)
call CameraApply(gg_cam_Morning_After, 0.)
call FadeIn(2.)
call PolledWait(1.)
call IssuePointOrder(pc.u, "move", 125., 375.)
call PolledWait(2.)
call Transmission(pc.u, pc.name(), "Ahh, a new morning; life is sweet.")
call TransmissionBuffer(pc.u, pc.name(), "Better see what it is that " + treyvn.name() + " has planned.")
call WaitBuffer()
call WaitConclude()
else
call CameraApply(gg_cam_Wake_Up_Camera, 0.)
call FadeIn(2.)
call SetUnitPosition( pc.u, GetRectCenterX(gg_rct_Wake_Up_1), GetRectCenterY(gg_rct_Wake_Up_1))
call IssuePointOrder( pc.u, "move", GetRectCenterX(gg_rct_Wake_Up_1_To), GetRectCenterY(gg_rct_Wake_Up_1_To))
call Transmission(pc.u, pc.name(), "Just as bad as last time...*sighs*")
call TransmissionBuffer(pc.u, pc.name(), "Well, I guess I ought to see what deathtrap " + treyvn.name() + " has lined up for me.")
call WaitBuffer()
call WaitConclude()
call CameraOutside()
endif
call EnableTrigger(gg_trg_Camera)
call EnableTrigger(gg_trg_Talking_to_Daughter_4)
call EnableTrigger(gg_trg_Talking_to_Father_4)
call CinematicModeOff()
set spokeToDaughter = 0
set spokeToFather = 0
set gameStage = 40
endfunction
//===========================================================================
function InitTrig_Next_Morning takes nothing returns nothing
set gg_trg_Next_Morning = CreateTrigger( )
call TriggerAddAction( gg_trg_Next_Morning, function Trig_Next_Morning_Actions )
endfunction
//TESH.scrollpos=34
//TESH.alwaysfold=0
scope DaughterFour
private function secondDone takes integer from returns nothing
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "Modest too", "modest")
if from == 0 then
call cc.AddDecision(ANY, "You are to me", "are")
elseif from == 1 then
call cc.AddDecision(ANY, "I say what I see", "see")
endif
call cc.AddDecision(ANY, "I have important work", "see")
call cc.WaitForOutput(true)
if cc.OutputIndex == "modest" then
call Transmission(pc.u, pc.name(), "Alas, and modest too - wherever shall thine virtues stop?")
call TransmissionBuffer(ornia.u, ornia.name(), "*chuckles* I fear you may have strayed to teasing, my Brave Bladesman.")
call WaitBuffer()
call TransmissionBuffer(ornia.u, ornia.name(), "So off you go, my Silver Knight, to fight the evil of the night!")
call WaitBuffer()
call TransmissionBuffer(ornia.u, ornia.name(), "But... take care - and come back.")
call WaitBuffer()
call ornia.modLove(1)
call ornia.modLike(0.5)
elseif cc.OutputIndex == "are" then
call Transmission(pc.u, pc.name(), "To me, you are nought but a true lady.")
call TransmissionBuffer(ornia.u, ornia.name(), "That is kind, and it means a lot to me - thank you.")
call WaitBuffer()
call TransmissionBuffer(ornia.u, ornia.name(), "But alas, you must go - take care, and return safely.")
call WaitBuffer()
call ornia.modLike(0.5)
call ornia.modRespect(0.5)
call ornia.modTrust(0.5)
elseif cc.OutputIndex == "see" then
call Transmission(pc.u, pc.name(), "I must go; I have important work to be doing.")
call TransmissionBuffer(ornia.u, ornia.name(), "Take care of yourself, " + pc.name() + ".")
call WaitBuffer()
call ornia.modRespect(0.5)
endif
// ends
endfunction
private function flowerCheck takes nothing returns nothing
if UnitHasItem(pc.u, prettyFlower) then
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "I brought you some flowers", "flowers")
call cc.AddDecision(ANY, "I should be off", "off")
call cc.WaitForOutput(true)
if cc.OutputIndex == "flowers" then
if DaughterThree_flowers() then
call TransmissionBuffer(ornia.u, ornia.name(), "Anyway, you should really be going now.")
call WaitBuffer()
else
call TransmissionBuffer(ornia.u, ornia.name(), "*forces a smile* Well... you should go.")
call WaitBuffer()
endif
elseif cc.OutputIndex == "off" then
call Transmission(pc.u, pc.name(), "Anyway, I should be off.")
endif
endif
endfunction
private function firstDone takes nothing returns nothing
call TransmissionAndBuffer(ornia.u, ornia.name(), "Good morning; were the sheets on the floor any better than outside?")
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "Yes, thank you", "thank")
call cc.AddDecision(ANY, "A little", "little")
call cc.WaitForOutput(true)
if cc.OutputIndex == "thank" then
call Transmission(pc.u, pc.name(), "Yes, it was - thank you, " + ornia.name() + ".")
call TransmissionBuffer(ornia.u, ornia.name(), "*smiles* You're welcome; I just hope no one thinks anything... else went on.")
call WaitBuffer()
call ornia.modLike(1)
elseif cc.OutputIndex == "little" then
call Transmission(pc.u, pc.name(), "It was a little better.")
call TransmissionBuffer(ornia.u, ornia.name(), "Suit yourself; I just hope no one thinks anything... else went on.")
call WaitBuffer()
endif
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "Not of a true lady as yourself", "lady")
call cc.AddDecision(ANY, "Of one so beautiful, rumours are ever on", "beautiful")
call cc.AddDecision(ANY, "Perhaps, perhaps not; we shall see", "see")
call cc.WaitForOutput(true)
if cc.OutputIndex == "lady" then
call Transmission(pc.u, pc.name(), "Not of a true lady as yourself, " + ornia.name() + ".")
call TransmissionBuffer(ornia.u, ornia.name(), "*smiles* That's nice of you to say, even if it's not true, " + pc.name() + ".")
call WaitBuffer()
call ornia.modRespect(1)
call ornia.modLike(1)
call secondDone(0)
elseif cc.OutputIndex == "beautiful" then
call Transmission(pc.u, pc.name(), "Of one so beautiful, rumours are ever on, I am afraid.")
call TransmissionBuffer(ornia.u, ornia.name(), "*blushes* You're too kind, " + pc.name() + ".")
call WaitBuffer()
call ornia.modLove(1)
call ornia.modLike(1)
call secondDone(1)
elseif cc.OutputIndex == "see" then
call Transmission(pc.u, pc.name(), "Perhaps, perhaps not; we shall see.")
call TransmissionBuffer(ornia.u, ornia.name(), "*shrugs* I guess; you'd better be off to see father and get going.")
call WaitBuffer()
call ornia.modRespect(-0.5)
call ornia.modTrust(-0.25)
endif
call flowerCheck()
// ends
endfunction
private function first takes nothing returns nothing
call TransmissionAndBuffer(ornia.u, ornia.name(), "Good morning; how was it?")
call TriggerSleepAction(convo.DELAY)
call cc.ClearDecisionAll()
call cc.AddDecision(ANY, "Awful", "awful")
call cc.AddDecision(ANY, "I'll manage", "manage")
call cc.WaitForOutput(true)
if cc.OutputIndex == "awful" then
call Transmission(pc.u, pc.name(), "It was absolutely awful; I was left in a dark garden for six hours... and me with this terrible pain in all the ribs down my left side.")
call TransmissionBuffer(ornia.u, ornia.name(), "...are you okay? Sounds dreadful.")
call WaitBuffer()
call TransmissionBuffer(ornia.u, ornia.name(), "I'll be fine; I think I'm just a bit paranoid, really.")
call WaitBuffer()
elseif cc.OutputIndex == "manage" then
call Transmission(pc.u, pc.name(), "It wasn't great, but I'll manage; I've had worse, and I'll have a lot worse.")
call TransmissionBuffer(ornia.u, ornia.name(), "That's true; I hope it wasn't too bad.")
call WaitBuffer()
call ornia.modRespect(1)
endif
call flowerCheck()
call TransmissionBuffer(ornia.u, ornia.name(), "You've got big work to be doing - you'd better get on and speak to father.")
call WaitBuffer()
if ornia.getMood() > 3. then
call TransmissionBuffer(ornia.u, ornia.name(), "Oh, and take care, will you? I want you coming back in one piece.")
call WaitBuffer()
endif
// ends
endfunction
globals
integer sinceLast = 1
endglobals
function Trig_Talking_to_Daughter_4_Actions takes nothing returns nothing
call IssueImmediateOrder(pc.u, "holdposition")
call CinematicModeOn()
call ApplyCameraWait(gg_cam_Small_Bedroom_Camera, CINE_CAM_TIME)
if spokeToFather == 0 then //otherwise, we haz bugzor
if spokeToDaughter == 0 then
set spokeToDaughter = 1
call ornia.talkToBonus()
if daughterDone then
call firstDone()
else
call first()
endif
else
set sinceLast = IMaxBJ(sinceLast - 1, 1)
if ornia.getLike() > 4 and Ran(1./sinceLast) then
set sinceLast = 6
call Transmission(ornia.u, ornia.name(), "As much as I'd love you to stay, you better get going.")
elseif Ran(1./3) then
call Transmission(ornia.u, ornia.name(), "You've got work to be doing.")
elseif Ran(1./2) then
call Transmission(ornia.u, ornia.name(), treyvn.name() + "'s waiting to get on.")
else
call Transmission(ornia.u, ornia.name(), "The faster you get off, the faster we get those bastards.")
endif
call flowerCheck()
endif
endif
call WaitConclude()
call CinematicModeOff()
endfunction
//===========================================================================
function InitTrig_Talking_to_Daughter_4 takes nothing returns nothing
set gg_trg_Talking_to_Daughter_4 = AddTrigger(41)
call DisableTrigger(gg_trg_Talking_to_Daughter_4)
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Talking_to_Daughter_4, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Talking_to_Daughter_4, Condition( function talkToDaughterCond) )
call TriggerAddAction( gg_trg_Talking_to_Daughter_4, function Trig_Talking_to_Daughter_4_Actions )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope FatherFour
function Trig_Talking_to_Father_4_Actions takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
call DisableTrigger(gg_trg_Talking_to_Daughter_4)
call IssueImmediateOrder( udg_PlayerUnit, "holdposition" )
call ApplyCameraWait(gg_cam_Master_Bedroom_Camera, CINE_CAM_TIME)
set spokeToFather = 1
call CinematicModeOn()
call Transmission(treyvn.u, treyvn.name(), "I hope you are rested. We have much to do.")
call TransmissionBuffer(pc.u, pc.name(), "By which you mean that *I* have lots of dangerous tasks to complete?")
call WaitBuffer()
call TransmissionBuffer(treyvn.u, treyvn.name(), "However did you know?")
call WaitBuffer()
call TransmissionBuffer(pc.u, pc.name(), "I just had this feeling in my gut. Let me guess - a quest after an artefact of power?")
call WaitBuffer()
call TransmissionBuffer(treyvn.u, treyvn.name(), "Strange that you should mention that...")
call WaitBuffer()
call TransmissionBuffer(pc.u, pc.name(), "Why do I feel like I've walked into a giant cliché?")
call WaitBuffer()
call TransmissionBuffer(treyvn.u, treyvn.name(), "Would you prefer to start off by attacking the Twelve Souls?")
call WaitBuffer()
call TransmissionBuffer(treyvn.u, treyvn.name(), "By which I mean, would you prefer to start off by dying quickly and hopelessly to them?")
call WaitBuffer()
call TransmissionBuffer(pc.u, pc.name(), "When you put it that way...")
call WaitBuffer()
call TransmissionBuffer(treyvn.u, treyvn.name(), "Good. It's settled then. I'll send you to the Temple of Doom, where you must take the Divine Sword of Infinite Strength from the Devil himself, and then use it to slay a whole legion of the damned.")
call WaitBuffer()
call TransmissionBuffer(pc.u, pc.name(), "...I think I'm going down with man flu, any chance I could be excused saving the world...?")
call WaitBuffer()
call TransmissionBuffer(treyvn.u, treyvn.name(), "*laughs* Just pulling your leg, lad; I'm not sending you into certain death just yet.")
call WaitBuffer()
call TransmissionBuffer(treyvn.u, treyvn.name(), "No, I'll teleport you to an ancient Malarian Temple. There, you must recover the Heavenly Shield; we shall have need of it.")
call WaitBuffer()
call TransmissionBuffer(pc.u, pc.name(), "Won't the Malarians be a wee bit annoyed at me looting their temple?")
call WaitBuffer()
call TransmissionBuffer(treyvn.u, treyvn.name(), "Probably; deal with them as you see fit. Good bye.")
call WaitBuffer()
call WaitConclude()
call StartSound(gg_snd_MassTeleportTarget)
call CinematicFilterGenericBJ( 2., BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0., 0., 0., 100., 100., 100., 100., 0. )
call PolledWait(2.)
call CinematicFilterGenericBJ( 2., BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 100., 100., 100., 0., 0., 0., 0., 0. )
call PolledWait(3.)
call FadeOut(0.)
call CinematicModeOff()
call TriggerExecute(gg_trg_End_of_Demo)
endfunction
//===========================================================================
function InitTrig_Talking_to_Father_4 takes nothing returns nothing
set gg_trg_Talking_to_Father_4 = AddTrigger( 42 )
call DisableTrigger(gg_trg_Talking_to_Father_4)
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Talking_to_Father_4, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Talking_to_Father_4, Condition( function talkToFatherCond ) )
call TriggerAddAction( gg_trg_Talking_to_Father_4, function Trig_Talking_to_Father_4_Actions )
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Impossible_Loading_Actions takes nothing returns nothing
if GetDifficulty() == 4 then
call DisplayText("|c00ffaaaaCannot load from Impossible difficulty save.")
call KillUnit(udg_PlayerUnit)
endif
endfunction
//===========================================================================
function InitTrig_Impossible_Loading takes nothing returns nothing
set gg_trg_Impossible_Loading = CreateTrigger( )
call TriggerRegisterGameLoadedEventBJ( gg_trg_Impossible_Loading )
call TriggerAddAction( gg_trg_Impossible_Loading, function Trig_Impossible_Loading_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
globals
string END_LEVEL_STRING = "endChapter1"
endglobals
function Trig_End_of_Demo_Actions takes nothing returns nothing
call SaveCheckpoint(END_LEVEL_STRING)
if GetDifficulty() == 4 then
call DisplayText("Congratulations, you've beaten the game on Impossible!")
call PolledWait(5.)
call DisplayText("You are either insane, insanely good, or just a cheating scumbag.")
call PolledWait(5.)
call DisplayText("What do you mean, why was this so hard? It's called impossible - don't blame me.")
call PolledWait(8.)
endif
call CustomVictoryBJ( Player(0), false, false )
endfunction
//===========================================================================
function InitTrig_End_of_Demo takes nothing returns nothing
set gg_trg_End_of_Demo = CreateTrigger( )
call TriggerAddAction( gg_trg_End_of_Demo, function Trig_End_of_Demo_Actions )
endfunction