1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-25 11:07:45 +00:00

auto skip quests without script

This commit is contained in:
collett 2020-06-17 02:17:30 +09:00
parent b42cc888a6
commit f427e21942
2 changed files with 24 additions and 2 deletions

View file

@ -1065,7 +1065,11 @@ bool Sapphire::Entity::Player::giveQuestRewards( uint32_t questId, uint32_t opti
{
for( uint32_t i = 0; i < rewardItemCount; i++ )
{
addItem( questInfo->itemReward0.at( i ), questInfo->itemCountReward0.at( i ), false, false, true, true );
auto itemId = questInfo->itemReward0.at( i );
if( itemId > 0 )
{
addItem( itemId, questInfo->itemCountReward0.at( i ), false, false, true, true );
}
}
}
@ -1074,7 +1078,7 @@ bool Sapphire::Entity::Player::giveQuestRewards( uint32_t questId, uint32_t opti
for( uint32_t i = 0; i < optionalItemCount; i++ )
{
auto itemId = questInfo->itemReward1.at( i );
if( itemId == optionalChoice )
if( itemId > 0 && itemId == optionalChoice )
{
addItem( itemId, questInfo->itemCountReward1.at( i ), false, false, true, true );
break;

View file

@ -64,7 +64,25 @@ void Sapphire::Network::GameConnection::eventHandlerTalk( const Packets::FFXIVAR
{
auto questInfo = exdData.get< Sapphire::Data::Quest >( eventId );
if( questInfo )
{
player.sendUrgent( "Quest not implemented: {0} ({1})", questInfo->name, questInfo->id );
if( player.hasQuest( eventId ) )
{
player.giveQuestRewards( eventId, 0 );
player.finishQuest( eventId );
}
else
{
player.playScene( eventId, 0, 0,
[ eventId ]( Entity::Player& player, const Event::SceneResult& result )
{
if( result.param2 == 1 )
{
player.updateQuest( eventId, 255 );
}
});
}
}
}
player.checkEvent( eventId );