Spoiler
-- exchange player character
-- TODO: copy this function and rename it according to the NPC you want to morph into, then set correct manifest GUID
-- NOTE: You can exchange only once at a time. You must switch back to original hero before switching to another NPC.
function IncarnateNewHero()
local si = ScriptedInterface:new()
si:IncarnateNewHero("434966")
si:delete()
end
-- set back to original hero
function IncarnateOriginalHero()
local si = ScriptedInterface:new()
si:IncarnateOriginalHero()
si:delete()
end
-- morph to alternative hero
function IncarnateNewHero_alternativeHero()
local si = ScriptedInterface:new()
si:IncarnateNewHero("429865")
si:delete()
end
-- trigger Autosave
function CreateAutosave()
local si = ScriptedInterface:new()
si:CreateAutosave()
si:delete()
end
-- set camera rotation to point to the throne
function SetCamera_GameStart()
local si = ScriptedInterface:new()
si:SetCameraOrientation (130,15)
si:delete()
end
-- set camera rotation to point to Ivy
function SetCamera_IvyTree()
local si = ScriptedInterface:new()
si:SetCameraOrientation (20,50)
si:delete()
end
-- set camera rotation to point to Lyrca
function SetCamera_LyrcaCave()
local si = ScriptedInterface:new()
si:SetCameraOrientation (190,50)
si:delete()
end
-- this is a test function
function test_function()
local si = ScriptedInterface:new()
si:PostQuestProgressMessage( "data_test_lvl01", "g4_menues" ) -- show some localized text!
si:delete()
end
-- to remove a loose quest item in an additional dialog
function Q383_RemoveIrrighsSeele()
local qsi = QuestScriptInterface:new()
qsi:ExecuteAction( "Entities.135636.LootStatus", "ConsumeQuestItem" )
qsi:delete()
end
-- teleport scripts
function TeleportToNightmareDialog1()
local qsi = QuestScriptInterface:new()
qsi:SetHeroLocation(17704, 467661, 4665, 0, 0, 41)
qsi:delete()
end
function TeleportToNightmareDialog1_underground()
local qsi = QuestScriptInterface:new()
qsi:SetHeroLocation(17704, 468145, 4503, 0, 0, 41)
qsi:delete()
end
function TeleportToIvy()
local qsi = QuestScriptInterface:new()
qsi:SetHeroLocation(67550, 444546, 4377, 0, 0, 41)
qsi:delete()
end
function TeleportToThorniaraCastle()
local qsi = QuestScriptInterface:new()
qsi:SetHeroLocation(84308, 273996, 7310, 0, 0, -84)
qsi:delete()
end
function TeleportOutOfMonastery()
local qsi = QuestScriptInterface:new()
qsi:SetHeroLocation(155387, 49138, 11828, 0, 0, 41)
qsi:delete()
end
-- tutorial scripts
function HideUI()
local si = ScriptedInterface:new()
si:HideInGameUI( true )
si:delete()
end
function ShowUI()
local si = ScriptedInterface:new()
si:HideInGameUI( false )
si:delete()
end
function DisableScreens()
local si = ScriptedInterface:new()
-- si:SetDreamDungeonState( true )
si:DisableUserScreens( true )
si:delete()
end
function EnableScreens()
local si = ScriptedInterface:new()
si:SetDreamDungeonState( false )
si:DisableUserScreens( false )
si:delete()
end
function ClearTutorialMessages()
local si = ScriptedInterface:new()
si:TutorialClear()
si:delete()
end
function ShowMoveTutorialMessage()
local si = ScriptedInterface:new()
si:TutorialOverlay( "overlay_move" )
si:TutorialAction( "message_text", "move forward" )
si:TutorialAction( "message_text2", "move backward" )
si:TutorialAction( "message_text3", "move left" )
si:TutorialAction( "message_text4", "move right" )
si:delete()
end
function ShowAttackTutorialMessage()
local si = ScriptedInterface:new()
si:TutorialOverlay( "overlay_attack" )
si:TutorialAction( "message_text", "attack" )
si:TutorialAction( "message_text2", "aim holster weapon" )
si:delete()
end
function ShowBlockTutorialMessage()
local si = ScriptedInterface:new()
si:TutorialOverlay( "overlay_block" )
si:TutorialAction( "message_text", "hold block" )
si:delete()
end
function ShowJumpTutorialMessage()
local si = ScriptedInterface:new()
si:TutorialOverlay( "overlay_jump" )
si:TutorialAction( "message_text", "jump" )
si:delete()
end
function ShowInteractTutorialMessage()
local si = ScriptedInterface:new()
si:TutorialOverlay( "overlay_interact" )
si:TutorialAction( "message_text", "action" )
si:delete()
end
function ShowRollTutorialMessage()
local si = ScriptedInterface:new()
si:TutorialOverlay( "overlay_roll" )
si:TutorialAction( "message_text", "hold block" )
si:delete()
end
function ShowSprintTutorialMessage()
local si = ScriptedInterface:new()
si:TutorialOverlay( "overlay_sprint" )
si:TutorialAction( "message_text", "sprint" )
si:delete()
end
function ShowJumpFarTutorialMessage()
local si = ScriptedInterface:new()
si:TutorialOverlay( "message_text", "overlay_jump_far" )
si:delete()
end
function ShowBowAttackTutorialMessage()
local si = ScriptedInterface:new()
si:TutorialOverlay( "overlay_bow_attack" )
si:TutorialAction( "message_text", "attack" )
si:delete()
end
function ShowLockTutorialMessage()
local si = ScriptedInterface:new()
si:TutorialOverlay( "overlay_lock" )
si:TutorialAction( "message_text", "lock target" )
si:delete()
end
-- inventory_message -> triggered in last line of dialog with Knut @ bridge
function ShowInventoryPopupMessage()
local si = ScriptedInterface:new()
si:FullScreenTutorialMessage( "inventory_message" );
si:FullScreenTutorialAction( "inventory_message", "message_text", "inventory" )
si:delete()
end
-- levelup_message -> after gromar (after tomb)
function ShowLevelupPopupMessage()
-- Don't show in demo
--local si = ScriptedInterface:new()
--si:FullScreenTutorialMessage( "levelup_message" );
--si:FullScreenTutorialAction( "levelup_message", "message_text", "skills" )
--si:delete()
end
-- quickbar_message -> after Lyrca in cave (scrolls)
function ShowQuickbarPopupMessage()
local si = ScriptedInterface:new()
si:FullScreenTutorialMessage( "quickbar_message" );
si:delete()
end
-- lockpicking_message -> after dialog with Diego in ST prison
function ShowLockpickingPopupMessage()
local si = ScriptedInterface:new()
si:FullScreenTutorialMessage( "lockpicking_message" );
si:delete()
end
-- map_message -> triggered in Zone behind Knut's bridge
function ShowMapPopupMessage()
local si = ScriptedInterface:new()
si:FullScreenTutorialMessage( "map_message" );
si:FullScreenTutorialAction( "map_message", "message_text", "map" )
si:delete()
end
-- crafting_message -> ????
function ShowCraftingPopupMessage()
-- Don't show in demo
--local si = ScriptedInterface:new()
--si:FullScreenTutorialMessage( "crafting_message" );
--si:FullScreenTutorialAction( "crafting_message", "message_text", "handcraft" )
--si:delete()
end
-- questlog_message -> triggered by last line of quest briefing @ Ivy
function ShowQuestlogPopupMessage()
EnablePlayerControls();
local si = ScriptedInterface:new()
si:FullScreenTutorialMessage( "questlog_message" );
si:FullScreenTutorialAction( "questlog_message", "message_text", "quest log" )
si:delete()
end
-- hud_message -> triggerd by trigger area on FE sheep meadow, in variable "FE_Tutorial_Message_hud"
function ShowHudPopupMessage()
local si = ScriptedInterface:new()
si:FullScreenTutorialMessage( "hud_message" );
si:delete()
end
-- bow_message -> triggered at the end of Q810
function ShowBowPopupMessage()
local si = ScriptedInterface:new()
si:FullScreenTutorialMessage( "bow_message" );
si:FullScreenTutorialAction( "bow_message", "message_text", "activate item ranged" )
si:delete()
end
-- loot_message
-- see variable "FE_Tutorial_Message_loot"; -> triggered on:
-- - the first kill of any molerat
-- - or after the second goblin at the beach
-- - or on getting close to the chest in Melgan's tomb
function ShowLootPopupMessage()
local si = ScriptedInterface:new()
si:FullScreenTutorialMessage( "loot_message" );
si:FullScreenTutorialAction( "loot_message", "message_text", "action" )
si:delete()
end
-- helper
function ResetHeroModelAfterDreamDungeonAndStartInteractTree()
local si = ScriptedInterface:new()
--si:ChangeHero("434966")
si:IncarnateOriginalHero()
si:StartHeroInteraction( "434685", true, true ); -- FE Sleep Tree (hero wake up at Ivy)
si:delete()
end
function ResetHeroModel()
local si = ScriptedInterface:new()
--si:ChangeHero("434966")
si:IncarnateOriginalHero()
si:delete()
end
function RequestDialogExit()
local qsi = QuestScriptInterface:new()
qsi:RequestDialogExit()
qsi:delete()
end
function EnablePlayerControls()
local si = ScriptedInterface:new()
si:EnablePlayerControls( true )
si:delete()
end
function DisablePlayerControls()
local si = ScriptedInterface:new()
si:EnablePlayerControls( false )
si:delete()
end
-- Time
function SetTimeSix()
local si = ScriptedInterface:new()
si:SetTime( 6.0/24.0 )
si:delete()
end
function SetTimeSeven()
local si = ScriptedInterface:new()
si:SetTime( 7.0/24.0 )
si:delete()
end
function SetTimeTen()
local si = ScriptedInterface:new()
si:SetTime( 10.0/24.0 )
si:delete()
end
-- FMVs
function PlayOutro()
local si = ScriptedInterface:new()
si:RequestFMVPlay( 202014 )
si:delete()
end
function PlayFMV02()
local si = ScriptedInterface:new()
si:RequestFMVPlay( 63342 )
si:delete()
end
function PlayFMV03()
local si = ScriptedInterface:new()
si:RequestFMVPlay( 63343 )
si:delete()
end
function PlayFMV04()
local si = ScriptedInterface:new()
si:RequestFMVPlay( 63344 )
si:delete()
end
function PlayFMV05()
local si = ScriptedInterface:new()
si:RequestFMVPlay( 63345 )
si:delete()
end
function PlayFMV06()
local si = ScriptedInterface:new()
si:RequestFMVPlay( 94798 )
si:delete()
end
function PlayFMV_outro()
local si = ScriptedInterface:new()
si:RequestFMVPlay( 63347 )
si:delete()
end
function PlayFMV_intro()
local si = ScriptedInterface:new()
si:RequestFMVPlay( 63346 )
si:delete()
end
function PlayFMV_black()
local si = ScriptedInterface:new()
si:RequestFMVPlay( 202014 )
si:delete()
end
function SetCheatHero()
local si = ScriptedInterface:new()
si:ChangeHero("7793")
si:delete()
end
function SetDreamHero()
local si = ScriptedInterface:new()
--si:ChangeHero("456285")
si:IncarnateNewHero("456285")
si:delete()
end
function SetCheatHeroNoSkills()
local si = ScriptedInterface:new()
si:ChangeHero("573028")
si:delete()
end
function ResetBlackShroud()
local si = ScriptedInterface:new()
si:ResetBlackShroud()
si:delete()
end
function LeaveFeshyr()
local si = ScriptedInterface:new()
si:SetVariableValue( "Hero.OnFeshyr", "FALSE" )
si:delete()
end
function GiveAmuletToIrrigh()
local qsi = QuestScriptInterface:new()
qsi:GiveItemTo("7655", "638919", 1)
qsi:delete()
end
function TakeAmuletFromIrrigh()
local qsi = QuestScriptInterface:new()
qsi:GiveItemTo("7655", "638919", -1)
qsi:delete()
end
function KillEggsack()
local qsi = QuestScriptInterface:new()
qsi:KillActor("604065")
qsi:delete()
end
function ArmorSelectionStewark()
local si = ScriptedInterface:new()
si:OpenArmorSelection( "textures\\interface\\armors\\stewark_armors.dds", "427935", "523568", "427941" )
si:delete()
end
function ArmorSelectionTooshoo()
local si = ScriptedInterface:new()
si:OpenArmorSelection( "textures\\interface\\armors\\tooshoo_armors.dds", "427978", "523583", "428002" )
si:delete()
end
function ArmorSelectionThorniara()
local si = ScriptedInterface:new()
si:OpenArmorSelection( "textures\\interface\\armors\\thorniara_armors.dds", "427959", "523576", "427966" )
si:delete()
end
-- Fade out
function FadeOut( _fTimeFadeOut, _fMaxDuration, _fTimeFadeIn )
if ( _fTimeFadeOut == nil ) then
_fTimeFadeOut = 0.0
end
if ( _fMaxDuration == nil ) then
_fMaxDuration = 10.0
end
if ( _fTimeFadeIn == nil ) then
_fTimeFadeIn = _fTimeFadeOut
end
local si = ScriptedInterface:new()
si:FadeOut( _fTimeFadeOut, _fMaxDuration, _fTimeFadeIn )
si:delete()
end
-- Fade in
function FadeIn( _fTimeFadeIn )
if ( _fTimeFadeIn == nil ) then
_fTimeFadeIn = 0.0
end
local si = ScriptedInterface:new()
si:FadeIn( _fTimeFadeIn )
si:delete()
end
-- this is called at game start; it has no explicit fade-in call!
function Blackscreen_at_start_of_game()
FadeOut( 0, 3, 2 )
end
-- this is called in the Nightmare, during Rhobar's dialog. It gets overridden by FE_Nighmare_FadeInAfterDialog
function FE_Nightmare_FadeOutDuringDialog()
FadeOut( 3, 10, 0.5 )
end
-- this is called after the starting dialog in the Nightmare; note that there is another fade-to-black active that comes form the dialog - that one gets overridden hereby
function FE_Nighmare_FadeInAfterDialog()
FadeOut( 0, 1.2, 1.2 )
end
-- this is called at the end of the FE nightmare dungeon
function Blackscreen_after_nightmare_and_end_dialog()
FadeOut( 4, 20, 1 )
RequestDialogExit()
end
function FadeIn_Short()
FadeIn( 1 )
end
-- this is called at the teleport into the root parasite dungeon
function Blackscreen_at_RootParasiteStart_and_RequestEndDialog()
FadeOut( 2, 6, 1 )
RequestDialogExit()
end
function rescueSheep()
-- if this was an XML, the call would be: <script statement="actor:AddExperience( 300 )" actor="Hero" />
end
-- Set auto rotation speed
function SetCameraAutoRotation( _fSpeed )
local si = ScriptedInterface:new()
si:SetCameraAutoRotation( _fSpeed )
si:delete()
end
function StartHeroInteraction( strInteractable, bSkipStart, bTeleport )
local si = ScriptedInterface:new()
si:StartHeroInteraction( strInteractable, bSkipStart, bTeleport )
si:delete()
end
function DreamOn()
local si = ScriptedInterface:new()
si:SetDreamDungeonState( true )
si:delete()
end
function DreamOff()
local si = ScriptedInterface:new()
si:SetDreamDungeonState( false )
si:delete()
end
-- DEMO end: set camera rotation to point to the throne
function SetCamera_DemoEnd()
local si = ScriptedInterface:new()
si:SetCameraOrientation (90,20)
si:delete()
DreamOn()
end
function Execute( actor )
actor:AddExperience( 100 );
end
function Execute( actor )
local si = ScriptedInterface:new()
si:PostQuestProgressMessage( "TEST!" )
si:delete()
end