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