mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-06 10:47:45 +00:00
better handling of EventStart IPC for instances
This commit is contained in:
parent
0aae810e16
commit
33429a0284
5 changed files with 21 additions and 8 deletions
|
@ -999,7 +999,7 @@ struct FFXIVIpcEventStart : FFXIVIpcBasePacket<EventStart>
|
||||||
/* 000D */ uint8_t param2;
|
/* 000D */ uint8_t param2;
|
||||||
/* 000E */ uint16_t padding;
|
/* 000E */ uint16_t padding;
|
||||||
/* 0010 */ uint32_t param3;
|
/* 0010 */ uint32_t param3;
|
||||||
/* 0014 */ uint32_t padding1;
|
/* 0014 */ uint32_t contentId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ public:
|
||||||
/*! start an event item action */
|
/*! start an event item action */
|
||||||
void eventItemActionStart( uint32_t eventId, uint32_t action, ActionCallback finishCallback, ActionCallback interruptCallback, uint64_t additional );
|
void eventItemActionStart( uint32_t eventId, uint32_t action, ActionCallback finishCallback, ActionCallback interruptCallback, uint64_t additional );
|
||||||
/*! start/register a normal event */
|
/*! start/register a normal event */
|
||||||
void eventStart( uint64_t actorId, uint32_t eventId, Event::EventHandler::EventType eventParam, uint8_t eventParam1, uint32_t eventParam2 );
|
void eventStart( uint64_t actorId, uint32_t eventId, Event::EventHandler::EventType eventParam, uint8_t eventParam1, uint32_t eventParam2, uint32_t contentId = 0 );
|
||||||
/*! play a subevent */
|
/*! play a subevent */
|
||||||
void eventPlay( uint32_t eventId, uint32_t scene, uint32_t flags, uint32_t eventParam2, uint32_t eventParam3 );
|
void eventPlay( uint32_t eventId, uint32_t scene, uint32_t flags, uint32_t eventParam2, uint32_t eventParam3 );
|
||||||
/*! play a subevent */
|
/*! play a subevent */
|
||||||
|
|
|
@ -77,7 +77,7 @@ void Core::Entity::Player::checkEvent( uint32_t eventId )
|
||||||
|
|
||||||
void Core::Entity::Player::eventStart( uint64_t actorId, uint32_t eventId,
|
void Core::Entity::Player::eventStart( uint64_t actorId, uint32_t eventId,
|
||||||
Event::EventHandler::EventType eventType, uint8_t eventParam1,
|
Event::EventHandler::EventType eventType, uint8_t eventParam1,
|
||||||
uint32_t eventParam2 )
|
uint32_t eventParam2, uint32_t contentId )
|
||||||
{
|
{
|
||||||
|
|
||||||
auto newEvent = Event::make_EventHandler( this, actorId, eventId, eventType, eventParam2 );
|
auto newEvent = Event::make_EventHandler( this, actorId, eventId, eventType, eventParam2 );
|
||||||
|
@ -86,7 +86,7 @@ void Core::Entity::Player::eventStart( uint64_t actorId, uint32_t eventId,
|
||||||
|
|
||||||
setStateFlag( PlayerStateFlag::InNpcEvent );
|
setStateFlag( PlayerStateFlag::InNpcEvent );
|
||||||
|
|
||||||
EventStartPacket eventStart( getId(), actorId, eventId, eventType, eventParam1, eventParam2 );
|
EventStartPacket eventStart( getId(), actorId, eventId, eventType, eventParam1, eventParam2, contentId );
|
||||||
|
|
||||||
queuePacket( eventStart );
|
queuePacket( eventStart );
|
||||||
|
|
||||||
|
|
|
@ -158,12 +158,22 @@ void Core::Network::GameConnection::eventHandlerEnterTerritory( const Packets::G
|
||||||
|
|
||||||
player.sendDebug( "Calling: " + objName + "." + eventName + " - " + std::to_string( eventId ) );
|
player.sendDebug( "Calling: " + objName + "." + eventName + " - " + std::to_string( eventId ) );
|
||||||
|
|
||||||
player.eventStart( player.getId(), eventId, Event::EventHandler::EnterTerritory, 0, player.getZoneId() );
|
player.eventStart( player.getId(), eventId, Event::EventHandler::EnterTerritory, 0, player.getZoneId(), 0 );
|
||||||
|
|
||||||
if( auto instance = player.getCurrentInstance() )
|
if( auto instance = player.getCurrentInstance() )
|
||||||
|
{
|
||||||
|
// param2 of eventStart
|
||||||
|
// 0 = default state?
|
||||||
|
// 1 = restore state?
|
||||||
|
|
||||||
|
player.eventStart( player.getId(), eventId, Event::EventHandler::EnterTerritory, 0, player.getZoneId(), instance->getDirectorId() & 0xFFFF );
|
||||||
instance->onEnterTerritory( player, eventId, param1, param2 );
|
instance->onEnterTerritory( player, eventId, param1, param2 );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
player.eventStart( player.getId(), eventId, Event::EventHandler::EnterTerritory, 0, player.getZoneId() );
|
||||||
g_scriptMgr.onEnterTerritory( player, eventId, param1, param2 );
|
g_scriptMgr.onEnterTerritory( player, eventId, param1, param2 );
|
||||||
|
}
|
||||||
|
|
||||||
player.checkEvent( eventId );
|
player.checkEvent( eventId );
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,10 +20,11 @@ public:
|
||||||
uint32_t eventId,
|
uint32_t eventId,
|
||||||
uint8_t param1 = 0,
|
uint8_t param1 = 0,
|
||||||
uint8_t param2 = 0,
|
uint8_t param2 = 0,
|
||||||
uint32_t param3 = 0 ) :
|
uint32_t param3 = 0,
|
||||||
|
uint32_t contentId = 0 ) :
|
||||||
ZoneChannelPacket< FFXIVIpcEventStart >( playerId, playerId )
|
ZoneChannelPacket< FFXIVIpcEventStart >( playerId, playerId )
|
||||||
{
|
{
|
||||||
initialize( actorId, eventId, param1, param2, param3 );
|
initialize( actorId, eventId, param1, param2, param3, contentId );
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -31,13 +32,15 @@ private:
|
||||||
uint32_t eventId,
|
uint32_t eventId,
|
||||||
uint8_t param1,
|
uint8_t param1,
|
||||||
uint8_t param2,
|
uint8_t param2,
|
||||||
uint32_t param3 )
|
uint32_t param3,
|
||||||
|
uint32_t contentId )
|
||||||
{
|
{
|
||||||
m_data.actorId = actorId;
|
m_data.actorId = actorId;
|
||||||
m_data.eventId = eventId;
|
m_data.eventId = eventId;
|
||||||
m_data.param1 = param1;
|
m_data.param1 = param1;
|
||||||
m_data.param2 = param2;
|
m_data.param2 = param2;
|
||||||
m_data.param3 = param3;
|
m_data.param3 = param3;
|
||||||
|
m_data.contentId = contentId;
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue