From 7883143089c87833c9040b54e25c4291b2f0d440 Mon Sep 17 00:00:00 2001 From: Filip Maj Date: Sat, 27 Jul 2019 22:43:47 -0400 Subject: [PATCH] Added script to handle what happens after a dream that causes a warp. Adds a quest for Hildi ones, warps all other 3. --- Data/scripts/commands/LoginEventCommand.lua | 37 +++++++++++++++++++++ Data/scripts/global.lua | 14 ++++++++ 2 files changed, 51 insertions(+) create mode 100644 Data/scripts/commands/LoginEventCommand.lua diff --git a/Data/scripts/commands/LoginEventCommand.lua b/Data/scripts/commands/LoginEventCommand.lua new file mode 100644 index 00000000..7236d434 --- /dev/null +++ b/Data/scripts/commands/LoginEventCommand.lua @@ -0,0 +1,37 @@ +--[[ + +LoginEventCommand Script + +Handles post-dream events. + +--]] + +require ("global") + +function onEventStarted(player, actor, triggerName, dreamCode, innCode, narg1, narg2, bedActor) + + --In Plain Sight + if (dreamCode == 1) then + player:AddQuest("Etc5g1"); + warpOutOfInn(player, innCode); + --Prophecy Inspection + elseif (dreamCode == 2) then + player:AddQuest("Etc5l3"); + warpOutOfInn(player, innCode); + --Nael Nightmare + elseif (dreamCode == 20) then + GetWorldManager():DoZoneChange(player, 244, nil, 0, SPAWN_NIGHTMARE, player.positionX, player.positionY, player.positionZ, player.rotation); + end + player:EndEvent(); + +end + +function warpOutOfInn(player, innCode) + if (innCode == 1) then + GetWorldManager():DoZoneChange(player, 133, nil, 0, 15, -444.266, 39.518, 191, 1.9); + elseif (innCode == 2) then + GetWorldManager():DoZoneChange(player, 155, nil, 0, 15, 59.252, 4, -1219.342, 0.852); + elseif (innCode == 3) then + GetWorldManager():DoZoneChange(player, 209, nil, 0, 15, -110.157, 202, 171.345, 0); + end +end \ No newline at end of file diff --git a/Data/scripts/global.lua b/Data/scripts/global.lua index e021fe76..ce3bb6bb 100644 --- a/Data/scripts/global.lua +++ b/Data/scripts/global.lua @@ -131,6 +131,20 @@ CLASSID_LNC = 8; CLASSID_THM = 22; CLASSID_CNJ = 23; +-- SPAWNS +SPAWN_NO_ANIM = 0x00; +SPAWN_ANIM1 = 0x02; +SPAWN_RETAINER = 0x03; +SPAWN_POPMOB = 0x4; +SPAWN_UKN1 = 0x5; +SPAWN_UKN2 = 0x7; +SPAWN_LOADING1 = 0x0F; +SPAWN_LOADING2 = 0x10; +SPAWN_INSTANCE_ERROR = 0x12; +SPAWN_CHOCOBO_GET = 0x13; +SPAWN_CHOCOBO_RENTAL = 0x14; +SPAWN_CUTTER_SANDS = 0x17; +SPAWN_NIGHTMARE = 0x18; --UTILS