mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-29 07:37:45 +00:00
Merge pull request #617 from collett8192/abandon_quest
Move quest finish packet to where it belongs to so we can abandon que…
This commit is contained in:
commit
b29b202a6f
1 changed files with 8 additions and 12 deletions
|
@ -15,14 +15,19 @@ using namespace Sapphire::Network::Packets::Server;
|
||||||
|
|
||||||
void Sapphire::Entity::Player::finishQuest( uint16_t questId )
|
void Sapphire::Entity::Player::finishQuest( uint16_t questId )
|
||||||
{
|
{
|
||||||
|
|
||||||
int8_t idx = getQuestIndex( questId );
|
int8_t idx = getQuestIndex( questId );
|
||||||
|
|
||||||
removeQuest( questId );
|
removeQuest( questId );
|
||||||
|
|
||||||
|
auto questFinishPacket = makeZonePacket< FFXIVIpcQuestFinish >( getId() );
|
||||||
|
questFinishPacket->data().questId = questId;
|
||||||
|
questFinishPacket->data().flag1 = 1;
|
||||||
|
questFinishPacket->data().flag2 = 1;
|
||||||
|
queuePacket( questFinishPacket );
|
||||||
|
|
||||||
updateQuestsCompleted( questId );
|
updateQuestsCompleted( questId );
|
||||||
|
|
||||||
sendQuestTracker();
|
//sendQuestTracker(); already sent in removeQuest()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sapphire::Entity::Player::unfinishQuest( uint16_t questId )
|
void Sapphire::Entity::Player::unfinishQuest( uint16_t questId )
|
||||||
|
@ -33,24 +38,16 @@ void Sapphire::Entity::Player::unfinishQuest( uint16_t questId )
|
||||||
|
|
||||||
void Sapphire::Entity::Player::removeQuest( uint16_t questId )
|
void Sapphire::Entity::Player::removeQuest( uint16_t questId )
|
||||||
{
|
{
|
||||||
|
|
||||||
int8_t idx = getQuestIndex( questId );
|
int8_t idx = getQuestIndex( questId );
|
||||||
|
|
||||||
if( ( idx != -1 ) && ( m_activeQuests[ idx ] != nullptr ) )
|
if( ( idx != -1 ) && ( m_activeQuests[ idx ] != nullptr ) )
|
||||||
{
|
{
|
||||||
|
|
||||||
auto questUpdatePacket = makeZonePacket< FFXIVIpcQuestUpdate >( getId() );
|
auto questUpdatePacket = makeZonePacket< FFXIVIpcQuestUpdate >( getId() );
|
||||||
questUpdatePacket->data().slot = static_cast< uint8_t >( idx );
|
questUpdatePacket->data().slot = static_cast< uint8_t >( idx );
|
||||||
questUpdatePacket->data().questInfo.c.questId = 0;
|
questUpdatePacket->data().questInfo.c.questId = 0;
|
||||||
questUpdatePacket->data().questInfo.c.sequence = 0xFF;
|
questUpdatePacket->data().questInfo.c.sequence = 0xFF;
|
||||||
queuePacket( questUpdatePacket );
|
queuePacket( questUpdatePacket );
|
||||||
|
|
||||||
auto questFinishPacket = makeZonePacket< FFXIVIpcQuestFinish >( getId() );
|
|
||||||
questFinishPacket->data().questId = questId;
|
|
||||||
questFinishPacket->data().flag1 = 1;
|
|
||||||
questFinishPacket->data().flag2 = 1;
|
|
||||||
queuePacket( questFinishPacket );
|
|
||||||
|
|
||||||
for( int32_t ii = 0; ii < 5; ii++ )
|
for( int32_t ii = 0; ii < 5; ii++ )
|
||||||
{
|
{
|
||||||
if( m_questTracking[ ii ] == idx )
|
if( m_questTracking[ ii ] == idx )
|
||||||
|
@ -67,7 +64,6 @@ void Sapphire::Entity::Player::removeQuest( uint16_t questId )
|
||||||
}
|
}
|
||||||
|
|
||||||
sendQuestTracker();
|
sendQuestTracker();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Sapphire::Entity::Player::hasQuest( uint32_t questId )
|
bool Sapphire::Entity::Player::hasQuest( uint32_t questId )
|
||||||
|
|
Loading…
Add table
Reference in a new issue