mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-24 05:37:45 +00:00
Song learn functions moved
This commit is contained in:
parent
495f651bce
commit
952391ae4f
5 changed files with 12 additions and 4 deletions
|
@ -115,6 +115,6 @@ void ItemAction::handleSongItem()
|
|||
{
|
||||
auto player = getSourceChara()->getAsPlayer();
|
||||
|
||||
player->learnSong( m_itemAction->data().Calcu0Arg[ 0 ], m_id );
|
||||
playerMgr().onSongLearned( *player, m_itemAction->data().Calcu0Arg[ 0 ], m_id );
|
||||
player->dropInventoryItem( static_cast< Common::InventoryType >( m_itemSourceContainer ), static_cast< uint8_t >( m_itemSourceSlot ) );
|
||||
}
|
|
@ -525,8 +525,6 @@ void Player::learnSong( uint8_t songId, uint32_t itemId )
|
|||
Util::valueToFlagByteIndexValue( songId, value, index );
|
||||
|
||||
m_orchestrion[ index ] |= value;
|
||||
|
||||
Network::Util::Packet::sendActorControlSelf( *this, getId(), ToggleOrchestrionUnlock, songId, 1, itemId );
|
||||
}
|
||||
|
||||
bool Player::hasReward( Common::UnlockEntry unlockId ) const
|
||||
|
|
|
@ -579,5 +579,11 @@ void PlayerMgr::onLevelChanged( Entity::Player& player, uint8_t level )
|
|||
Common::Service< World::Manager::MapMgr >::ref().updateQuests( player );
|
||||
}
|
||||
|
||||
void PlayerMgr::onSongLearned( Entity::Player& player, uint8_t songId, uint32_t itemId )
|
||||
{
|
||||
player.learnSong( songId, itemId );
|
||||
Network::Util::Packet::sendActorControlSelf( player, player.getId(), ToggleOrchestrionUnlock, songId, 1, itemId );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -46,6 +46,8 @@ namespace Sapphire::World::Manager
|
|||
|
||||
void onLevelChanged( Sapphire::Entity::Player& player, uint8_t level );
|
||||
|
||||
void onSongLearned( Sapphire::Entity::Player& player, uint8_t songId, uint32_t itemId );
|
||||
|
||||
//////////// Helpers
|
||||
|
||||
static void sendServerNotice( Sapphire::Entity::Player& player, const std::string& message );
|
||||
|
|
|
@ -328,7 +328,9 @@ void Sapphire::Network::GameConnection::gmCommandHandler( const Packets::FFXIVAR
|
|||
if( param2 == 0 )
|
||||
{
|
||||
for( uint8_t i = 0; i < 255; i++ )
|
||||
targetPlayer->learnSong( i, 0 );
|
||||
{
|
||||
playerMgr().onSongLearned( *targetPlayer, i, 0 );
|
||||
}
|
||||
|
||||
PlayerMgr::sendServerNotice( player, "All Songs for {0} were turned on.", targetPlayer->getName() );
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue