From c7023fb6a3bb36938f93ce99139b6c5bcf76d485 Mon Sep 17 00:00:00 2001 From: Mordred Date: Sun, 7 Apr 2019 23:42:24 +0200 Subject: [PATCH] Move questbattle opening scene into the script --- src/scripts/instances/questbattles/ChasingShadows.cpp | 8 ++++++-- src/world/Manager/TerritoryMgr.cpp | 4 ++-- src/world/Territory/QuestBattle.cpp | 9 +-------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/scripts/instances/questbattles/ChasingShadows.cpp b/src/scripts/instances/questbattles/ChasingShadows.cpp index 91fe7d9c..6398411f 100644 --- a/src/scripts/instances/questbattles/ChasingShadows.cpp +++ b/src/scripts/instances/questbattles/ChasingShadows.cpp @@ -49,13 +49,17 @@ public: void onEnterTerritory( QuestBattle& instance, Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2 ) override { - + player.playScene( instance.getDirectorId(), 1, + NO_DEFAULT_CAMERA | CONDITION_CUTSCENE | SILENT_ENTER_TERRI_ENV | + HIDE_HOTBAR | SILENT_ENTER_TERRI_BGM | SILENT_ENTER_TERRI_SE | + DISABLE_STEALTH | 0x00100000 | LOCK_HUD | LOCK_HOTBAR | + // todo: wtf is 0x00100000 + DISABLE_CANCEL_EMOTE, 0 ); } void onDutyComplete( QuestBattle& instance, Entity::Player& player ) override { player.updateQuest( instance.getQuestId(), 2 ); - player.exitInstance(); } }; diff --git a/src/world/Manager/TerritoryMgr.cpp b/src/world/Manager/TerritoryMgr.cpp index f02429d8..d80bff60 100644 --- a/src/world/Manager/TerritoryMgr.cpp +++ b/src/world/Manager/TerritoryMgr.cpp @@ -520,7 +520,7 @@ void Sapphire::World::Manager::TerritoryMgr::updateTerritoryInstances( uint64_t auto diff = std::difftime( tickCount, zone->getLastActivityTime() ); // todo: make this timeout configurable, though should be pretty relaxed in any case - if( diff > 6000 ) + if( diff > 60000 ) { Logger::info( "Removing HousingInteriorTerritory#{0} - has been inactive for 60 seconds", zone->getGuId() ); @@ -544,7 +544,7 @@ void Sapphire::World::Manager::TerritoryMgr::updateTerritoryInstances( uint64_t auto diff = std::difftime( tickCount, zone->getLastActivityTime() ); // todo: make this timeout configurable, though should be pretty relaxed in any case - if( diff > 6000 ) + if( diff > 60000 ) { Logger::info( "Removing QuestBattle#{0} - has been inactive for 60 seconds", zone->getGuId() ); diff --git a/src/world/Territory/QuestBattle.cpp b/src/world/Territory/QuestBattle.cpp index 097266c6..68a9fb3f 100644 --- a/src/world/Territory/QuestBattle.cpp +++ b/src/world/Territory/QuestBattle.cpp @@ -315,14 +315,6 @@ Sapphire::QuestBattle::onEnterTerritory( Entity::Player& player, uint32_t eventI { auto pScriptMgr = m_pFw->get< Scripting::ScriptMgr >(); pScriptMgr->onInstanceEnterTerritory( getAsQuestBattle(), player, eventId, param1, param2 ); - - // TODO: this may or may not be correct for questbattles - player.playScene( getDirectorId(), 1, NO_DEFAULT_CAMERA | CONDITION_CUTSCENE | SILENT_ENTER_TERRI_ENV | - HIDE_HOTBAR | SILENT_ENTER_TERRI_BGM | SILENT_ENTER_TERRI_SE | - DISABLE_STEALTH | 0x00100000 | LOCK_HUD | LOCK_HOTBAR | - // todo: wtf is 0x00100000 - DISABLE_CANCEL_EMOTE, 0 ); - } void Sapphire::QuestBattle::clearDirector( Entity::Player& player ) @@ -349,6 +341,7 @@ void Sapphire::QuestBattle::success() player.eventFinish( getDirectorId(), 1 ); auto pScriptMgr = m_pFw->get< Scripting::ScriptMgr >(); pScriptMgr->onDutyComplete( getAsQuestBattle(), *m_pPlayer ); + player.exitInstance(); } ); } );