mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-26 03:27:44 +00:00
Abandon quest.
This commit is contained in:
parent
44fb2c9db3
commit
22edf9b155
4 changed files with 13 additions and 10 deletions
|
@ -183,7 +183,7 @@ namespace Sapphire::Entity
|
|||
void unfinishQuest( uint16_t questId );
|
||||
|
||||
/*! remove a given quest */
|
||||
void removeQuest( uint16_t questId );
|
||||
void removeQuest( uint16_t questId, bool abandoned );
|
||||
|
||||
/*! add a quest to the completed quests mask */
|
||||
void updateQuestsCompleted( uint32_t questId );
|
||||
|
|
|
@ -18,7 +18,7 @@ void Sapphire::Entity::Player::finishQuest( uint16_t questId )
|
|||
|
||||
int8_t idx = getQuestIndex( questId );
|
||||
|
||||
removeQuest( questId );
|
||||
removeQuest( questId, false );
|
||||
updateQuestsCompleted( questId );
|
||||
|
||||
sendQuestTracker();
|
||||
|
@ -31,7 +31,7 @@ void Sapphire::Entity::Player::unfinishQuest( uint16_t questId )
|
|||
sendQuestInfo();
|
||||
}
|
||||
|
||||
void Sapphire::Entity::Player::removeQuest( uint16_t questId )
|
||||
void Sapphire::Entity::Player::removeQuest( uint16_t questId, bool abandoned )
|
||||
{
|
||||
|
||||
int8_t idx = getQuestIndex( questId );
|
||||
|
@ -45,11 +45,14 @@ void Sapphire::Entity::Player::removeQuest( uint16_t questId )
|
|||
questUpdatePacket->data().questInfo.c.sequence = 0xFF;
|
||||
queuePacket( questUpdatePacket );
|
||||
|
||||
auto questFinishPacket = makeZonePacket< FFXIVIpcQuestFinish >( getId() );
|
||||
questFinishPacket->data().questId = questId;
|
||||
questFinishPacket->data().flag1 = 1;
|
||||
questFinishPacket->data().flag2 = 1;
|
||||
queuePacket( questFinishPacket );
|
||||
if( !abandoned )
|
||||
{
|
||||
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++ )
|
||||
{
|
||||
|
|
|
@ -308,7 +308,7 @@ void Sapphire::Network::GameConnection::clientTriggerHandler( FrameworkPtr pFw,
|
|||
}
|
||||
case ClientTriggerType::AbandonQuest:
|
||||
{
|
||||
player.removeQuest( static_cast< uint16_t >( param1 ) );
|
||||
player.removeQuest( static_cast< uint16_t >( param1 ), true );
|
||||
break;
|
||||
}
|
||||
case ClientTriggerType::RequestHousingBuildPreset:
|
||||
|
|
|
@ -379,7 +379,7 @@ void Sapphire::Network::GameConnection::gm1Handler( FrameworkPtr pFw,
|
|||
}
|
||||
case GmCommand::QuestCancel:
|
||||
{
|
||||
targetPlayer->removeQuest( static_cast< uint16_t >( param1 ) );
|
||||
targetPlayer->removeQuest( static_cast< uint16_t >( param1 ), true );
|
||||
break;
|
||||
}
|
||||
case GmCommand::QuestComplete:
|
||||
|
|
Loading…
Add table
Reference in a new issue