mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-26 22:37:45 +00:00
Merge pull request #271 from Minoost/develop-qte_cmd
Add a qte event command
This commit is contained in:
commit
c1e85cf9f1
3 changed files with 63 additions and 0 deletions
|
@ -792,4 +792,35 @@ void Core::DebugCommandHandler::instance( char* data, Entity::Player &player, bo
|
||||||
|
|
||||||
player.getCurrentZone()->setCurrentFestival( 0 );
|
player.getCurrentZone()->setCurrentFestival( 0 );
|
||||||
}
|
}
|
||||||
|
else if ( subCommand == "qte_start" )
|
||||||
|
{
|
||||||
|
auto instance = boost::dynamic_pointer_cast< InstanceContent >( player.getCurrentZone() );
|
||||||
|
if ( !instance )
|
||||||
|
return;
|
||||||
|
|
||||||
|
player.sendDebug( "qte start" );
|
||||||
|
instance->startQte();
|
||||||
|
}
|
||||||
|
else if ( subCommand == "event_start" )
|
||||||
|
{
|
||||||
|
auto instance = boost::dynamic_pointer_cast< InstanceContent >( player.getCurrentZone() );
|
||||||
|
if ( !instance )
|
||||||
|
return;
|
||||||
|
|
||||||
|
player.sendDebug( "evt start" );
|
||||||
|
instance->startEventCutscene();
|
||||||
|
}
|
||||||
|
else if ( subCommand == "event_end" )
|
||||||
|
{
|
||||||
|
auto instance = boost::dynamic_pointer_cast< InstanceContent >( player.getCurrentZone() );
|
||||||
|
if ( !instance )
|
||||||
|
return;
|
||||||
|
|
||||||
|
player.sendDebug( "evt end" );
|
||||||
|
instance->endEventCutscene();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player.sendDebug( "Unknown sub command." );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -271,6 +271,34 @@ void Core::InstanceContent::setBranch( uint8_t value )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Core::InstanceContent::startQte()
|
||||||
|
{
|
||||||
|
for ( const auto& playerIt : m_playerMap )
|
||||||
|
{
|
||||||
|
auto player = playerIt.second;
|
||||||
|
player->queuePacket( ActorControlPacket143( player->getId(), DirectorUpdate, getDirectorId(), 0x8000000A ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Core::InstanceContent::startEventCutscene()
|
||||||
|
{
|
||||||
|
// TODO: lock player movement
|
||||||
|
for ( const auto& playerIt : m_playerMap )
|
||||||
|
{
|
||||||
|
auto player = playerIt.second;
|
||||||
|
player->queuePacket( ActorControlPacket143( player->getId(), DirectorUpdate, getDirectorId(), 0x80000008 ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Core::InstanceContent::endEventCutscene()
|
||||||
|
{
|
||||||
|
for ( const auto& playerIt : m_playerMap )
|
||||||
|
{
|
||||||
|
auto player = playerIt.second;
|
||||||
|
player->queuePacket( ActorControlPacket143( player->getId(), DirectorUpdate, getDirectorId(), 0x80000009 ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Core::InstanceContent::onRegisterEObj( Entity::EventObjectPtr object )
|
void Core::InstanceContent::onRegisterEObj( Entity::EventObjectPtr object )
|
||||||
{
|
{
|
||||||
if( object->getName() != "none" )
|
if( object->getName() != "none" )
|
||||||
|
|
|
@ -46,6 +46,10 @@ public:
|
||||||
void setSequence( uint8_t value );
|
void setSequence( uint8_t value );
|
||||||
void setBranch( uint8_t value );
|
void setBranch( uint8_t value );
|
||||||
|
|
||||||
|
void startQte();
|
||||||
|
void startEventCutscene();
|
||||||
|
void endEventCutscene();
|
||||||
|
|
||||||
boost::shared_ptr< Core::Data::InstanceContent > getInstanceContentInfo() const;
|
boost::shared_ptr< Core::Data::InstanceContent > getInstanceContentInfo() const;
|
||||||
|
|
||||||
uint32_t getInstanceContentId() const;
|
uint32_t getInstanceContentId() const;
|
||||||
|
|
Loading…
Add table
Reference in a new issue